I wrote an article analyzing Android C# scripts before, mainly to pave the way for this article. Because iOS is now in IL2CPP mode, C# scripts have been converted to C code. So it would be much more difficult to analyze iOS alone. If you start with Android C# scripts, because iOS and Android scripts are the same, you can match the function names analyzed in Android to the C functions in iOS and then make hook modifications. Extract ipa First, extract the ipa package of Traveling Frog from the jailbroken device, and use frida-ios-dump to extract it with one click. Since it is a Japanese name, first list the name through ./dump.py -l, then copy the name or dump it through the bundle id. IL2CPP symbol restoration Since the unity game is compiled with the IL2CPP option, cpp code will be generated. You cannot see the functions and function names directly using IDA, and the strings used in the game are saved in the global-metadata.dat resource file. First, you need to restore the symbols of the corresponding c functions by extracting the strings in the global-metadata.dat file. There are also ready-made articles: Restoring symbols of unity games compiled with IL2CPP, and there are also threaded projects on github that do this Il2CppDumper. Download the release tool, run Il2CppDumper.exe and select the il2cpp executable file and global-metadata.dat file in turn, then select the Auto (Plus) mode, and the dump.cs file and script.py script will be generated. Use IDA to open the executable file and then use the script.py script to restore the symbols. Makingmethodname...MakemethodnamedoneSettingString...SetstringdoneMakingfunction...Makefunctiondone, please wait forIDAtocomplete the analysisScriptfinish! According to the function hook code After restoration, you can hook the corresponding code according to the function name analyzed before. First, the number of clovers is obtained through SuperGameMaster.CloverPointStock(). Search CloverPointStock in IDA as follows: Then you can directly hook this function. Since the inline hook is currently on a jailbroken machine, the solution for hooking a non-jailbroken machine will be discussed later. Use MonkeyDev to create a new Logos Tweak project, clear the contents of .xml and write the following content:
Then set the port and device password in build settings and then install it with command + b to see the effect. The same goes for other function hooks:
There is a function RaffelPanel$$LotteryCheck. To modify the value of result in it, we need to look at the position of result assignment according to the assembly or pseudo code. The pseudo code of this function obtained by F5 is as follows:
The position of *(_DWORD *)(v1 + 80) here is actually this.result, so just modify the value of the offset position 80. Summarize In summary, it is not easy to analyze the converted C code of the script in iOS. If you can restore the iOS symbols based on the results of the Android C# script analysis, you can directly hook the corresponding iOS function based on the function analyzed by Android to modify the parameters or values. However, this is still a hook on a jailbroken device, and then it will be explained that static hook operations can also be performed on non-jailbroken devices. |
<<: Recommend some keys to improve iOS development efficiency
>>: Some keys to improve iOS development efficiency
Introduction: Security challenges are increasing ...
[[167050]] Beijing time, June 1 morning news, AMD...
Just now, NIO released its third-quarter financia...
Meizu S6, the first full-screen mobile phone of t...
Brief introduction to the resources of Flink real...
Well, let’s start from the small circle again. Re...
The researchers took pictures of the children'...
Q: What language is used to develop WeChat mini p...
Over the years, the outside world has always give...
The COVID-19 pandemic has repeatedly recurred, an...
Zigong movie applet development price 1. Display ...
According to statistics from the National Health ...
Audit expert: Yin Tielun Deputy Chief Physician, ...
Expert of this article: Zhao Jing, attending phys...
According to statistics, the number of cars in my ...