added helpful info for hook searching in native and ppsspp memory
This commit is contained in:
parent
5e27de842b
commit
907c43db4a
@ -16806,6 +16806,37 @@ bool InsertVanillawareGCHook()
|
||||
return addr;
|
||||
}
|
||||
|
||||
/** Artikash 6/7/2019
|
||||
* PPSSPP JIT code has pointers, but they are all added to an offset before being used.
|
||||
Find that offset and report it to user so they can search for hooks properly.
|
||||
To find the offset, find a page of mapped memory with size 0x1f00000, read and write permissions, take its address and subtract 0x8000000.
|
||||
The above is useful for emulating PSP hardware, so unlikely to change between versions.
|
||||
*/
|
||||
bool FindPPSSPP()
|
||||
{
|
||||
bool found = false;
|
||||
SYSTEM_INFO systemInfo;
|
||||
GetNativeSystemInfo(&systemInfo);
|
||||
for (BYTE* probe = NULL; probe < systemInfo.lpMaximumApplicationAddress;)
|
||||
{
|
||||
MEMORY_BASIC_INFORMATION info;
|
||||
if (!VirtualQuery(probe, &info, sizeof(info)))
|
||||
{
|
||||
probe += systemInfo.dwPageSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (info.RegionSize == 0x1f00000 && info.Protect == PAGE_READWRITE && info.Type == MEM_MAPPED)
|
||||
{
|
||||
found = true;
|
||||
ConsoleOutput("Textractor: PPSSPP memory found: use pattern 79 0F C7 85 and pattern offset 0 and string offset %p to search for hooks", probe - 0x8000000);
|
||||
}
|
||||
probe += info.RegionSize;
|
||||
}
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
/** jichi 7/12/2014 PPSSPP
|
||||
* Tested with PPSSPP 0.9.8.
|
||||
*/
|
||||
|
@ -43,6 +43,7 @@ bool InsertTypeMoonPS2Hook(); // http://typemoon.com
|
||||
|
||||
void SpecialPSPHook(DWORD esp_base, HookParam *hp, DWORD *data, DWORD *split, DWORD *len); // General PSP extern hook
|
||||
|
||||
bool FindPPSSPP();
|
||||
bool InsertPPSSPPHooks(); // PPSSPPWindows
|
||||
|
||||
bool InsertPPSSPPHLEHooks();
|
||||
|
@ -53,6 +53,6 @@ namespace Engine
|
||||
|
||||
DetermineEngineType();
|
||||
hijacked = true;
|
||||
ConsoleOutput("Textractor: finished hijacking %S located from 0x%p to 0x%p", processName, processStartAddress, processStopAddress);
|
||||
ConsoleOutput("Textractor: finished hijacking process located from 0x%p to 0x%p", processStartAddress, processStopAddress);
|
||||
}
|
||||
}
|
||||
|
@ -36,10 +36,13 @@ bool DeterminePCEngine()
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Util::CheckFile(L"PPSSPP*.exe")) { // jichi 7/12/2014 PPSSPPWindows.exe, PPSSPPEX.exe PPSSPPSP.exe
|
||||
//InsertPPSSPPHooks(); // Artikash 8/4/2018: removed for now as doesn't work for non ancient ppsspp versions
|
||||
return true;
|
||||
}
|
||||
//if (Util::CheckFile(L"PPSSPP*.exe")) { // jichi 7/12/2014 PPSSPPWindows.exe, PPSSPPEX.exe PPSSPPSP.exe
|
||||
// //InsertPPSSPPHooks(); // Artikash 8/4/2018: removed for now as doesn't work for non ancient ppsspp versions
|
||||
// FindPPSSPP();
|
||||
// return true;
|
||||
//}
|
||||
|
||||
if (Util::CheckFile(L"PPSSPP*.exe") && FindPPSSPP()) return true;
|
||||
|
||||
if (Util::CheckFile(L"pcsx2*.exe")) { // jichi 7/19/2014 PCSX2.exe or PCSX2WX.exe
|
||||
InsertPCSX2Hooks();
|
||||
|
@ -1,9 +1,42 @@
|
||||
#include "match.h"
|
||||
#include "main.h"
|
||||
#include "native/pchooks.h"
|
||||
#include "engine.h"
|
||||
#include "util.h"
|
||||
|
||||
namespace Engine
|
||||
{
|
||||
/** Artikash 6/7/2019
|
||||
* PPSSPP JIT code has pointers, but they are all added to an offset before being used.
|
||||
Find that offset and report it to user so they can search for hooks properly.
|
||||
To find the offset, find a page of mapped memory with size 0x1f00000, read and write permissions, take its address and subtract 0x8000000.
|
||||
The above is useful for emulating PSP hardware, so unlikely to change between versions.
|
||||
*/
|
||||
bool FindPPSSPP()
|
||||
{
|
||||
bool found = false;
|
||||
SYSTEM_INFO systemInfo;
|
||||
GetNativeSystemInfo(&systemInfo);
|
||||
for (BYTE* probe = NULL; probe < systemInfo.lpMaximumApplicationAddress;)
|
||||
{
|
||||
MEMORY_BASIC_INFORMATION info;
|
||||
if (!VirtualQuery(probe, &info, sizeof(info)))
|
||||
{
|
||||
probe += systemInfo.dwPageSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (info.RegionSize == 0x1f00000 && info.Protect == PAGE_READWRITE && info.Type == MEM_MAPPED)
|
||||
{
|
||||
found = true;
|
||||
ConsoleOutput("Textractor: PPSSPP memory found: use pattern 79 10 41 C7 and pattern offset 0 and string offset %p to search for hooks", probe - 0x8000000);
|
||||
}
|
||||
probe += info.RegionSize;
|
||||
}
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
bool UnsafeDetermineEngineType()
|
||||
{
|
||||
for (std::wstring DXVersion : { L"d3dx9", L"d3dx10" })
|
||||
@ -11,6 +44,8 @@ namespace Engine
|
||||
else for (int i = 0; i < 50; ++i)
|
||||
if (HMODULE module = GetModuleHandleW((DXVersion + L"_" + std::to_wstring(i)).c_str())) PcHooks::hookD3DXFunctions(module);
|
||||
|
||||
if (Util::CheckFile(L"PPSSPP*.exe") && FindPPSSPP()) return true;
|
||||
|
||||
PcHooks::hookGDIFunctions();
|
||||
PcHooks::hookGDIPlusFunctions();
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user