bugfix engine and add hook for renpy

This commit is contained in:
Akash Mozumdar 2018-08-09 15:27:44 -04:00
parent dd78e555f8
commit e06b8f27c8
3 changed files with 28 additions and 1 deletions

View File

@ -5746,7 +5746,7 @@ void SpecialHookShina1(DWORD esp_base, HookParam *hp, BYTE, DWORD *data, DWORD *
int GetShinaRioVersion() int GetShinaRioVersion()
{ {
int ret = 0; int ret = 0;
HANDLE hFile = CreateFileW(L"RIO.INI", FILE_READ_DATA, FILE_SHARE_READ, nullptr, FILE_OPEN, FILE_ATTRIBUTE_NORMAL, nullptr); HANDLE hFile = CreateFileW(L"RIO.INI", FILE_READ_DATA, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
if (hFile == INVALID_HANDLE_VALUE) { if (hFile == INVALID_HANDLE_VALUE) {
size_t len = ::wcslen(processName); size_t len = ::wcslen(processName);
if (len > 3) { if (len > 3) {
@ -16435,6 +16435,25 @@ bool InsertAdobeFlash10Hook()
return true; return true;
} }
bool InsertRenpyHook()
{
HookParam hp = {};
hp.address = (DWORD)GetProcAddress(GetModuleHandleW(L"python27"), "PyUnicodeUCS2_Format");
if (!hp.address)
{
ConsoleOutput("NextHooker: Ren'py failed: failed to find python27.dll or PyUnicodeUCS2_Format");
return false;
}
hp.offset = pusha_eax_off - 4;
hp.index = 0xc;
hp.length_offset = 0;
hp.split = pusha_ebx_off - 4;
hp.type = USING_STRING | USING_UNICODE | NO_CONTEXT | DATA_INDIRECT | USING_SPLIT;
//hp.filter_fun = [](void* str, auto, auto, auto) { return *(wchar_t*)str != L'%'; };
NewHook(hp, "Ren'py");
return true;
}
/** jichi 12/26/2014 Mono /** jichi 12/26/2014 Mono
* Sample game: [141226] <EFBFBD><EFBFBD> * Sample game: [141226] <EFBFBD><EFBFBD>
*/ */

View File

@ -132,6 +132,7 @@ bool InsertQLIEHook(); // QLiE: GameData/*.pack
//bool InsertRai7Hook(); // Rai7puk: rai7.exe //bool InsertRai7Hook(); // Rai7puk: rai7.exe
bool InsertRejetHook(); // Rejet: Module/{gd.dat,pf.dat,sd.dat} bool InsertRejetHook(); // Rejet: Module/{gd.dat,pf.dat,sd.dat}
bool InsertRUGPHook(); // rUGP: rUGP.exe bool InsertRUGPHook(); // rUGP: rUGP.exe
bool InsertRenpyHook(); // Ren'py: python27.dll
bool InsertRetouchHook(); // Retouch: resident.dll bool InsertRetouchHook(); // Retouch: resident.dll
bool InsertRREHook(); // RunrunEngine: rrecfg.rcf bool InsertRREHook(); // RunrunEngine: rrecfg.rcf
bool InsertShinaHook(); // ShinaRio: Rio.ini bool InsertShinaHook(); // ShinaRio: Rio.ini

View File

@ -99,6 +99,13 @@ bool DetermineEngineByFile1()
return true; return true;
} }
// Artikash 8/9/2018: Renpy - sample game https://vndb.org/v19843
if (GetModuleHandleW(L"python27"))
{
InsertRenpyHook();
return true;
}
if (Util::CheckFile(L"*.xp3") || Util::SearchResourceString(L"TVP(KIRIKIRI)")) { if (Util::CheckFile(L"*.xp3") || Util::SearchResourceString(L"TVP(KIRIKIRI)")) {
if (Util::SearchResourceString(L"TVP(KIRIKIRI) Z ")) { // TVP(KIRIKIRI) Z CORE if (Util::SearchResourceString(L"TVP(KIRIKIRI) Z ")) { // TVP(KIRIKIRI) Z CORE
// jichi 11/24/2014: Disabled that might crash VBH // jichi 11/24/2014: Disabled that might crash VBH