mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-10-22 23:18:16 +08:00
1
Update Ryujinx.cpp Update Ryujinx.cpp Update Ryujinx.cpp Update Ryujinx.cpp
This commit is contained in:
parent
3ea04fd36b
commit
b7254033d6
@ -1,6 +1,6 @@
|
||||
include_directories(. util engines)
|
||||
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
||||
set(enginessrc livecaptions Kincaid vita3k rpcs3 yuzusuyu TYPEMOON ENTERGRAM AGES7 mono Godot 5pb lucasystem LightVN V8 pchooks Artemis KiriKiri YOX PPSSPP CMVS Suika2 )
|
||||
set(enginessrc Ryujinx livecaptions Kincaid vita3k rpcs3 yuzusuyu TYPEMOON ENTERGRAM AGES7 mono Godot 5pb lucasystem LightVN V8 pchooks Artemis KiriKiri YOX PPSSPP CMVS Suika2 )
|
||||
set(enginepath "engine64")
|
||||
set(collector "enginecollection64.cpp")
|
||||
else()
|
||||
|
83
LunaHook/engine64/Ryujinx.cpp
Normal file
83
LunaHook/engine64/Ryujinx.cpp
Normal file
@ -0,0 +1,83 @@
|
||||
#include "Ryujinx.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
/*
|
||||
const char* CEEInfo::getMethodNameFromMetadata(CORINFO_METHOD_HANDLE ftnHnd,
|
||||
const char** className,
|
||||
const char** namespaceName,
|
||||
const char** enclosingClassNames,
|
||||
size_t maxEnclosingClassNames)
|
||||
*/
|
||||
/*
|
||||
CorJitResult CILJit::compileMethod(ICorJitInfo* compHnd,
|
||||
CORINFO_METHOD_INFO* methodInfo,
|
||||
unsigned flags,
|
||||
uint8_t** entryAddress,
|
||||
uint32_t* nativeSizeOfCode)
|
||||
*/
|
||||
/*
|
||||
CorJitResult invokeCompileMethodHelper(EEJitManager *jitMgr,
|
||||
CEEInfo *comp,
|
||||
struct CORINFO_METHOD_INFO *info,
|
||||
CORJIT_FLAGS jitFlags,
|
||||
BYTE **nativeEntry,
|
||||
uint32_t *nativeSizeOfCode)
|
||||
*/
|
||||
struct CEEInfo;
|
||||
struct CORINFO_METHOD_HANDLE;
|
||||
struct CORINFO_METHOD_INFO
|
||||
{
|
||||
CORINFO_METHOD_HANDLE *ftn;
|
||||
// CORINFO_MODULE_HANDLE scope;
|
||||
// uint8_t *ILCode;
|
||||
// unsigned ILCodeSize;
|
||||
// unsigned maxStack;
|
||||
// unsigned EHcount;
|
||||
// CorInfoOptions options;
|
||||
// CorInfoRegionKind regionKind;
|
||||
// CORINFO_SIG_INFO args;
|
||||
// CORINFO_SIG_INFO locals;
|
||||
};
|
||||
const char *(*getMethodNameFromMetadata)(CEEInfo *, CORINFO_METHOD_HANDLE *, const char **, const char **, const char **) = 0;
|
||||
|
||||
}
|
||||
bool Ryujinx::attach_function()
|
||||
{
|
||||
auto invokeCompileMethodHelper = processStartAddress + 0x84CC0;
|
||||
getMethodNameFromMetadata = (decltype(getMethodNameFromMetadata))(processStartAddress + 0x7AED0);
|
||||
HookParam hp;
|
||||
hp.address = invokeCompileMethodHelper;
|
||||
hp.text_fun = [](hook_stack *stack, HookParam *hp, uintptr_t *data, uintptr_t *split, size_t *len)
|
||||
{
|
||||
auto methodInfo = (CORINFO_METHOD_INFO *)stack->r8;
|
||||
|
||||
const char *className;
|
||||
const char *namespaceName;
|
||||
const char *enclosingClassName;
|
||||
auto methodname = getMethodNameFromMetadata((CEEInfo *)stack->rdx, methodInfo->ftn, &className, &namespaceName, &enclosingClassName);
|
||||
if (!methodname)
|
||||
return;
|
||||
if (strcmp(methodname, "RegisterFunction") != 0)
|
||||
return;
|
||||
|
||||
ConsoleOutput("%s %s %s %s", className, namespaceName, enclosingClassName, methodname);
|
||||
HookParam hpinternal;
|
||||
hpinternal.user_value = stack->stack[5]; // entryAddress->RegisterFunction
|
||||
hpinternal.address = stack->retaddr;
|
||||
hpinternal.text_fun = [](hook_stack *stack, HookParam *hp, uintptr_t *data, uintptr_t *split, size_t *len)
|
||||
{
|
||||
HookParam hp_cs_function;
|
||||
hp_cs_function.address = *(uintptr_t *)hp->user_value;
|
||||
hp_cs_function.text_fun = [](hook_stack *stack, HookParam *hp, uintptr_t *data, uintptr_t *split, size_t *len)
|
||||
{
|
||||
ConsoleOutput("%p %p %p %p %p %p", stack->rcx, stack->rdx, stack->r8, stack->r9, stack->r10, stack->r11);
|
||||
};
|
||||
NewHook(hp_cs_function, "RegisterFunction");
|
||||
|
||||
hp->type = HOOK_EMPTY;
|
||||
};
|
||||
NewHook(hpinternal, "invokeCompileMethodHelper Return");
|
||||
};
|
||||
return NewHook(hp, "invokeCompileMethodHelper");
|
||||
}
|
18
LunaHook/engine64/Ryujinx.h
Normal file
18
LunaHook/engine64/Ryujinx.h
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
class Ryujinx : public ENGINE
|
||||
{
|
||||
public:
|
||||
Ryujinx()
|
||||
{
|
||||
|
||||
check_by = CHECK_BY::FILE;
|
||||
is_engine_certain = false;
|
||||
check_by = CHECK_BY::CUSTOM;
|
||||
check_by_target = []()
|
||||
{
|
||||
return wcscmp(processName_lower, L"ryujinx.exe") == 0;
|
||||
};
|
||||
};
|
||||
bool attach_function();
|
||||
};
|
@ -17,6 +17,7 @@
|
||||
#include "engine64/Kincaid.h"
|
||||
#include "engine64/LightVN.h"
|
||||
#include "engine64/yuzusuyu.h"
|
||||
#include "engine64/Ryujinx.h"
|
||||
#include "engine64/vita3k.h"
|
||||
#include "engine64/rpcs3.h"
|
||||
#include "engines/lua/lua51.h"
|
||||
@ -47,5 +48,6 @@ std::vector<ENGINE *> check_engines()
|
||||
new Kincaid,
|
||||
new livecaptions,
|
||||
new lua51,
|
||||
new Ryujinx
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user