mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-13 07:33:53 +08:00
.
This commit is contained in:
parent
4d8475f5c1
commit
b46e0538ae
@ -129,7 +129,7 @@ namespace mages
|
|||||||
}
|
}
|
||||||
else if (c == 2)
|
else if (c == 2)
|
||||||
{ // line
|
{ // line
|
||||||
// do nothing -> back to readChar
|
// do nothing -> back to readChar
|
||||||
}
|
}
|
||||||
else if (c == 4 || c == 0x15)
|
else if (c == 4 || c == 0x15)
|
||||||
{ // SetColor, EvaluateExpression => SKIP
|
{ // SetColor, EvaluateExpression => SKIP
|
||||||
@ -273,7 +273,7 @@ namespace hookmages
|
|||||||
buffer->from(s);
|
buffer->from(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MAGES()
|
bool MAGES_text()
|
||||||
{
|
{
|
||||||
#ifndef _WIN64
|
#ifndef _WIN64
|
||||||
auto dialogSigOffset = 2;
|
auto dialogSigOffset = 2;
|
||||||
@ -371,10 +371,10 @@ namespace hookmages
|
|||||||
// hookaddr上是没有重复的,pos上是都能读到但有重复。
|
// hookaddr上是没有重复的,pos上是都能读到但有重复。
|
||||||
hp.text_fun = SpecialHookMAGES<0>;
|
hp.text_fun = SpecialHookMAGES<0>;
|
||||||
hp.type = CODEC_UTF16 | USING_STRING | NO_CONTEXT;
|
hp.type = CODEC_UTF16 | USING_STRING | NO_CONTEXT;
|
||||||
auto _ = NewHook(hp, "5pb_MAGES");
|
auto _ = NewHook(hp, "MAGES_text");
|
||||||
hp.address = pos;
|
hp.address = pos;
|
||||||
hp.text_fun = SpecialHookMAGES<1>;
|
hp.text_fun = SpecialHookMAGES<1>;
|
||||||
_ |= NewHook(hp, "5pb_MAGES");
|
_ |= NewHook(hp, "MAGES_text");
|
||||||
ConsoleOutput("%p %p", hookaddr, pos);
|
ConsoleOutput("%p %p", hookaddr, pos);
|
||||||
return _;
|
return _;
|
||||||
|
|
||||||
@ -417,9 +417,41 @@ namespace hookmages
|
|||||||
hp.address = hookaddr;
|
hp.address = hookaddr;
|
||||||
hp.text_fun = SpecialHookMAGES<0>;
|
hp.text_fun = SpecialHookMAGES<0>;
|
||||||
hp.type = CODEC_UTF16 | USING_STRING | NO_CONTEXT;
|
hp.type = CODEC_UTF16 | USING_STRING | NO_CONTEXT;
|
||||||
return NewHook(hp, "5pb_MAGES");
|
return NewHook(hp, "MAGES");
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MAGES_mail()
|
||||||
|
{
|
||||||
|
#ifndef _WIN64
|
||||||
|
BYTE sig1[] = {
|
||||||
|
0xe8, XX, XX, XX, 0x00, 0x6a, 0x18, 0x50, 0x68, XX, 0x01, 0x00, 0x00, 0xe8, XX4, 0x8b};
|
||||||
|
auto sigsize = sizeof(sig1);
|
||||||
|
auto addr = MemDbg::findBytes(sig1, sizeof(sig1), processStartAddress, processStopAddress);
|
||||||
|
if (!addr)
|
||||||
|
{
|
||||||
|
BYTE sig2[] = {
|
||||||
|
0xe8, XX, XX, XX, 0x00, 0x6a, 0x18, XX, XX, 0xb9, XX, 0x01, 0x00, 0x00, 0xe8, XX4, 0x8b};
|
||||||
|
sigsize = sizeof(sig2);
|
||||||
|
addr = MemDbg::findBytes(sig2, sizeof(sig2), processStartAddress, processStopAddress);
|
||||||
|
}
|
||||||
|
if (!addr)
|
||||||
|
return;
|
||||||
|
addr += sigsize - 6;
|
||||||
|
addr += *(int *)(addr + 1) + 5;
|
||||||
|
HookParam hp;
|
||||||
|
hp.address = addr;
|
||||||
|
hp.text_fun = SpecialHookMAGES<0>;
|
||||||
|
hp.type = CODEC_UTF16 | USING_STRING | NO_CONTEXT;
|
||||||
|
NewHook(hp, "MAGES_mail");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
bool MAGES()
|
||||||
|
{
|
||||||
|
auto succ = MAGES_text();
|
||||||
|
if (succ)
|
||||||
|
MAGES_mail();
|
||||||
|
return succ;
|
||||||
|
}
|
||||||
}
|
}
|
@ -368,6 +368,30 @@ namespace ppsspp
|
|||||||
last = s;
|
last = s;
|
||||||
buffer->from(s);
|
buffer->from(s);
|
||||||
}
|
}
|
||||||
|
void ULJM06289(TextBuffer *buffer, HookParam *hp)
|
||||||
|
{
|
||||||
|
StringFilter(buffer, "#n", 2);
|
||||||
|
StringFilter(buffer, "\x81\x40", 2);
|
||||||
|
auto s = buffer->strA();
|
||||||
|
s = std::regex_replace(s, std::regex("(#[A-Za-z]+\\[(\\d*[.])?\\d+\\])+"), "");
|
||||||
|
buffer->from(s);
|
||||||
|
}
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
void ULJM05823_1(TextBuffer *buffer, HookParam *hp)
|
||||||
|
{
|
||||||
|
StringFilter(buffer, "#n", 2);
|
||||||
|
auto s = buffer->strA();
|
||||||
|
s = std::regex_replace(s, std::regex("(#[A-Za-z]+\\[(\\d*[.])?\\d+\\])+"), "");
|
||||||
|
buffer->from(s);
|
||||||
|
}
|
||||||
|
void ULJM05823_2(TextBuffer *buffer, HookParam *hp)
|
||||||
|
{
|
||||||
|
auto s = buffer->viewA();
|
||||||
|
if (s.find("#n") != s.npos)
|
||||||
|
return buffer->clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
std::unordered_map<uintptr_t, emfuncinfo> emfunctionhooks = {
|
std::unordered_map<uintptr_t, emfuncinfo> emfunctionhooks = {
|
||||||
// Shinigami to Shoujo
|
// Shinigami to Shoujo
|
||||||
{0x883bf34, {0, 1, 0, 0, ULJS00403_filter, "ULJS00403"}},
|
{0x883bf34, {0, 1, 0, 0, ULJS00403_filter, "ULJS00403"}},
|
||||||
@ -459,6 +483,36 @@ namespace ppsspp
|
|||||||
{0x880a744, {0, 0, 0, 0, ULJM05943F, "ULJM0630[23]"}}, // ULJM06302 & ULJM06303
|
{0x880a744, {0, 0, 0, 0, ULJM05943F, "ULJM0630[23]"}}, // ULJM06302 & ULJM06303
|
||||||
// アーメン・ノワール ポータブル
|
// アーメン・ノワール ポータブル
|
||||||
{0x883b6a8, {0, 0, 0, 0, ULJM05943F, "ULJM06064"}},
|
{0x883b6a8, {0, 0, 0, 0, ULJM05943F, "ULJM06064"}},
|
||||||
|
// デス・コネクション ポータブル
|
||||||
|
{0x882AEF4, {0, 0, 0, 0, ULJM05823_1, "ULJM05823"}},
|
||||||
|
{0x88B2464, {0, 0, 0, 0, ULJM05823_2, "ULJM05823"}}, // text+name->name
|
||||||
|
// しらつゆの怪
|
||||||
|
{0x888A26C, {0, 0, 0, 0, ULJM06289, "ULJM06289"}},
|
||||||
|
// 新装版クローバーの国のアリス~Wonderful Wonder World~
|
||||||
|
{0x8875E50, {0, 1, 0, 0, 0, "NPJH50894"}},
|
||||||
|
// ダイヤの国のアリス~Wonderful Wonder World~
|
||||||
|
{0x8857E3C, {0, 0, 0, 0, 0, "ULJM06216"}},
|
||||||
|
// ダイヤの国のアリス~ Wonderful Mirror World ~
|
||||||
|
{0x8855AE4, {0, 1, 0, 0, 0, "ULJM06295"}},
|
||||||
|
// ハートの国のアリス~Wonderful Twin World~
|
||||||
|
{0x8881CAC, {0, 1, 0, 0, 0, "NPJH50872"}},
|
||||||
|
// 新装版 ハートの国のアリス~Wonderful Wonder World~
|
||||||
|
{0x886B610, {0, 1, 0, 0, 0, "ULJM06332"}},
|
||||||
|
// S・Y・K ~新説西遊記~ ポータブル
|
||||||
|
{0x88DD918, {0, 0, 0, 0, ULJM05823_2, "ULJM05697"}}, // text+name->name
|
||||||
|
{0x88DA420, {0, 4, 0, 0, ULJM05823_1, "ULJM05697"}},
|
||||||
|
// Glass Heart Princess
|
||||||
|
{0x885FA30, {0, 0, 0, 0, ULJM05823_1, "ULJM06196"}},
|
||||||
|
// Glass Heart Princess:PLATINUM
|
||||||
|
{0x885D4F0, {0, 0, 0, 0, ULJM05823_1, "ULJM06309"}},
|
||||||
|
// ウィル・オ・ウィスプ ポータブル
|
||||||
|
{0x885DD04, {0, 0, 0, 0, ULJM05823_1, "ULJM05447"}},
|
||||||
|
// 華鬼 ~恋い初める刻 永久の印~
|
||||||
|
{0x8829F14, {0, 4, 0, 0, ULJM05823_1, "ULJM05847"}},
|
||||||
|
{0x886D270, {0, 0, 0, 0, ULJM05823_2, "ULJM05847"}},
|
||||||
|
// 華鬼 ~夢のつづき~
|
||||||
|
{0x88406CC, {0, 0, 0, 0, ULJM05823_1, "ULJM06048"}}, // text
|
||||||
|
{0x885B7BC, {0, 0, 0, 0, ULJM05823_1, "ULJM06048"}}, // name+text
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
@ -37,8 +37,7 @@ DWORD WINAPI Pipe(LPVOID)
|
|||||||
|
|
||||||
*(DWORD *)buffer = GetCurrentProcessId();
|
*(DWORD *)buffer = GetCurrentProcessId();
|
||||||
WriteFile(hookPipe, buffer, sizeof(DWORD), &count, nullptr);
|
WriteFile(hookPipe, buffer, sizeof(DWORD), &count, nullptr);
|
||||||
WORD hookversion[4] = LUNA_VERSION;
|
WriteFile(hookPipe, LUNA_VERSION, sizeof(LUNA_VERSION), &count, nullptr);
|
||||||
WriteFile(hookPipe, hookversion, sizeof(hookversion), &count, nullptr);
|
|
||||||
|
|
||||||
ConsoleOutput(PIPE_CONNECTED);
|
ConsoleOutput(PIPE_CONNECTED);
|
||||||
HIJACK();
|
HIJACK();
|
||||||
|
@ -310,10 +310,9 @@ LunaHost::LunaHost()
|
|||||||
} })
|
} })
|
||||||
.detach();
|
.detach();
|
||||||
|
|
||||||
WORD version[4] = LUNA_VERSION;
|
|
||||||
WCHAR vs[32];
|
WCHAR vs[32];
|
||||||
|
|
||||||
wsprintf(vs, L" | %s v%d.%d.%d", VersionCurrent, version[0], version[1], version[2]);
|
wsprintf(vs, L" | %s v%d.%d.%d", VersionCurrent, LUNA_VERSION[0], LUNA_VERSION[1], LUNA_VERSION[2]);
|
||||||
title += vs;
|
title += vs;
|
||||||
settext(title);
|
settext(title);
|
||||||
std::thread([&]()
|
std::thread([&]()
|
||||||
|
@ -102,9 +102,8 @@ namespace
|
|||||||
Host::AddConsoleOutput(FormatString(PROC_CONN,processId));
|
Host::AddConsoleOutput(FormatString(PROC_CONN,processId));
|
||||||
//CreatePipe();
|
//CreatePipe();
|
||||||
WORD hookversion[4];
|
WORD hookversion[4];
|
||||||
WORD hostversion[4]=LUNA_VERSION;
|
|
||||||
if( ReadFile(hookPipe, hookversion, sizeof(hookversion), &bytesRead, nullptr)){
|
if( ReadFile(hookPipe, hookversion, sizeof(hookversion), &bytesRead, nullptr)){
|
||||||
if(memcmp(hostversion,hookversion,sizeof(hookversion))!=0)
|
if(memcmp(hookversion,LUNA_VERSION,sizeof(hookversion))!=0)
|
||||||
Host::Warning(UNMATCHABLEVERSION);
|
Host::Warning(UNMATCHABLEVERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,4 +32,5 @@ constexpr auto LUNA_HOOK_DLL = LUNA_HOOK_DLL_64; // .dll but LoadLibrary automat
|
|||||||
constexpr auto LUNA_HOOK_DLL = LUNA_HOOK_DLL_32; // .dll but LoadLibrary automatically adds that
|
constexpr auto LUNA_HOOK_DLL = LUNA_HOOK_DLL_32; // .dll but LoadLibrary automatically adds that
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern WORD LUNA_VERSION[4];
|
||||||
// EOF
|
// EOF
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
|
|
||||||
set(VERSION_MAJOR 6)
|
set(VERSION_MAJOR 6)
|
||||||
set(VERSION_MINOR 6)
|
set(VERSION_MINOR 6)
|
||||||
set(VERSION_PATCH 7)
|
set(VERSION_PATCH 8)
|
||||||
set(VERSION_REVISION 0)
|
set(VERSION_REVISION 0)
|
||||||
set(LUNA_VERSION "{${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}}")
|
set(LUNA_VERSION "{${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}}")
|
||||||
add_library(VERSION_DEF INTERFACE)
|
add_library(VERSION_DEF ${CMAKE_CURRENT_LIST_DIR}/version_def.cpp)
|
||||||
target_compile_definitions(VERSION_DEF INTERFACE
|
target_compile_definitions(VERSION_DEF PRIVATE
|
||||||
LUNA_VERSION=${LUNA_VERSION})
|
LUNA_VERSION_=${LUNA_VERSION})
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/version/generate_product_version.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/version/generate_product_version.cmake)
|
2
cpp/version_def.cpp
Normal file
2
cpp/version_def.cpp
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#include<Windows.h>
|
||||||
|
WORD LUNA_VERSION[4] = LUNA_VERSION_;
|
Loading…
x
Reference in New Issue
Block a user