Configuration improvements (see TODO comments for assumptions that I made and assumptions that could be made to simplify it further). I designed this configuration in such a way that you can call read on it multiple times, but that is not necessarily desired.
General readability improvements, including proper usage of defines listed, proper include path to libil2cpp explicitly, and macro ensurance
Reduced string allocations. Nearly all strings created are done so in un-gc-able ways, with manual strings being used as replacements for nearly all C++ strings
Magic number removal for the number 13
Removal of the unnecessary single element in the sessionToken array
Attempt to ensure that array allocations happen slightly later, in an effort to trick GC into avoiding cleaning them up
Use a different hook for certificate chain completion because the other hook was too small to hook safely (verified via Ghidra dump, offset is: 0x1c22978)
General Note:
I performed a few style changes, so feel free to reject the PR on the basis of those, although I cannot guarantee when I can next look at this.
It is always a good idea to ensure you check the locations you are hooking to make sure they are large enough. The original certificate chain hook was actually overwriting a few bytes into an unrelated method and causing damage that was unnoticeable. This should help fix some crash cases.
This PR implements the following:
TODO
comments for assumptions that I made and assumptions that could be made to simplify it further). I designed this configuration in such a way that you can callread
on it multiple times, but that is not necessarily desired.13
sessionToken
array0x1c22978
)General Note: I performed a few style changes, so feel free to reject the PR on the basis of those, although I cannot guarantee when I can next look at this. It is always a good idea to ensure you check the locations you are hooking to make sure they are large enough. The original certificate chain hook was actually overwriting a few bytes into an unrelated method and causing damage that was unnoticeable. This should help fix some crash cases.
As always, message me on Discord at
Sc2ad#8836
!