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

TypeError when using a NX2ELF converted NRO #1

Open
NyxTheShield opened this issue May 16, 2019 · 4 comments
Open

TypeError when using a NX2ELF converted NRO #1

NyxTheShield opened this issue May 16, 2019 · 4 comments

Comments

@NyxTheShield
Copy link

As the title implies, I am getting a TypeError when using a NX2ELF converted NRO (Specifically, 3.0.0 lua2cpp_fox.elf)

Traceback (most recent call last): File "C:\Users\felip\Desktop\ProjectNX Dev\Releases\Script Dumper\main.py", line 118, in <module> dump("lua2cpp_fox.elf") File "C:\Users\felip\Desktop\ProjectNX Dev\Releases\Script Dumper\main.py", line 21, in dump sections = SectionTable(aux).sections File "C:\Users\felip\Desktop\ProjectNX Dev\Releases\Script Dumper\sectionTable.py", line 6, in __init__ for l in text.split('\r'): TypeError: a bytes-like object is required, not 'str'

When manually converting the type for both errors using encodes, I get the followuing output, with no scripts being extracted on the output folder

Opening file lua2cpp_fox.elf lua2cpp::create_agent_fighter_animcmd_game_fox(phx::Hash40,app::BattleObject*,app::BattleObjectModuleAccessor*,lua_State*) found Scripts extracted

@rubendal
Copy link
Owner

It's an issue related with latest r2pipe version, try using r2pipe v1.2.0

Updated Readme with r2pipe version on requirements

@NyxTheShield
Copy link
Author

Uninstalled the latest release and used r2pipe 1.2.0 (installing with pip install r2pipe==1.2.0). Doesnt need the decode fixes but it still gets no output in the output folder.

@NyxTheShield
Copy link
Author

According to @jugeeya, replacing the \r linebreaks into \n for windows users should work, but it still doesnt work on my setup (32bit Python 3.7.2, 1.2.0 r2pipe, Radare2 3.5.1)

@rubendal
Copy link
Owner

In my case I have \r linebreaks on output and I'm using windows, I tried forcing radare2 output to have both linebreaks using a replace in an attempt to solve this issue, can you test if it works without replacing \r with \n on splits with latest version? a31afd3

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

No branches or pull requests

2 participants