-
-
Notifications
You must be signed in to change notification settings - Fork 441
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
23 changed files
with
105 additions
and
81 deletions.
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
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 |
---|---|---|
@@ -1,25 +1,50 @@ | ||
#include "TerraLunar.h" | ||
|
||
bool TerraLunar::attach_function() | ||
namespace | ||
{ | ||
const BYTE bytes[] = { | ||
// らくえん~あいかわらずなぼく。の場合~ | ||
0x8A, 0x08, | ||
0x81, 0xF9, 0x9F, 0x00, 0x00, 0x00, | ||
0x7E}; | ||
auto addrs = Util::SearchMemory(bytes, sizeof(bytes), PAGE_EXECUTE, processStartAddress, processStopAddress); | ||
auto succ = false; | ||
for (auto addr : addrs) | ||
bool H1() | ||
{ | ||
const BYTE bytes[] = { | ||
// らくえん~あいかわらずなぼく。の場合~ | ||
0x8A, 0x08, | ||
0x81, 0xF9, 0x9F, 0x00, 0x00, 0x00, | ||
0x7E}; | ||
auto addrs = Util::SearchMemory(bytes, sizeof(bytes), PAGE_EXECUTE, processStartAddress, processStopAddress); | ||
auto succ = false; | ||
for (auto addr : addrs) | ||
{ | ||
HookParam hp; | ||
hp.address = addr; | ||
hp.offset = get_reg(regs::eax); | ||
hp.type = USING_STRING; | ||
hp.filter_fun = [](TextBuffer *buffer, HookParam *hp) | ||
{ | ||
StringFilter(buffer, "[w]", 3); | ||
}; | ||
succ |= NewHook(hp, "TerraLunar"); | ||
} | ||
return succ; | ||
} | ||
bool H2() | ||
{ | ||
const BYTE bytes[] = { | ||
// https://vndb.org/v2416 | ||
// ナースのお勉強 応用編~受けシチュ以外は絶対禁止!~ | ||
0X8B, 0X4D, 0X0C, 0X0F, 0XBE, 0X51, 0X01, 0XB8, 0X00, 0X01, 0X00, 0X00}; | ||
auto addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStopAddress); | ||
if (!addr) | ||
return false; | ||
addr = MemDbg::findEnclosingAlignedFunction(addr); | ||
if (!addr) | ||
return false; | ||
HookParam hp; | ||
hp.address = addr; | ||
hp.offset = get_reg(regs::eax); | ||
hp.offset = get_stack(2); | ||
hp.type = USING_STRING; | ||
hp.filter_fun = [](TextBuffer *buffer, HookParam *hp) | ||
{ | ||
StringFilter(buffer, "[w]", 3); | ||
}; | ||
succ |= NewHook(hp, "TerraLunar"); | ||
return NewHook(hp, "AtelierD"); | ||
} | ||
return succ; | ||
} | ||
bool TerraLunar::attach_function() | ||
{ | ||
|
||
return H2() | H1(); | ||
} |
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 |
---|---|---|
@@ -1,10 +1,15 @@ | ||
|
||
|
||
class mono:public ENGINE{ | ||
public: | ||
mono(){ | ||
|
||
check_by=CHECK_BY::ALL_TRUE; | ||
class mono : public ENGINE | ||
{ | ||
public: | ||
mono() | ||
{ | ||
|
||
check_by = CHECK_BY::CUSTOM; | ||
check_by_target = [this]() | ||
{ return attach_function_(); }; | ||
}; | ||
bool attach_function(); | ||
bool attach_function_(); | ||
bool attach_function() { return true; } | ||
}; |
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
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 |
---|---|---|
@@ -1,22 +1,29 @@ | ||
|
||
#include"python/python.h" | ||
#include "python/python.h" | ||
|
||
class Renpy:public ENGINE{ | ||
public: | ||
Renpy(){ | ||
//使用lunatranslator启动游戏,会把cwd修改成exe所在目录,其中没有.py | ||
check_by=CHECK_BY::ALL_TRUE; | ||
// check_by=CHECK_BY::CUSTOM; | ||
// check_by_target=[](){ | ||
// //Renpy - sample game https://vndb.org/v19843 | ||
// return Util::CheckFile(L"*.py")|| GetModuleHandleW(L"librenpython.dll"); | ||
// }; | ||
}; | ||
bool attach_function(){ | ||
#ifndef _WIN64 | ||
class Renpy : public ENGINE | ||
{ | ||
public: | ||
Renpy() | ||
{ | ||
// 使用lunatranslator启动游戏,会把cwd修改成exe所在目录,其中没有.py | ||
// check_by=CHECK_BY::CUSTOM; | ||
// check_by_target=[](){ | ||
// //Renpy - sample game https://vndb.org/v19843 | ||
// return Util::CheckFile(L"*.py")|| GetModuleHandleW(L"librenpython.dll"); | ||
// }; | ||
|
||
check_by = CHECK_BY::CUSTOM; | ||
check_by_target = [this]() | ||
{ return attach_function_(); }; | ||
}; | ||
bool attach_function() { return true; } | ||
bool attach_function_() | ||
{ | ||
#ifndef _WIN64 | ||
return InsertRenpyHook(); | ||
#else | ||
return InsertRenpyHook()||InsertRenpy3Hook(); | ||
#endif | ||
#else | ||
return InsertRenpyHook() || InsertRenpy3Hook(); | ||
#endif | ||
} | ||
}; |
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 |
---|---|---|
|
@@ -111,6 +111,5 @@ bool InsertRenpyHook() | |
} | ||
} | ||
} | ||
ConsoleOutput("Ren'py failed: failed to find python2X.dll"); | ||
return false; | ||
} |
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
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
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
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
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
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
File renamed without changes.
File renamed without changes.