Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

masagrator
Copy link
Contributor

@masagrator masagrator commented Nov 26, 2023

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:
#762

@masagrator masagrator changed the title Allow loading and saving from any place + replace keywords il2cpp_header_to_ghidra.py: Allow loading and saving from any place + replace keywords Nov 26, 2023
@earthonion
Copy link

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
Copy link
Contributor Author

masagrator commented Nov 29, 2023

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
Copy link

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
Copy link
Contributor Author

masagrator commented Dec 13, 2023

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants