mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-13 07:33:53 +08:00
.
This commit is contained in:
parent
bf3228c439
commit
0a77c9ce70
@ -1,19 +1,113 @@
|
|||||||
#include"FrontWing.h"
|
#include "FrontWing.h"
|
||||||
|
|
||||||
|
bool FrontWing::attach_function()
|
||||||
bool FrontWing::attach_function() {
|
{
|
||||||
const BYTE bytes[] = {
|
const BYTE bytes[] = {
|
||||||
//v55 = (int)(__CFADD__(v54 * v13, 0x80000000) + v54 * v13 + 0x80000000 + 0x80000000) >> 1;
|
// v55 = (int)(__CFADD__(v54 * v13, 0x80000000) + v54 * v13 + 0x80000000 + 0x80000000) >> 1;
|
||||||
0x05,0x00,0x00,0x00,0x80,0x15,0x00,0x00,0x00,0x80,0xD1,0xF8,0x85,0xC0
|
0x05, 0x00, 0x00, 0x00, 0x80, 0x15, 0x00, 0x00, 0x00, 0x80, 0xD1, 0xF8, 0x85, 0xC0};
|
||||||
};
|
|
||||||
|
|
||||||
auto addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStopAddress);
|
auto addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStopAddress);
|
||||||
if (addr == 0)return false;
|
if (!addr)
|
||||||
addr=MemDbg::findEnclosingAlignedFunction(addr);
|
return false;
|
||||||
if(addr==0)return false;
|
addr = MemDbg::findEnclosingAlignedFunction(addr);
|
||||||
|
if (!addr)
|
||||||
|
return false;
|
||||||
HookParam hp;
|
HookParam hp;
|
||||||
hp.address = addr;
|
hp.address = addr;
|
||||||
hp.offset=stackoffset(1);
|
hp.offset = stackoffset(1);
|
||||||
hp.type = USING_STRING;
|
hp.type = USING_STRING;
|
||||||
return NewHook(hp, "FrontWing");
|
return NewHook(hp, "FrontWing");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FrontWing2_attach_function()
|
||||||
|
{
|
||||||
|
const BYTE bytes[] = {
|
||||||
|
0x68, 0xb4, 0x00, 0x00, 0x00,
|
||||||
|
0x6a, 0x00,
|
||||||
|
0x8b, 0x55, 0x08,
|
||||||
|
0x81, 0xc2, XX4,
|
||||||
|
0x52,
|
||||||
|
0xe8, XX4,
|
||||||
|
0x83, 0xc4, 0x0c,
|
||||||
|
0x68, 0xb3, 0x00, 0x00, 0x00,
|
||||||
|
0x8b, 0x45, 0x08,
|
||||||
|
0x8b, 0x88, XX4,
|
||||||
|
0x03, 0x4d, 0xfc,
|
||||||
|
0x51,
|
||||||
|
0x8b, 0x55, 0x08,
|
||||||
|
0x81, 0xc2, XX4,
|
||||||
|
0x52,
|
||||||
|
0xe8, XX4};
|
||||||
|
auto addr = MemDbg::findBytes(bytes, sizeof(bytes), processStartAddress, processStopAddress);
|
||||||
|
if (!addr)
|
||||||
|
return false;
|
||||||
|
HookParam hp;
|
||||||
|
hp.address = addr + sizeof(bytes) - 5;
|
||||||
|
hp.offset = regoffset(ecx);
|
||||||
|
hp.type = USING_STRING;
|
||||||
|
hp.filter_fun = [](TextBuffer *buffer, HookParam *hp)
|
||||||
|
{
|
||||||
|
auto s = strSplit(buffer->strA(), "\n")[0];
|
||||||
|
auto ws = StringToWideString(s, 932).value();
|
||||||
|
ws = std::regex_replace(ws, std::wregex(LR"([\w\d]*\\[\w\d]*\\[\w\d_]*)"), L"");
|
||||||
|
ws = std::regex_replace(ws, std::wregex(LR"(\[rb,(.*?),(.*?)\])"), L"$1");
|
||||||
|
ws = std::regex_replace(ws, std::wregex(L",(.*?),(.*?)"), L"$1$2");
|
||||||
|
buffer->from(WideStringToString(ws, 932));
|
||||||
|
};
|
||||||
|
return NewHook(hp, "FrontWing");
|
||||||
|
}
|
||||||
|
bool FrontWing2_attach_function2()
|
||||||
|
{
|
||||||
|
const BYTE bytes[] = {
|
||||||
|
0x8b, 0x55, 0xf8,
|
||||||
|
0x03, 0x55, 0x10,
|
||||||
|
0x03, 0x55, XX,
|
||||||
|
0x8b, 0x45, 0x0c,
|
||||||
|
0x0f, 0xbe, 0x0c, 0x10,
|
||||||
|
0x83, 0xf9, 0x0d,
|
||||||
|
0x75, XX,
|
||||||
|
0x8b, 0x55, 0xf8,
|
||||||
|
0x03, 0x55, 0x10,
|
||||||
|
0x03, 0x55, XX,
|
||||||
|
0x8b, 0x45, 0x0c,
|
||||||
|
0x0f, 0xbe, 0x4c, 0x10, 0x01,
|
||||||
|
0x83, 0xf9, 0x0a,
|
||||||
|
0x75, XX,
|
||||||
|
0x8b, 0x55, 0xf8,
|
||||||
|
0x03, 0x55, 0x10,
|
||||||
|
0x03, 0x55, XX,
|
||||||
|
0x8b, 0x45, 0x0c,
|
||||||
|
0x0f, 0xbe, 0x4c, 0x10, 0x02,
|
||||||
|
0x83, 0xf9, 0x0d,
|
||||||
|
0x75, XX,
|
||||||
|
0x8b, 0x55, 0xf8,
|
||||||
|
0x03, 0x55, 0x10,
|
||||||
|
0x03, 0x55, XX,
|
||||||
|
0x8b, 0x45, 0x0c,
|
||||||
|
0x0f, 0xbe, 0x4c, 0x10, 0x03,
|
||||||
|
0x83, 0xf9, 0x0a,
|
||||||
|
0x74, XX};
|
||||||
|
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 = stackoffset(2);
|
||||||
|
hp.type = USING_STRING;
|
||||||
|
hp.filter_fun = [](TextBuffer *buffer, HookParam *hp)
|
||||||
|
{
|
||||||
|
auto xx = buffer->viewA();
|
||||||
|
static std::string last;
|
||||||
|
if (xx == last)
|
||||||
|
return buffer->clear();
|
||||||
|
last = xx;
|
||||||
|
};
|
||||||
|
return NewHook(hp, "FrontWing");
|
||||||
|
}
|
||||||
|
bool FrontWing2::attach_function()
|
||||||
|
{
|
||||||
|
return FrontWing2_attach_function() || FrontWing2_attach_function2();
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
//https://vndb.org/v760
|
// https://vndb.org/v760
|
||||||
//魔界天使ジブリール
|
// 魔界天使ジブリール
|
||||||
/*
|
/*
|
||||||
BLOCK "StringFileInfo"
|
BLOCK "StringFileInfo"
|
||||||
{
|
{
|
||||||
@ -21,12 +21,25 @@ BLOCK "StringFileInfo"
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
class FrontWing:public ENGINE{
|
class FrontWing : public ENGINE
|
||||||
public:
|
{
|
||||||
FrontWing(){
|
public:
|
||||||
|
FrontWing()
|
||||||
check_by=CHECK_BY::RESOURCE_STR;
|
{
|
||||||
check_by_target=L"FrontWing Co.,LTD.";
|
|
||||||
};
|
check_by = CHECK_BY::RESOURCE_STR;
|
||||||
bool attach_function();
|
check_by_target = L"FrontWing Co.,LTD.";
|
||||||
|
};
|
||||||
|
bool attach_function();
|
||||||
|
};
|
||||||
|
class FrontWing2 : public ENGINE
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
FrontWing2()
|
||||||
|
{
|
||||||
|
//[071227][フロントウイング] タイムリープ
|
||||||
|
check_by = CHECK_BY::FILE_ALL;
|
||||||
|
check_by_target = check_by_list{L"MDT/*.dat", L"BGM.dat", L"CHIP.dat", L"ef.dat", L"Init.dat", L"SE.dat"};
|
||||||
|
};
|
||||||
|
bool attach_function();
|
||||||
};
|
};
|
@ -430,5 +430,6 @@ std::vector<ENGINE *> check_engines()
|
|||||||
new e_Erekiteru,
|
new e_Erekiteru,
|
||||||
new H_do_C,
|
new H_do_C,
|
||||||
new Mink3,
|
new Mink3,
|
||||||
|
new FrontWing2,
|
||||||
};
|
};
|
||||||
}
|
}
|
@ -81,16 +81,18 @@ bool checkengine()
|
|||||||
int current = 0;
|
int current = 0;
|
||||||
for (auto m : engines)
|
for (auto m : engines)
|
||||||
{
|
{
|
||||||
|
std::unique_ptr<ENGINE> __m;
|
||||||
|
__m.reset(m);
|
||||||
current += 1;
|
current += 1;
|
||||||
|
|
||||||
bool matched = safematch(m);
|
bool matched = safematch(m);
|
||||||
bool attached = matched && safeattach(m);
|
|
||||||
|
|
||||||
// ConsoleOutput("Progress %d/%d, checked engine %s, %s",current,engines.size(),m->getenginename(),infomations[matched+attached]);
|
// ConsoleOutput("Progress %d/%d, checked engine %s, %s",current,engines.size(),m->getenginename(),infomations[matched+attached]);
|
||||||
// ConsoleOutput("Progress %d/%d, %s",current,engines.size(),infomations[matched+attached]);
|
// ConsoleOutput("Progress %d/%d, %s",current,engines.size(),infomations[matched+attached]);
|
||||||
if (matched == false)
|
if (!matched)
|
||||||
continue;
|
continue;
|
||||||
ConsoleOutput(TR[MatchedEngine], m->getenginename());
|
ConsoleOutput(TR[MatchedEngine], m->getenginename());
|
||||||
|
bool attached = safeattach(m);
|
||||||
if (attached)
|
if (attached)
|
||||||
{
|
{
|
||||||
jittypedefault = m->jittype;
|
jittypedefault = m->jittype;
|
||||||
@ -100,6 +102,7 @@ bool checkengine()
|
|||||||
spDefault.minAddress = 0;
|
spDefault.minAddress = 0;
|
||||||
spDefault.maxAddress = -1;
|
spDefault.maxAddress = -1;
|
||||||
}
|
}
|
||||||
|
__m.release();
|
||||||
}
|
}
|
||||||
if (m->is_engine_certain)
|
if (m->is_engine_certain)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user