Skip to content

Commit 313aea6

Browse files
author
makipl
committed
launch patch for JP
1 parent 0d54bb6 commit 313aea6

File tree

2 files changed

+55
-17
lines changed

2 files changed

+55
-17
lines changed

ff8_launch/ff8_launch.vcxproj

+16-14
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
<Configuration>Debug</Configuration>
66
<Platform>Win32</Platform>
77
</ProjectConfiguration>
8-
<ProjectConfiguration Include="Release|Win32">
9-
<Configuration>Release</Configuration>
8+
<ProjectConfiguration Include="Debug_JP|Win32">
9+
<Configuration>Debug_JP</Configuration>
1010
<Platform>Win32</Platform>
1111
</ProjectConfiguration>
1212
<ProjectConfiguration Include="Debug|x64">
1313
<Configuration>Debug</Configuration>
1414
<Platform>x64</Platform>
1515
</ProjectConfiguration>
16-
<ProjectConfiguration Include="Release|x64">
17-
<Configuration>Release</Configuration>
16+
<ProjectConfiguration Include="Debug_JP|x64">
17+
<Configuration>Debug_JP</Configuration>
1818
<Platform>x64</Platform>
1919
</ProjectConfiguration>
2020
</ItemGroup>
@@ -24,6 +24,7 @@
2424
<ProjectGuid>{1e5bdc80-729a-4815-a3ee-a59a81090285}</ProjectGuid>
2525
<RootNamespace>ff8launch</RootNamespace>
2626
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
27+
<ProjectName>ff8jp_launchPatch</ProjectName>
2728
</PropertyGroup>
2829
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2930
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@@ -32,7 +33,7 @@
3233
<PlatformToolset>v143</PlatformToolset>
3334
<CharacterSet>Unicode</CharacterSet>
3435
</PropertyGroup>
35-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
36+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_JP|Win32'" Label="Configuration">
3637
<ConfigurationType>Application</ConfigurationType>
3738
<UseDebugLibraries>false</UseDebugLibraries>
3839
<PlatformToolset>v143</PlatformToolset>
@@ -45,7 +46,7 @@
4546
<PlatformToolset>v143</PlatformToolset>
4647
<CharacterSet>Unicode</CharacterSet>
4748
</PropertyGroup>
48-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
49+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_JP|x64'" Label="Configuration">
4950
<ConfigurationType>Application</ConfigurationType>
5051
<UseDebugLibraries>false</UseDebugLibraries>
5152
<PlatformToolset>v143</PlatformToolset>
@@ -60,26 +61,26 @@
6061
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
6162
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
6263
</ImportGroup>
63-
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
64+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug_JP|Win32'">
6465
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
6566
</ImportGroup>
6667
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
6768
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
6869
</ImportGroup>
69-
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
70+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug_JP|x64'">
7071
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
7172
</ImportGroup>
7273
<PropertyGroup Label="UserMacros" />
7374
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7475
<LinkIncremental>true</LinkIncremental>
7576
</PropertyGroup>
76-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
77+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_JP|Win32'">
7778
<LinkIncremental>false</LinkIncremental>
7879
</PropertyGroup>
7980
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
8081
<LinkIncremental>true</LinkIncremental>
8182
</PropertyGroup>
82-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
83+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_JP|x64'">
8384
<LinkIncremental>false</LinkIncremental>
8485
</PropertyGroup>
8586
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@@ -94,14 +95,15 @@
9495
<GenerateDebugInformation>true</GenerateDebugInformation>
9596
</Link>
9697
</ItemDefinitionGroup>
97-
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
98+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_JP|Win32'">
9899
<ClCompile>
99100
<WarningLevel>Level3</WarningLevel>
100101
<FunctionLevelLinking>true</FunctionLevelLinking>
101102
<IntrinsicFunctions>true</IntrinsicFunctions>
102-
<SDLCheck>true</SDLCheck>
103-
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
103+
<SDLCheck>false</SDLCheck>
104+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;JAPANESE_PATCH%(PreprocessorDefinitions)</PreprocessorDefinitions>
104105
<ConformanceMode>true</ConformanceMode>
106+
<LanguageStandard>stdcpp20</LanguageStandard>
105107
</ClCompile>
106108
<Link>
107109
<SubSystem>Console</SubSystem>
@@ -122,7 +124,7 @@
122124
<GenerateDebugInformation>true</GenerateDebugInformation>
123125
</Link>
124126
</ItemDefinitionGroup>
125-
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
127+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_JP|x64'">
126128
<ClCompile>
127129
<WarningLevel>Level3</WarningLevel>
128130
<FunctionLevelLinking>true</FunctionLevelLinking>

ff8_launch/main.cpp

+39-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,45 @@
1+
#include <iostream>
2+
#include <fstream>
3+
#include <sstream>
4+
#include <vector>
5+
#include <iterator>
16
#include <windows.h>
7+
#include <filesystem>
28

39
int main()
410
{
5-
HMODULE mod= LoadLibraryA("FFVIII_JP.dll");
6-
FARPROC prc = GetProcAddress(mod, "runGame");
7-
prc();
11+
std::filesystem::path pt("FFVIII.exe");
12+
if(!std::filesystem::exists(pt))
13+
{
14+
MessageBoxW(NULL, L"FFVIII.exe ファイルが見つかりません",
15+
L"エラー", MB_OK);
16+
return ERROR_FILE_NOT_FOUND;
17+
}
18+
std::ifstream ifs;
19+
ifs.open(L"FFVIII.exe", std::ios::binary | std::ios::in);
20+
if(!ifs.is_open())
21+
{
22+
MessageBoxW(NULL, L"FFVIII.exe ファイルは存在しますが開けません",
23+
L"エラー", MB_OK);
24+
return ERROR_FILE_CORRUPT;
25+
}
26+
27+
std::vector<unsigned char> buffer;
28+
buffer.assign(std::istreambuf_iterator<char>(ifs),
29+
std::istreambuf_iterator<char>());
30+
31+
ifs.close();
32+
33+
buffer[0x94B] = 0x89;
34+
buffer[0x94B+1] = 0xC8;
35+
buffer[0x94B+2] = 0x90;
36+
37+
std::ofstream ofs;
38+
ofs.open(L"FFVIII_JP.exe", std::ios::binary | std::ios::out | std::ios::trunc);
39+
ofs.write((const char*) & buffer[0], buffer.size());
40+
ofs.close();
41+
42+
MessageBoxW(NULL, L"やった! パッチは「FFVIII_JP.exe」という名前の新しいファイルを作成しました. ファイルを実行してみてください", L"YATTA!", MB_OK);
43+
844
return 0;
945
}

0 commit comments

Comments
 (0)