forked from Public-Mirror/Textractor
add oleaut hooks as misc
This commit is contained in:
parent
b873ecbc96
commit
c596116a03
@ -11905,21 +11905,6 @@ bool InsertSilkysHook()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InsertSRPGHook()
|
|
||||||
{
|
|
||||||
if (DWORD addr = (DWORD)GetProcAddress(GetModuleHandleW(L"oleaut32.dll"), "SysAllocString"))
|
|
||||||
{
|
|
||||||
HookParam hp = {};
|
|
||||||
hp.offset = 4;
|
|
||||||
hp.address = addr;
|
|
||||||
hp.type = USING_STRING | USING_UNICODE;
|
|
||||||
NewHook(hp, "SRPG");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
ConsoleOutput("Textractor: SRPG: couldn't find function");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** jichi 6/1/2014 Eushully
|
/** jichi 6/1/2014 Eushully
|
||||||
* Insert to the last GetTextExtentPoint32A
|
* Insert to the last GetTextExtentPoint32A
|
||||||
*
|
*
|
||||||
|
@ -142,7 +142,6 @@ bool InsertScenarioPlayerHook();// sol-fa-soft: *.iar && *.sec5
|
|||||||
bool InsertSiglusHook(); // SiglusEngine: SiglusEngine.exe
|
bool InsertSiglusHook(); // SiglusEngine: SiglusEngine.exe
|
||||||
bool InsertSideBHook(); // SideB: Copyright side-B
|
bool InsertSideBHook(); // SideB: Copyright side-B
|
||||||
bool InsertSilkysHook(); // SilkysPlus
|
bool InsertSilkysHook(); // SilkysPlus
|
||||||
bool InsertSRPGHook(); // SilverSoft SRPG studio: *.dts
|
|
||||||
bool InsertSyuntadaHook(); // Syuntada: dSoh.dat
|
bool InsertSyuntadaHook(); // Syuntada: dSoh.dat
|
||||||
bool InsertSystem43Hook(); // System43@AliceSoft: AliceStart.ini
|
bool InsertSystem43Hook(); // System43@AliceSoft: AliceStart.ini
|
||||||
bool InsertSystemAoiHook(); // SystemAoi: *.vfs
|
bool InsertSystemAoiHook(); // SystemAoi: *.vfs
|
||||||
|
@ -449,12 +449,6 @@ bool DetermineEngineByFile4()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Artikash 1/18/2019: SRPG Studio sample game https://www.freem.ne.jp/win/game/16844
|
|
||||||
if (Util::CheckFile(L"*.dts")) {
|
|
||||||
InsertSRPGHook();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,16 +154,12 @@ void PcHooks::hookGDIPlusFunctions()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PcHooks::hookD3DXFunctions(HMODULE d3dxModule)
|
void PcHooks::hookD3DXFunctions(HMODULE d3dxModule)
|
||||||
{
|
{
|
||||||
ConsoleOutput("Textractor: inserting Direct3D hooks (EXPERIMENTAL)");
|
ConsoleOutput("Textractor: inserting Direct3D hooks (EXPERIMENTAL)");
|
||||||
uintptr_t createFont = (uintptr_t)GetProcAddress(d3dxModule, "D3DXCreateFontIndirectA");
|
uintptr_t createFont = (uintptr_t)GetProcAddress(d3dxModule, "D3DXCreateFontIndirectA");
|
||||||
if (!createFont) createFont = (uintptr_t)GetProcAddress(d3dxModule, "D3DX10CreateFontIndirectA");
|
if (!createFont) createFont = (uintptr_t)GetProcAddress(d3dxModule, "D3DX10CreateFontIndirectA");
|
||||||
if (!createFont)
|
if (!createFont) return ConsoleOutput("Textractor: D3DX failed: couldn't find entry function");
|
||||||
{
|
|
||||||
ConsoleOutput("Textractor: D3DX failed: couldn't find entry function");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct D3DXFont
|
struct D3DXFont
|
||||||
{
|
{
|
||||||
@ -192,11 +188,10 @@ bool PcHooks::hookD3DXFunctions(HMODULE d3dxModule)
|
|||||||
hp.address = (*font.vtable)[15];
|
hp.address = (*font.vtable)[15];
|
||||||
hp.type = USING_STRING | USING_UNICODE;
|
hp.type = USING_STRING | USING_UNICODE;
|
||||||
NewHook(hp, "ID3DXFont::DrawTextW");
|
NewHook(hp, "ID3DXFont::DrawTextW");
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ConsoleOutput("Textractor: D3DX failed: couldn't find vtable");
|
ConsoleOutput("Textractor: D3DX failed: couldn't find vtable");
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// jichi 10/2/2013
|
// jichi 10/2/2013
|
||||||
@ -275,6 +270,12 @@ void PcHooks::hookOtherPcFunctions()
|
|||||||
NEW_HOOK(CharPrevW, s_arg1, 0,0,0, USING_UNICODE|DATA_INDIRECT, 1)
|
NEW_HOOK(CharPrevW, s_arg1, 0,0,0, USING_UNICODE|DATA_INDIRECT, 1)
|
||||||
//NEW_HOOK(CharNextExA, s_arg2, 0,0,0, USING_STRING|DATA_INDIRECT, s_arg1 / (short)sizeof(uintptr_t)) // LPSTR WINAPI CharNextExA(_In_ WORD CodePage, _In_ LPCSTR lpCurrentChar, _In_ DWORD dwFlags);
|
//NEW_HOOK(CharNextExA, s_arg2, 0,0,0, USING_STRING|DATA_INDIRECT, s_arg1 / (short)sizeof(uintptr_t)) // LPSTR WINAPI CharNextExA(_In_ WORD CodePage, _In_ LPCSTR lpCurrentChar, _In_ DWORD dwFlags);
|
||||||
//NEW_HOOK(CharNextExW, s_arg2, 0,0,0, USING_UNICODE|DATA_INDIRECT, s_arg1 / (short)sizeof(uintptr_t))
|
//NEW_HOOK(CharNextExW, s_arg2, 0,0,0, USING_UNICODE|DATA_INDIRECT, s_arg1 / (short)sizeof(uintptr_t))
|
||||||
|
if (HMODULE module = GetModuleHandleW(L"OLEAUT32"))
|
||||||
|
{
|
||||||
|
NEW_MODULE_HOOK(module, SysAllocString, s_arg1, 0, 0, 0, USING_UNICODE|USING_STRING, 0)
|
||||||
|
NEW_MODULE_HOOK(module, SysAllocStringByteLen, s_arg1, 0, 0, 0, USING_STRING, s_arg2)
|
||||||
|
NEW_MODULE_HOOK(module, SysAllocStringLen, s_arg1, 0, 0, 0, USING_UNICODE|USING_STRING, s_arg2)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// EOF
|
// EOF
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
// pchooks.h
|
// pchooks.h
|
||||||
// 8/1/2014 jichi
|
// 8/1/2014 jichi
|
||||||
|
|
||||||
|
#include <Windows.h>
|
||||||
|
|
||||||
namespace PcHooks {
|
namespace PcHooks {
|
||||||
|
|
||||||
void hookGDIFunctions();
|
void hookGDIFunctions();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user