Skip to content

Commit cd0b5b7

Browse files
Merge branch 'dev' of https://github.com/SummerofOrange/O-Z-IL2CPP into dev
2 parents 155fdbc + c1c47b8 commit cd0b5b7

14 files changed

+985
-72
lines changed

OZ_Il2cpp_Console/OZ_Il2cpp_Console.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ int main(int argc, char* const argv[], const char* optstr)
1414
wcout.imbue(locale("chs"));
1515

1616
//Dbg
17-
//cpp_mgr::proc_cpp("MetadataCache.cpp", "MetadataCache_encrypted.cpp", "./oz_scripts/mdc.ozs");
17+
cpp_mgr::proc_cpp("MetadataCache.cpp", "MetadataCache_encrypted.cpp", "./oz_scripts/mdc.ozs");
1818
cpp_mgr::proc_cpp("il2cpp-metadata.h", "il2cpp-metadata_encrypted.h", "./oz_scripts/metadataheader.ozs");
1919
system("pause");
2020

OZ_Il2cpp_Console/OZ_Il2cpp_Console.vcxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,15 @@
142142
<ItemGroup>
143143
<ClCompile Include="cpp_mgr.cpp" />
144144
<ClCompile Include="lib_plugins_mgr.cpp" />
145+
<ClCompile Include="metadata_mgr.cpp" />
145146
<ClCompile Include="ozil2_script_mgr.cpp" />
146147
<ClCompile Include="OZ_Il2cpp_Console.cpp" />
147148
<ClCompile Include="utils.cpp" />
148149
</ItemGroup>
149150
<ItemGroup>
150151
<ClInclude Include="cpp_mgr.h" />
151152
<ClInclude Include="lib_plugins_mgr.h" />
153+
<ClInclude Include="metadata_mgr.h" />
152154
<ClInclude Include="ozil2_script_mgr.h" />
153155
<ClInclude Include="utils.h" />
154156
</ItemGroup>

OZ_Il2cpp_Console/OZ_Il2cpp_Console.vcxproj.filters

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
<ClCompile Include="ozil2_script_mgr.cpp">
3131
<Filter>源文件</Filter>
3232
</ClCompile>
33+
<ClCompile Include="metadata_mgr.cpp">
34+
<Filter>源文件</Filter>
35+
</ClCompile>
3336
</ItemGroup>
3437
<ItemGroup>
3538
<ClInclude Include="utils.h">
@@ -44,5 +47,8 @@
4447
<ClInclude Include="ozil2_script_mgr.h">
4548
<Filter>头文件</Filter>
4649
</ClInclude>
50+
<ClInclude Include="metadata_mgr.h">
51+
<Filter>头文件</Filter>
52+
</ClInclude>
4753
</ItemGroup>
4854
</Project>

OZ_Il2cpp_Console/metadata_mgr.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include "metadata_mgr.h"
2+
3+
namespace metadata_mgr
4+
{
5+
void proc_metadata(const char* ifp, const char* ofp) {
6+
7+
}
8+
9+
void swap_header_int32(char* &data,size_t len, int p1,int p2) {
10+
11+
}
12+
13+
void generate_ozmetadata_header(char*& data, size_t len) {
14+
15+
}
16+
17+
void proc_strings(char*& data, size_t len) {
18+
19+
}
20+
21+
void proc_stringslit(char*& data, size_t len) {
22+
23+
}
24+
};

OZ_Il2cpp_Console/metadata_mgr.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#pragma once
2+
#include <iostream>
3+
#include <fstream>
4+
#include <io.h>
5+
#include <vector>
6+
#include <Windows.h>
7+
#include <assert.h>
8+
#include <algorithm>
9+
#include <codecvt>
10+
#include "utils.h"
11+
#include "cpp_mgr.h"
12+
13+
namespace metadata_mgr
14+
{
15+
};
16+

OZ_Il2cpp_Console/oz_scripts/generate_script.py

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,40 @@
55
file=open(file_path,"w")
66
file.write("find_str_in_file Il2CppGlobalMetadataHeader 0 $head\n")
77

8+
file.write("printd $head\n")
9+
file.write("prints \\n")
10+
811
file.write("\n\n")
912

13+
#获取行数变量
1014
for i in range(1,60):#60*4=240 ,240<264 比最短的header少
1115
file.write("$h"+str(i)+" = $head\n")
12-
file.write("$h"+str(i)+" += "+str(i+1)+"\n")
16+
file.write("$h"+str(i)+" += "+str(1+i)+"\n\n")
17+
file.write("read_file_int32_lines metadata_header_repl.txt "+str(i)+" $s"+str(i)+"\n")
18+
file.write("$s"+str(i)+" += $head\n")
19+
file.write("$s"+str(i)+" += 2\n\n")
1320

1421
file.write("\n\n")
1522

16-
for i in range(1,30):
23+
#Header换行
24+
for i in range(1,60):
1725
file.write("swap_line ")
1826
file.write("$h"+str(i)+" ")
19-
file.write("$h"+str(60-i)+"\n")
27+
file.write("$s"+str(i)+"\n\n")
28+
29+
file.write("prints swap_\n")
30+
file.write("printd $h"+str(i)+"\n")
31+
file.write("prints _\n")
32+
file.write("printd $s"+str(i)+"\n")
33+
file.write("prints \\n\n\n")
2034

2135
file.write("\n\n")
2236

23-
file.close()
37+
file.close()
38+
39+
#Generate repl file
40+
# file=open("metadata_header_repl.txt","w")
41+
# for i in range(1,60):
42+
# file.write(str(60-i)+"\n")
43+
44+

OZ_Il2cpp_Console/oz_scripts/mdc.ozs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ repl_line_from_file $sanity mdc_init_assert.cpp
99
repl_line_from_file $check_ver mdc_init_assert.cpp
1010

1111
#变量
12-
$head
1312
find_str_in_file s_GlobalMetadata 0 $head
14-
printd $head
1513
insert_from_file $head mdc.cpp
1614

1715
#头引用
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
59
2+
58
3+
57
4+
56
5+
55
6+
54
7+
53
8+
52
9+
51
10+
50
11+
49
12+
48
13+
47
14+
46
15+
45
16+
44
17+
43
18+
42
19+
41
20+
40
21+
39
22+
38
23+
37
24+
36
25+
35
26+
34
27+
33
28+
32
29+
31
30+
30
31+
29
32+
28
33+
27
34+
26
35+
25
36+
24
37+
23
38+
22
39+
21
40+
20
41+
19
42+
18
43+
17
44+
16
45+
15
46+
14
47+
13
48+
12
49+
11
50+
10
51+
9
52+
8
53+
7
54+
6
55+
5
56+
4
57+
3
58+
2
59+
1

0 commit comments

Comments
 (0)