Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix tms192.2 & update vs tool to latest version #4

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions EmuExtra/EmuExtra.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,32 @@
<ProjectGuid>{ABDA27D6-7C53-4B03-BB51-798D902B8B52}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>EmuExtra</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down
10 changes: 5 additions & 5 deletions EmuExtra_v20/EmuExtra_v20.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,32 @@
<ProjectGuid>{4794B654-944A-4263-9C87-011D13D67444}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>EmuExtrav20</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down
27 changes: 21 additions & 6 deletions EmuLoader/EmuLoader.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include"../Share/Simple/Simple.h"
#include"../Share/Hook/SimpleHook.h"
#include<intrin.h>
#pragma intrinsic(_ReturnAddress)


#ifndef _WIN64
Expand All @@ -17,7 +19,7 @@
std::vector<std::wstring> vFastLoadDlls;
std::vector<std::wstring> vDelayLoadDlls;

// �������W�J�O�ɓǂݍ���
// メモリ展開前に読み込む
bool FastLoad() {
for (size_t i = 0; i < vFastLoadDlls.size(); i++) {
if (LoadLibraryW(vFastLoadDlls[i].c_str())) {
Expand All @@ -27,7 +29,7 @@ bool FastLoad() {
return true;
}

// �������W�J��ɓǂݍ���
// メモリ展開後に読み込む
bool bAlreadyLoaded = false;
bool DelayLoad() {
if (bAlreadyLoaded) {
Expand Down Expand Up @@ -92,11 +94,24 @@ LSTATUS APIENTRY RegCreateKeyExA_Hook(HKEY hKey, LPCSTR lpSubKey, DWORD Reserved
return _RegCreateKeyExA(hKey, lpSubKey, Reserved, lpClass, dwOptions, samDesired, lpSecurityAttributes, phkResult, lpdwDisposition);
}

decltype(GetStartupInfoA) *_GetStartupInfoA = NULL;
auto WINAPI GetStartupInfoA_Hook(LPSTARTUPINFOA lpStartupInfo) {
if (!bAlreadyLoaded) {
if (lpStartupInfo && SimpleHook::IsCallerEXE(_ReturnAddress())) {
DEBUG(L"DelayLoad GetStartupInfoA");
DelayLoad();
}
}
return _GetStartupInfoA(lpStartupInfo);
}


bool EnableHook() {
SHook(CreateMutexExW);
// v334.2
SHook(RegCreateKeyExA);
// TMS (cause DNS Resolution on CreateMutexExW before)
SHook(GetStartupInfoA);
return true;
}

Expand All @@ -108,8 +123,8 @@ bool EmuLoader(HMODULE hDll) {
return false;
}

// FixThemida.dll, �N���ł��Ȃ����̏C��
// LocalHost.dll, �ڑ���̕ύX
// FixThemida.dll, 起動できない問題の修正
// LocalHost.dll, 接続先の変更
for (size_t i = 1; i <= 10; i++) {
std::wstring wDllName;
conf.Read(FAST_LOAD, L"DLL_" + std::to_wstring(i), wDllName);
Expand All @@ -124,8 +139,8 @@ bool EmuLoader(HMODULE hDll) {
}
}

// EmuMain.dll, GameGuard, HackShield, XignCode�̍폜��MSCRC�̍폜�܂���Bypass, �E�B���h�E���ȂǃQ�[���N���Ɋւ���C��
// EmuExtra.dll, �Q�[�����̏����̕ύX
// EmuMain.dll, GameGuard, HackShield, XignCodeの削除とMSCRCの削除またはBypass, ウィンドウ化などゲーム起動に関する修正
// EmuExtra.dll, ゲーム内の処理の変更
for (size_t i = 1; i <= 10; i++) {
std::wstring wDllName;
conf.Read(DELAY_LOAD, L"DLL_" + std::to_wstring(i), wDllName);
Expand Down
10 changes: 5 additions & 5 deletions EmuLoader/EmuLoader.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,32 @@
<ProjectGuid>{32C25F66-CFDE-4489-994E-85A913869680}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>EmuLoader</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down
10 changes: 5 additions & 5 deletions EmuLoader64/EmuLoader64.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,32 @@
<ProjectGuid>{9BDA1F45-7D15-4EB2-B06D-2BD7898658C4}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>EmuLoader64</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down
8 changes: 6 additions & 2 deletions EmuMain/AobList.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __AOB_LIST_H__
#ifndef __AOB_LIST_H__
#define __AOB_LIST_H__

#include<Windows.h>
Expand Down Expand Up @@ -144,11 +144,15 @@ std::wstring AOB_HSUpdate[] = {
};

// CSecurityClient::IsInstantiated
std::wstring AOB_EasyRemoveHS[] = {
std::wstring AOB_EasyRemoveAntiCheat[] = {
// v334.2
L"33 C0 39 ?? ?? ?? ?? ?? 0F 95 C0 C3 CC CC CC CC C7 01 ?? ?? ?? ?? C3",
// TMS157.2
L"33 C0 39 ?? ?? ?? ?? ?? 0F 95 C0 C3 8B ?? ?? 04 85 C0 74 05 83 ?? 0C EB 02 33 C0",
// TMS191
L"83 ?? ?? ?? ?? ?? 00 0F 95 C0 C3 A1 ?? ?? ?? ?? C3 8B 01 8B",
// TMS192.2
L"83 ?? ?? ?? ?? ?? 00 0F 95 C0 C3 8B 44 24 04 85 C0 74 05 83 C0 0C EB 02 33 C0 83",
};

std::wstring AOB_StartKeyCrypt[] = {
Expand Down
2 changes: 1 addition & 1 deletion EmuMain/CRCBypass.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include"CRCBypass.h"
#include"CRCBypass.h"

std::vector<MEMORY_BASIC_INFORMATION> vSection;
std::vector<void*> vBackup;
Expand Down
2 changes: 1 addition & 1 deletion EmuMain/CRCBypass334.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include"CRCBypass.h"
#include"CRCBypass.h"

// v334.0 VMProtect CRC Bypass
DWORD MSCRC1 = 0x015BCBD9;
Expand Down
98 changes: 98 additions & 0 deletions EmuMain/DllMain.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,108 @@
#include"EmuMain.h"

MSRegion gConfig_Region = MS_JMS;
int gConfig_Version = 0;
bool gDisable_MemoryDump = false;

MSRegion GetMSRegion() {
return gConfig_Region;
}

bool SetMSRegion(std::wstring wRegion) {
// default is JMS
if (wRegion.compare(L"TWMS") == 0) {
gConfig_Region = MS_TWMS;
return true;
}

if (wRegion.compare(L"MSEA") == 0) {
gConfig_Region = MS_MSEA;
return true;
}

return false;
}

std::wstring GetMSRegionString() {

switch (GetMSRegion()) {
case MS_JMS:
{
return L"JMS";
}
case MS_TWMS:
{
return L"TWMS";
}
case MS_MSEA:
{
return L"MSEA";
}
default:
{
break;
}
}

return L"Unknown";
}

int GetMSVersion() {
return gConfig_Version;
}

void SetMSVersion(int version) {
gConfig_Version = version;
}

bool GetMSDisableMemoryDump() {
return gDisable_MemoryDump;
}

void SetMSDisableMemoryDump(bool flag) {
gDisable_MemoryDump = flag;
}


#ifndef _WIN64
#define DLL_NAME L"EmuMain"
#else
#define DLL_NAME L"EmuMain64"
#endif

#define INI_FILE_NAME DLL_NAME".ini"

bool LoadConfig(HMODULE hDll) {
Config conf(INI_FILE_NAME, hDll);
std::wstring wRegion, wVersion, wMemoryDump;

// Region
if (conf.Read(DLL_NAME, L"Region", wRegion)) {
SetMSRegion(wRegion);
DEBUG(L"Region=" + GetMSRegionString());
}
// Version
if (conf.Read(DLL_NAME, L"Version", wVersion)) {
int ver = _wtoi(wVersion.c_str());
SetMSVersion(ver);
DEBUG(L"Version=" + std::to_wstring(GetMSVersion()));
}
// MSCRC Option
if (conf.Read(DLL_NAME, L"DisableMemoryDump", wMemoryDump)) {
int val = _wtoi(wMemoryDump.c_str());
SetMSDisableMemoryDump(val);
DEBUG(L"VeDisableMemoryDump=" + std::to_wstring(GetMSDisableMemoryDump()));
}
return true;
}


BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
{
DisableThreadLibraryCalls(hinstDLL);
LoadConfig(hinstDLL);
EmuMain();
break;
}
Expand Down
Loading