Perfare / Il2CppDumper

Unity il2cpp reverse engineer
MIT License
6.94k stars 1.37k forks source link

il2cpp_header_to_ghidra.py: Allow loading and saving from any place + replace keywords #764

Open masagrator opened 10 months ago

masagrator commented 10 months ago

Script now shows window from which user can choose from where they want to load file + window where it should save it.

Also replaces all C keywords if they are used as variable name, by adding "_" at the beginning of name as many times as needed (if 9 is not enough, it skips replacing this name) to not use name that is already in use.

Keywords list taken from here: https://en.cppreference.com/w/c/keyword

Fixes issue mentioned here: https://github.com/Perfare/Il2CppDumper/issues/762

earthonion commented 10 months ago

I used this version to replace C Keywords if they are variable names, it still got an error at

bool _signed;

Ended up changing '_' to 'is' so it would then be 'issigned'

Hope this helps

masagrator commented 10 months ago

I guess there are also arch and compiler specific keywords... I guess we can't do much about this than update script regularly. :D

Cr4nkSt4r commented 9 months ago

Line 58: " signed;"; ..................^ Correction: (replace ; with ,) " signed;",

Maybe one thing to make a note for would be, that this script is intended to be run in the ghidra script environment, because of askFile().

masagrator commented 9 months ago

None of Python scripts in this repository were designed to run directly under Python, so you would need to point this out for everything.

Cr4nkSt4r commented 9 months ago

None of Python scripts in this repository were designed to run directly under Python, so you would need to point this out for everything.

Have you ever read the README? All of them are explained, but this python script isn't directly supported by Perfare, because no use of Ghidra. So I just pointed out, it may be informative, to just drop that info. There are enough people alive, who wouldn't know.