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
Different ways to implement locks in Objective-C ...
When delivering information flow, especially runn...
The popularity of mobile smart devices also bring...
Yuanli.com earns precise private domain with mont...
The concept of User Growth (UG) originated from t...
Push is defined as the act of a message sender de...
Nowadays, more and more young people may choose t...
The human brain seems to be naturally equipped wi...
According to data released by the SMMT, new car r...
Landing page quality and user matching are two ke...
The earliest playable musical instrument, the ear...
Every company wants to build its own internet cel...
Rong Xuzheng still remembers that the day he lear...
When it comes to search engines, everyone used to...
The wedding photography industry has different wa...