Skip to content

Commit 38f237b

Browse files
authored
Merge pull request #3 from Mega-Mew/master
Add Support for Sun/Moon v1.2
2 parents f8cfb5a + 8ac9a7d commit 38f237b

File tree

6 files changed

+84
-20
lines changed

6 files changed

+84
-20
lines changed

SMPatcher/Program.cs

+36-1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,31 @@ class Program
9191
GetSingletonAccessorInstance = 0x48B4
9292
};
9393

94+
private static readonly Offsets Offsets_1_2 = new Offsets
95+
{
96+
CTRIsDebugMode = 0x4DE0,
97+
98+
DecryptQRCodeStart = 0x2CEA3C,
99+
DecryptQRCodeEnd = 0x2CEAD4,
100+
101+
AnalyzeQRBinaryStart = 0x2CED90,
102+
AnalyzeQRBinaryEnd = 0x2CF214,
103+
QRReaderSaveDataBatteryQuery = 0x33F6B0,
104+
105+
QRReaderSaveDataIsRegisteredData = 0x3A8DD0,
106+
107+
ForbiddenQRs = 0x4A5FF0,
108+
109+
NoOutlines = 0x31CFCC,
110+
111+
CRC16 = 0x259D14,
112+
DexDataAllocator = 0x3B6730,
113+
aeabi_memcpy = 0x1FEBD8,
114+
GenerateDexDisplayData = 0x2CE714,
115+
116+
GetSingletonAccessorInstance = 0x48B4
117+
};
118+
94119
static uint GetARMBranch(uint from, uint to)
95120
{
96121
// Fuck ARM Branches
@@ -169,7 +194,7 @@ static void Main(string[] args)
169194
var dir = Path.GetDirectoryName(args[0]);
170195
var fn = Path.GetFileNameWithoutExtension(args[0]);
171196

172-
Console.WriteLine("Sun/Moon Patcher v1.1 - SciresM");
197+
Console.WriteLine("Sun/Moon Patcher v1.2 - SciresM");
173198

174199
var hash = (new SHA256CryptoServiceProvider()).ComputeHash(code);
175200
if (hash.SequenceEqual(Resources.moon_hash_1_0))
@@ -182,6 +207,11 @@ static void Main(string[] args)
182207
Console.WriteLine("Pokemon Moon v1.1 detected.");
183208
Offsets = Offsets_1_1;
184209
}
210+
else if (hash.SequenceEqual(Resources.moon_hash_1_2))
211+
{
212+
Console.WriteLine("Pokemon Moon v1.2 detected.");
213+
Offsets = Offsets_1_2;
214+
}
185215
else if (hash.SequenceEqual(Resources.sun_hash_1_0))
186216
{
187217
Console.WriteLine("Pokemon Sun v1.0 detected");
@@ -192,6 +222,11 @@ static void Main(string[] args)
192222
Console.WriteLine("Pokemon Sun v1.1 detected");
193223
Offsets = Offsets_1_1;
194224
}
225+
else if (hash.SequenceEqual(Resources.sun_hash_1_2))
226+
{
227+
Console.WriteLine("Pokemon Sun v1.2 detected");
228+
Offsets = Offsets_1_2;
229+
}
195230
else
196231
{
197232
Console.WriteLine("Unknown code.bin! Contact SciresM to update the program.");

SMPatcher/Properties/Resources.Designer.cs

+39-19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SMPatcher/Properties/Resources.resx

+6
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@
130130
<data name="moon_hash_1_1" type="System.Resources.ResXFileRef, System.Windows.Forms">
131131
<value>..\Resources\byte\moon_hash_1_1;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
132132
</data>
133+
<data name="moon_hash_1_2" type="System.Resources.ResXFileRef, System.Windows.Forms">
134+
<value>..\Resources\byte\moon_hash_1_2;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
135+
</data>
133136
<data name="qr_is_registered" type="System.Resources.ResXFileRef, System.Windows.Forms">
134137
<value>..\resources\byte\qr_is_registered;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
135138
</data>
@@ -139,4 +142,7 @@
139142
<data name="sun_hash_1_1" type="System.Resources.ResXFileRef, System.Windows.Forms">
140143
<value>..\Resources\byte\sun_hash_1_1;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
141144
</data>
145+
<data name="sun_hash_1_2" type="System.Resources.ResXFileRef, System.Windows.Forms">
146+
<value>..\Resources\byte\sun_hash_1_2;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
147+
</data>
142148
</root>
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
�T���w�{E$�9Joߠ�u@JЗ�^UF�g,

SMPatcher/Resources/byte/sun_hash_1_2

32 Bytes
Binary file not shown.

SMPatcher/SMPatcher.csproj

+2
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@
6767
<None Include="Resources\byte\debug_stub.bin" />
6868
<None Include="Resources\byte\moon_hash_1_0" />
6969
<None Include="Resources\byte\moon_hash_1_1" />
70+
<None Include="Resources\byte\moon_hash_1_2" />
7071
<None Include="Resources\byte\qr_is_registered" />
7172
<None Include="Resources\byte\sun_hash_1_0" />
7273
<None Include="Resources\byte\sun_hash_1_1" />
74+
<None Include="Resources\byte\sun_hash_1_2" />
7375
</ItemGroup>
7476
<ItemGroup>
7577
<EmbeddedResource Include="Properties\Resources.resx">

0 commit comments

Comments
 (0)