Minori engine hooks

This commit is contained in:
Blu3train 2023-04-30 03:29:22 +02:00
parent a3b15d8701
commit a31460cee1

View File

@ -21792,21 +21792,23 @@ bool InsertMinori1Hook()
ConsoleOutput("vnreng: INSERT Minori1"); ConsoleOutput("vnreng: INSERT Minori1");
NewHook(hp, "Minori1"); NewHook(hp, "Minori1");
const BYTE bytes2[] = { hp.address = addr + alt_addr_offset;
0x84, 0xC0, // test al,al hp.codepage = 0;
0x0F, 0x85, XX4, // jne trinoline_en_AA.exe+243E1 hp.filter_fun = Minori1EngFilter;
0x68, XX4, // push trinoline_en_AA.exe+118BF8 ConsoleOutput("vnreng: INSERT Minori1eng");
0x33, 0xFF // xor edi,edi NewHook(hp, "Minori1eng");
};
ULONG addr2 = MemDbg::findBytes(bytes2, sizeof(bytes2), processStartAddress, processStartAddress + range); return true;
if (addr) { }
HookParam hp = {};
hp.address = addr + alt_addr_offset; bool Minori2Filter(LPVOID data, DWORD *size, HookParam *, BYTE)
hp.offset = pusha_edx_off -4; {
hp.type = USING_STRING; auto text = reinterpret_cast<LPSTR>(data);
hp.filter_fun = Minori1EngFilter; auto len = reinterpret_cast<size_t *>(size);
ConsoleOutput("vnreng: INSERT Minori1eng"); StringCharReplacer(text, len, "\\n", 2, ' ');
NewHook(hp, "Minori1eng");
if (cpp_strnstr(text, "{", *len)) {
StringFilterBetween(text, len, "{", 1, "}", 1);
} }
return true; return true;
@ -21820,14 +21822,14 @@ bool InsertMinori2Hook()
* https://vndb.org/v35 * https://vndb.org/v35
*/ */
const BYTE bytes[] = { const BYTE bytes[] = {
0x80, 0x38, 0x00, // cmp byte ptr [eax],00 0x80, 0x38, 0x00, // cmp byte ptr [eax],00 << hook here
0x0F, 0x84, XX4, // je WindRP.exe+2832A 0x0F, 0x84, XX4, // je WindRP.exe+2832A
0xB8, 0x20, 0x03, 0x00, 0x00, // mov eax,00000320 0xB8, 0x20, 0x03, 0x00, 0x00, // mov eax,00000320
0x89, 0x44, 0x24, 0x10, // mov [esp+10],eax 0x89, 0x44, 0x24, 0x10, // mov [esp+10],eax
0x89, 0x44, 0x24, 0x14, // mov [esp+14],eax 0x89, 0x44, 0x24, 0x14, // mov [esp+14],eax
0x8B, 0x47, 0x20 // mov eax,[edi+20] 0x8B, 0x47, 0x20 // mov eax,[edi+20]
}; };
enum { addr_offset = 0 }; enum { alt_addr_offset = 9 };
ULONG range = min(processStopAddress - processStartAddress, MAX_REL_ADDR); ULONG range = min(processStopAddress - processStartAddress, MAX_REL_ADDR);
ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStartAddress + range); ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStartAddress + range);
@ -21836,13 +21838,14 @@ bool InsertMinori2Hook()
return false; return false;
} }
HookParam hp = {};
hp.address = addr + addr_offset;
hp.offset = pusha_eax_off -4;
hp.index = 0;
hp.length_offset = 1;
hp.type = NO_CONTEXT | DATA_INDIRECT;
ConsoleOutput("vnreng: INSERT Minori2"); ConsoleOutput("vnreng: INSERT Minori2");
HookParam hp = {};
hp.address = addr + alt_addr_offset;
hp.offset = pusha_eax_off -4;
hp.type = USING_STRING;
hp.filter_fun = Minori2Filter;
ConsoleOutput("vnreng: INSERT Minori2");
ConsoleOutput("vnreng:Minori2: Please, set text to max speed");
NewHook(hp, "Minori2"); NewHook(hp, "Minori2");
return true; return true;
} }