utf-8&VNR method

need to check it working
This commit is contained in:
mireado 2016-04-10 13:31:20 +09:00
parent fbea5c3733
commit 1011a96dcd

View File

@ -84,7 +84,7 @@ bool DeterminePCEngine()
// 3/20/2015 jichi // 3/20/2015 jichi
// Always insert GDI hooks even for Mono games // Always insert GDI hooks even for Mono games
// For example: ãæá¦?ãÆ? need GetGlyphOutlineA // For example: 新世黙示録 need GetGlyphOutlineA
PcHooks::hookGDIFunctions(); PcHooks::hookGDIFunctions();
return true; return true;
} }
@ -269,7 +269,7 @@ bool DetermineEngineByFile2()
InsertTinkerBellHook(); InsertTinkerBellHook();
return true; return true;
} }
if (IthFindFile(L"*.vfs")) { // jichi 7/6/2014: Better to test AoiLib.dll? ja.wikipedia.org/wiki/«½«Õ«È«Ï«¦«¹«­«ã«é if (IthFindFile(L"*.vfs")) { // jichi 7/6/2014: Better to test AoiLib.dll? ja.wikipedia.org/wiki/ソフトハウスキャラ
InsertSystemAoiHook(); InsertSystemAoiHook();
return true; return true;
} }
@ -279,7 +279,7 @@ bool DetermineEngineByFile2()
} }
// jichi 8/1/2014: YU-RIS engine, lots of clockup game also has this pattern // jichi 8/1/2014: YU-RIS engine, lots of clockup game also has this pattern
if (IthFindFile(L"pac\\*.ypf") || IthFindFile(L"*.ypf")) { if (IthFindFile(L"pac\\*.ypf") || IthFindFile(L"*.ypf")) {
// jichi 8/14/2013: CLOCLUP: "«Î?«Ö«ì«¹«ª«Ö«ê?«¸«å" would crash the game. // jichi 8/14/2013: CLOCLUP: "ノーブレスオブリージュ" would crash the game.
if (!IthCheckFile(L"noblesse.exe")) if (!IthCheckFile(L"noblesse.exe"))
InsertYurisHook(); InsertYurisHook();
return true; return true;
@ -333,7 +333,7 @@ bool DetermineEngineByFile3()
InsertTriangleHook(); InsertTriangleHook();
return true; return true;
} }
// jichi 2/28/2015: No longer work for "ÓÞïá¡¿??«¢«ê«¹ episode I" from Primula // jichi 2/28/2015: No longer work for "大正×対称アリス episode I" from Primula
//if (IthCheckFile(L"PSetup.exe")) { //if (IthCheckFile(L"PSetup.exe")) {
// InsertPensilHook(); // InsertPensilHook();
// return true; // return true;
@ -398,7 +398,7 @@ bool DetermineEngineByFile4()
InsertExpHook(); InsertExpHook();
return true; return true;
} }
// jichi 2/6/2015 øÁäÌïÍ // jichi 2/6/2015 平安亭
// dPi.dat, dPih.dat, dSc.dat, dSch.dat, dSo.dat, dSoh.dat, dSy.dat // dPi.dat, dPih.dat, dSc.dat, dSch.dat, dSo.dat, dSoh.dat, dSy.dat
//if (IthCheckFile(L"dSoh.dat")) { // no idea why this file does not work //if (IthCheckFile(L"dSoh.dat")) { // no idea why this file does not work
if (IthCheckFile(L"dSch.dat")) { if (IthCheckFile(L"dSch.dat")) {
@ -407,7 +407,7 @@ bool DetermineEngineByFile4()
} }
// jichi 2/28/2015: Delay checking Pensil in case something went wrong // jichi 2/28/2015: Delay checking Pensil in case something went wrong
// File pattern observed in [Primula] ÓÞïá¡¿??«¢«ê«¹ episode I // File pattern observed in [Primula] 大正×対称アリス episode I
// - PSetup.exe no longer exists // - PSetup.exe no longer exists
// - MovieTexture.dll information shows MovieTex dynamic library, copyright Pensil 2013 // - MovieTexture.dll information shows MovieTex dynamic library, copyright Pensil 2013
// - ta_trial.exe information shows 2XT - Primula Adventure Engine // - ta_trial.exe information shows 2XT - Primula Adventure Engine
@ -429,7 +429,7 @@ bool DetermineEngineByProcessName()
return true; return true;
} }
// jichi 8/19/2013: DO NOT WORK for games like¡¸«Ï«Ô«á«¢¡¹ // jichi 8/19/2013: DO NOT WORK for games like「ハピメア」
//if (wcsstr(str,L"cmvs32") || wcsstr(str,L"cmvs64")) { //if (wcsstr(str,L"cmvs32") || wcsstr(str,L"cmvs64")) {
// InsertCMVSHook(); // InsertCMVSHook();
// return true; // return true;
@ -544,27 +544,35 @@ bool DetermineEngineOther()
static BYTE static_file_info[0x1000]; static BYTE static_file_info[0x1000];
if (IthGetFileInfo(L"*01", static_file_info)) if (IthGetFileInfo(L"*01", static_file_info))
if (*(DWORD*)static_file_info == 0) { if (*(DWORD*)static_file_info == 0) {
STATUS_INFO_LENGTH_MISMATCH;
static WCHAR static_search_name[MAX_PATH]; static WCHAR static_search_name[MAX_PATH];
LPWSTR name=(LPWSTR)(static_file_info+0x5E); LPWSTR name=(LPWSTR)(static_file_info+0x5E);
int len = wcslen(name); int len = wcslen(name);
name[len - 2] = L'*'; name[len-2] = L'.';
name[len - 1] = 0; name[len-1] = L'e';
wcscpy(static_search_name, name); name[len] = L'x';
IthGetFileInfo(static_search_name, static_file_info); name[len+1] = L'e';
union { name[len+2] = 0;
FILE_BOTH_DIR_INFORMATION *both_info; if (IthCheckFile(name)) {
DWORD addr; name[len-2] = L'*';
}; name[len-1] = 0;
both_info = (FILE_BOTH_DIR_INFORMATION *)static_file_info; wcscpy(static_search_name,name);
//BYTE* ptr=static_file_info; IthGetFileInfo(static_search_name,static_file_info);
len = 0; union {
while (both_info->NextEntryOffset) { FILE_BOTH_DIR_INFORMATION *both_info;
addr += both_info->NextEntryOffset; DWORD addr;
len++; };
} both_info = (FILE_BOTH_DIR_INFORMATION *)static_file_info;
if (len > 3) { //BYTE* ptr=static_file_info;
InsertAbelHook(); len=0;
return true; while (both_info->NextEntryOffset) {
addr += both_info->NextEntryOffset;
len++;
}
if (len > 3) {
InsertAbelHook();
return true;
}
} }
} }
@ -575,7 +583,7 @@ bool DetermineEngineOther()
// Put the patterns that might break other games at last // Put the patterns that might break other games at last
bool DetermineEngineAtLast() bool DetermineEngineAtLast()
{ {
if (IthCheckFile(L"MovieTexture.dll") && (InsertPensilHook() || Insert2RMHook())) // MovieTexture.dll also exists in 2RM games such as Ù½í­äñ2??÷ú, which is checked first if (IthCheckFile(L"MovieTexture.dll") && (InsertPensilHook() || Insert2RMHook())) // MovieTexture.dll also exists in 2RM games such as 母子愛2体験版, which is checked first
return true; return true;
if (IthFindFile(L"system") && IthFindFile(L"system.dat")) { // jichi 7/31/2015 if (IthFindFile(L"system") && IthFindFile(L"system.dat")) { // jichi 7/31/2015
InsertAbelHook(); InsertAbelHook();
@ -643,7 +651,7 @@ bool DetermineEngineGeneric()
ret = true; ret = true;
} }
//} else if (IthFindFile(L"image\\*.po2") || IthFindFile(L"image\\*.jo2")) { //} else if (IthFindFile(L"image\\*.po2") || IthFindFile(L"image\\*.jo2")) {
// ConsoleOutput("vnreng: HarukaKanata, INSERT WideChar hooks"); // ªÏªëª«ª«ªÊª¿ // ConsoleOutput("vnreng: HarukaKanata, INSERT WideChar hooks"); // はるかかなた
// ret = true; // ret = true;
//} //}
if (ret) if (ret)
@ -668,7 +676,7 @@ bool DetermineNoEngine()
return true; return true;
} }
// jichi 11/22/2015: ÔÐÌÈNECRO ??÷ú // jichi 11/22/2015: 凍京NECRO 体験版
if (IthFindFile(L"*.npk")) { if (IthFindFile(L"*.npk")) {
ConsoleOutput("vnreng: IGNORE new Nitroplus"); ConsoleOutput("vnreng: IGNORE new Nitroplus");
return true; return true;
@ -686,7 +694,7 @@ bool DetermineNoEngine()
return true; return true;
} }
// jichi 2/14/2015: Guilty+ £Ò£É£Î¡¿£Ó£Å£Î (PK) // jichi 2/14/2015: Guilty+ × (PK)
if (IthCheckFile(L"rio.ini") || IthFindFile(L"*.war")) { if (IthCheckFile(L"rio.ini") || IthFindFile(L"*.war")) {
ConsoleOutput("vnreng: IGNORE unknown ShinaRio"); ConsoleOutput("vnreng: IGNORE unknown ShinaRio");
return true; return true;
@ -707,7 +715,7 @@ bool DetermineNoEngine()
return true; return true;
} }
// jichi 4/30/2015: Skip games made from ªéª¹ª³ª¦, such as ªÈª¢ªëìÑô£ªÎ«Í«È«é«ìÞÀï× // jichi 4/30/2015: Skip games made from らすこう, such as とある人妻のネトラレ事情
// It has garbage from lstrlenW. Correct text is supposed to be in TabbedTextOutA. // It has garbage from lstrlenW. Correct text is supposed to be in TabbedTextOutA.
if (IthCheckFile(L"data_cg.dpm")) { if (IthCheckFile(L"data_cg.dpm")) {
ConsoleOutput("vnreng: IGNORE DPM data_cg.dpm"); ConsoleOutput("vnreng: IGNORE DPM data_cg.dpm");
@ -770,7 +778,7 @@ bool DetermineNoEngine()
*(DWORD *)(str + i + 1) = 0x630068; //.hcb *(DWORD *)(str + i + 1) = 0x630068; //.hcb
*(DWORD *)(str + i + 3) = 0x62; *(DWORD *)(str + i + 3) = 0x62;
if (IthCheckFile(str)) { if (IthCheckFile(str)) {
ConsoleOutput("vnreng: IGNORE FVP"); // jichi 10/3/2013: such like «¢«È«ê«¨ª«ª°ªä ConsoleOutput("vnreng: IGNORE FVP"); // jichi 10/3/2013: such like アトリエかぐや
return true; return true;
} }
return false; return false;
@ -927,6 +935,7 @@ extern "C" {
// MSVC libs use _chkstk for stack-probing. MinGW equivalent is _alloca. // MSVC libs use _chkstk for stack-probing. MinGW equivalent is _alloca.
//void _alloca(); //void _alloca();
//void _chkstk() { _alloca(); } //void _chkstk() { _alloca(); }
// MSVC uses security cookies to prevent some buffer overflow attacks. // MSVC uses security cookies to prevent some buffer overflow attacks.
// provide dummy implementations. // provide dummy implementations.
//void _fastcall __security_check_cookie(intptr_t i) {} //void _fastcall __security_check_cookie(intptr_t i) {}