Skip to content

Commit b2b8104

Browse files
committed
.
1 parent c52da3a commit b2b8104

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#include "PinkQuestion.h"
2+
3+
// ぴんくはてな\魔法少女ナユタ
4+
bool PinkQuestion::attach_function()
5+
{
6+
BYTE bytes2[] = {
7+
0x3d, 0x9f, 0x82, 0x00, 0x00,
8+
0xbd, 0x02, 0x00, 0x00, 0x00,
9+
0x7c, XX,
10+
0x3d, 0xf1, 0x82, 0x00, 0x00,
11+
0x7f, XX,
12+
0x33, 0xed,
13+
0x3d, 0x41, 0x81, 0x00, 0x00,
14+
0x7c, XX,
15+
0x3d, 0x9a, 0x82, 0x00, 0x00,
16+
0x7e, XX,
17+
0x3d, 0x40, 0x83, 0x00, 0x00,
18+
0x7c, XX,
19+
0x3d, 0x8f, 0x87, 0x00, 0x00,
20+
0x7f, XX};
21+
auto addr = MemDbg::findBytes(bytes2, sizeof(bytes2), processStartAddress, processStopAddress);
22+
if (!addr)
23+
return false;
24+
addr = MemDbg::findEnclosingAlignedFunction(addr, 0x20);
25+
if (!addr)
26+
return false;
27+
auto addrs = findxref_reverse_checkcallop(addr, processStartAddress, processStopAddress, 0xe8);
28+
if (addrs.size() != 1)
29+
return false;
30+
addr = MemDbg::findEnclosingAlignedFunction(addrs[0], 0x40);
31+
if (!addr)
32+
return false;
33+
HookParam hp;
34+
hp.address = addr;
35+
hp.type = USING_CHAR | DATA_INDIRECT;
36+
hp.offset = stackoffset(3);
37+
return NewHook(hp, "PinkQuestion");
38+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
class PinkQuestion : public ENGINE
3+
{
4+
public:
5+
PinkQuestion()
6+
{
7+
check_by = CHECK_BY::CUSTOM;
8+
check_by_target = []()
9+
{
10+
auto _ = {L"nayuta.exe", L"data.0*"};
11+
return std::all_of(_.begin(), _.end(), Util::CheckFile);
12+
};
13+
};
14+
bool attach_function();
15+
};

src/NativeImpl/LunaHook/LunaHook/enginecollection32.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include "engine32/mirage.h"
4141
#include "engine32/RScript.h"
4242
#include "engine32/Sprite.h"
43+
#include "engine32/PinkQuestion.h"
4344
#include "engine32/Nekotaro.h"
4445
#include "engine32/PONScripter.h"
4546
#include "engine32/Stronger.h"
@@ -483,5 +484,6 @@ std::vector<ENGINE *> check_engines()
483484
new GLuer,
484485
new ZeroEscape,
485486
new ANOS,
487+
new PinkQuestion,
486488
};
487489
}

0 commit comments

Comments
 (0)