-
-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include "Winters.h" | ||
|
||
bool Winters::attach_function() | ||
{ | ||
// こんな魔法少女…アタシはレミィ | ||
// https://vndb.org/v11018 | ||
const BYTE bytes[] = { | ||
0x4a, | ||
0x8b, 0xda, | ||
0xc1, 0xe3, 0x02, | ||
0x8d, 0x1c, 0x9b, | ||
0x8b, 0xcb, | ||
0x83, 0xc1, 0x11, | ||
0xba, 0x19, 0x00, 0x00, 0x00, | ||
0xe8, XX4}; | ||
ULONG addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStopAddress); | ||
if (!addr) | ||
return false; | ||
auto off = *(DWORD *)(addr + sizeof(bytes) - 4); | ||
auto target = off + addr + sizeof(bytes); | ||
HookParam hp; | ||
hp.address = target; | ||
hp.offset = get_stack(1); | ||
hp.type = USING_STRING; | ||
hp.filter_fun = [](TextBuffer *buffer, HookParam *) | ||
{ | ||
static int idx = 0; | ||
if ((idx++) % 2) | ||
buffer->clear(); | ||
}; | ||
|
||
return NewHook(hp, "Winters"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
|
||
class Winters : public ENGINE | ||
{ | ||
public: | ||
Winters() | ||
{ | ||
check_by = CHECK_BY::FILE_ALL; | ||
check_by_target = check_by_list{L"MSG.dat", L"SCR.ifx", L"VFN.dat", L"GRP.ifx"}; | ||
}; | ||
bool attach_function(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters