mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-11-26 23:34:01 +08:00
RPGMaker
This commit is contained in:
parent
0927c487d4
commit
39d2a81f4d
@ -4,7 +4,7 @@ if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
||||
set(enginepath "engine64")
|
||||
set(collector "enginecollection64.cpp")
|
||||
else()
|
||||
set(enginessrc Stronger TACTICS Onscripter Sceplay DISCOVERY Erogos godot A98SYS GuruGuruSMF4 TeethingRing Fizz CoffeeMaker VALKYRIA mirage CisLugI tamasoft FrontWing solfasys Diskdream splushwave ransel akatombo GASTRO GSX Aksys ScrPlayer SYSD KISS IGScript Jellyfish BKEngine Overflow SRPGStudio Suika2 FVP LCScript Ohgetsu RPGMakerRGSS3 ONScripterru OVERDRIVE HXP Palette Purple Ruf RUNE Tarte Tomato Sakuradog Troy VitaminSoft Unknown TSSystem Xbangbang Anisetta Nijyuei Interheart LovaGame Giga Jisatu101 EntisGLS Ciel ACTGS TerraLunar PPSSPP jukujojidai PCSX2 VanillawareGC cef V8 mono pchooks PONScripter Bishop sakanagl Lightvn KiriKiri SideB BGI Bootup morning shyakunage Regista NNNConfig Eushully Majiro littlecheese Elf Silkys CMVS Wolf Circus1 Circus2 Cotopha Artemis CatSystem Atelier Tenco QLIE Pal AIL2 NeXAS LunaSoft Unicorn Rejet Interlude AdobeAir Retouch Malie Live Nexton Lucifen Waffle TinkerBell SystemAoi Yuris Nitroplus2 Bruns EME RRE Candy Speed ApricoT Triangle AB2Try MBLMED GameMaker DxLib CodeX Minori Sprite RpgmXP Eagls Debonosu C4 WillPlus Tanuki GXP AOS Mink YukaSystem2 sakusesu Exp Syuntada Pensil Anim hibiki Nitroplus Reallive Siglus Taskforce2 RUGP IronGameSystem Anex86 ShinyDaysGame MarineHeart ShinaRio CaramelBox UnisonShift Escude Ryokucha Alice Footy2 utawarerumono System4x Abalone Abel 5pb HorkEye XUSE Leaf Nekopack AXL AGS AdobeFlash10 FocasLens Tamamo Ages3ResT)
|
||||
set(enginessrc RPGMaker Stronger TACTICS Onscripter Sceplay DISCOVERY Erogos godot A98SYS GuruGuruSMF4 TeethingRing Fizz CoffeeMaker VALKYRIA mirage CisLugI tamasoft FrontWing solfasys Diskdream splushwave ransel akatombo GASTRO GSX Aksys ScrPlayer SYSD KISS IGScript Jellyfish BKEngine Overflow SRPGStudio Suika2 FVP LCScript Ohgetsu RPGMakerRGSS3 ONScripterru OVERDRIVE HXP Palette Purple Ruf RUNE Tarte Tomato Sakuradog Troy VitaminSoft Unknown TSSystem Xbangbang Anisetta Nijyuei Interheart LovaGame Giga Jisatu101 EntisGLS Ciel ACTGS TerraLunar PPSSPP jukujojidai PCSX2 VanillawareGC cef V8 mono pchooks PONScripter Bishop sakanagl Lightvn KiriKiri SideB BGI Bootup morning shyakunage Regista NNNConfig Eushully Majiro littlecheese Elf Silkys CMVS Wolf Circus1 Circus2 Cotopha Artemis CatSystem Atelier Tenco QLIE Pal AIL2 NeXAS LunaSoft Unicorn Rejet Interlude AdobeAir Retouch Malie Live Nexton Lucifen Waffle TinkerBell SystemAoi Yuris Nitroplus2 Bruns EME RRE Candy Speed ApricoT Triangle AB2Try MBLMED GameMaker DxLib CodeX Minori Sprite RpgmXP Eagls Debonosu C4 WillPlus Tanuki GXP AOS Mink YukaSystem2 sakusesu Exp Syuntada Pensil Anim hibiki Nitroplus Reallive Siglus Taskforce2 RUGP IronGameSystem Anex86 ShinyDaysGame MarineHeart ShinaRio CaramelBox UnisonShift Escude Ryokucha Alice Footy2 utawarerumono System4x Abalone Abel 5pb HorkEye XUSE Leaf Nekopack AXL AGS AdobeFlash10 FocasLens Tamamo Ages3ResT)
|
||||
set(enginepath "engine32")
|
||||
set(collector "enginecollection32.cpp")
|
||||
endif()
|
||||
|
47
LunaHook/engine32/RPGMaker.cpp
Normal file
47
LunaHook/engine32/RPGMaker.cpp
Normal file
@ -0,0 +1,47 @@
|
||||
#include "RPGMaker.h"
|
||||
// https://www.dlsite.com/maniax/work/=/product_id/RJ01240121.html
|
||||
// ネクロマリア
|
||||
|
||||
bool RPGMaker::attach_function()
|
||||
{
|
||||
BYTE bytes2[] = {
|
||||
//clang-format off
|
||||
0x81, 0xf9, 0xff, 0xff, 0xff, 0x7f,
|
||||
XX2,
|
||||
0xb9, 0xff, 0xff, 0xff, 0x7f,
|
||||
XX2,
|
||||
0x8b, 0xc2,
|
||||
0xd1, 0xe8,
|
||||
0x89, 0x45, 0x0c,
|
||||
0xb8, 0xff, 0xff, 0xff, 0x7f,
|
||||
0x2b, 0x45, 0x0c,
|
||||
0x3b, 0xd0,
|
||||
XX2,
|
||||
0xb9, 0xff, 0xff, 0xff, 0x7f,
|
||||
//clang-format on
|
||||
};
|
||||
auto addr = MemDbg::findBytes(bytes2, sizeof(bytes2), processStartAddress, processStopAddress);
|
||||
if (!addr)
|
||||
return false;
|
||||
addr = MemDbg::findEnclosingAlignedFunction(addr, 0x100);
|
||||
if (!addr)
|
||||
return false;
|
||||
HookParam hp;
|
||||
hp.address = addr;
|
||||
hp.type = USING_STRING | CODEC_UTF8;
|
||||
hp.text_fun = [](hook_stack *stack, HookParam *hp, uintptr_t *data, uintptr_t *split, size_t *le)
|
||||
{
|
||||
*data = stack->stack[1];
|
||||
*le = stack->stack[2];
|
||||
};
|
||||
hp.filter_fun = [](LPVOID data, size_t *size, HookParam *)
|
||||
{
|
||||
if (all_ascii((char *)data, *size))
|
||||
return false;
|
||||
std::string result = std::string((char *)data, *size);
|
||||
result = std::regex_replace(result, std::regex(R"(@c\[\](.*?)@c\[\])"), "$1");
|
||||
return write_string_overwrite(data, size, result);
|
||||
};
|
||||
|
||||
return NewHook(hp, "RPGMaker");
|
||||
}
|
18
LunaHook/engine32/RPGMaker.h
Normal file
18
LunaHook/engine32/RPGMaker.h
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
class RPGMaker : public ENGINE
|
||||
{
|
||||
public:
|
||||
RPGMaker()
|
||||
{
|
||||
|
||||
check_by = CHECK_BY::CUSTOM;
|
||||
check_by_target = []()
|
||||
{
|
||||
auto s = check_by_list{L"data/game.dat", L"data/psl.dat", L"data/scenario.dat", L"data/system.dat"};
|
||||
return (wcscmp(processName_lower, L"game.dat") == 0) && std::all_of(s.begin(), s.end(), Util::CheckFile);
|
||||
};
|
||||
is_engine_certain = false;
|
||||
};
|
||||
bool attach_function();
|
||||
};
|
@ -102,6 +102,7 @@
|
||||
#include "engine32/Nitroplus.h"
|
||||
#include "engine32/Bruns.h"
|
||||
#include "engine32/XUSE.h"
|
||||
#include "engine32/RPGMaker.h"
|
||||
#include "engine32/EME.h"
|
||||
#include "engine32/RRE.h"
|
||||
#include "engine32/Sceplay.h"
|
||||
@ -402,6 +403,7 @@ std::vector<ENGINE *> check_engines()
|
||||
new TACTICS,
|
||||
new RealliveX,
|
||||
new TextXtra_x32,
|
||||
new Stronger
|
||||
new Stronger,
|
||||
new RPGMaker
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user