Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Candy3 engine hook #1213

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion texthook/engine/engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8220,6 +8220,42 @@ bool InsertCandyHook2()
return false;
}

bool InsertCandyHook3()
{
//by Blu3train
/*
* Sample games:
* https://vndb.org/v24878
*/
const BYTE bytes[] = {
0xCC, // int 3
0x55, // push ebp << hook here
0x8B, 0xEC, // mov ebp,esp
0x6A, 0xFF, // push -01
0x68, XX4, // push iinari-omnibus.exe+C4366
0x64, 0xA1, 0x00, 0x00, 0x00, 0x00, // mov eax,fs:[00000000]
0x50, // push eax
0x83, 0xEC, 0x74, // sub esp,74
0x53, // push ebx
0x56, // push esi
0x57 // push edi
};

ULONG range = min(processStopAddress - processStartAddress, MAX_REL_ADDR);
ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStartAddress + range);
if (!addr) {
ConsoleOutput("vnreng:SystemC#3: pattern not found");
return false;
}
HookParam hp = {};
hp.address = addr + 1;
hp.offset = 4 * 4; // arg4
hp.type = USING_STRING | USING_UNICODE;
ConsoleOutput("vnreng: INSERT SystemC#3");
NewHook(hp, "SystemC#3");
return true;
}

/** jichi 10/2/2013: CHECKPOINT
*
* [5/31/2013] 恋もHもお勉強も、おまかせ�お姉ちも�部
Expand Down Expand Up @@ -8267,7 +8303,7 @@ bool InsertCandyHook()
if (Util::CheckFile(L"SystemC.exe"))
return InsertCandyHook1();
else
return InsertCandyHook2();
return InsertCandyHook3() || InsertCandyHook2();
//bool b2 = InsertCandyHook2(),
// b3 = InsertCandyHook3();
//return b2 || b3;
Expand Down