rexdex / recompiler

Xbox360 -> Windows executable converter
MIT License
1.64k stars 81 forks source link

Add 'decompile' option to recompiler_api #16

Closed sumit0190 closed 6 years ago

sumit0190 commented 6 years ago

Thanks for the great work!

Upon executing recompiler_api from the command-line, the help states that the switches recompile and decompile can be used to unpack a XEX (and create PDIs) or recompile a PDI to produce native code. decompile doesn't work from the command-line - main.cpp has an if-else condition where we ignore everything that's not recompile - even though the functionality exists and is used by recompiler_tools. It would be nice to have the command-line APIs offer the same functionality as the GUI; it's totally unnecessary, but it kinda defeats the purpose of having these APIs in the first place. I can submit a PR if you wish.

rexdex commented 6 years ago

Thanks :)

What kind of output you consider good enough? It's quite easy to output the IDA like disassembly (similar to the one displayed in the tool). It would be mostly for reference though.

The purpose of the recompiler_api is to allow (in the future) to do executable processing without the need to run the UI version of the software. I have some test apps and it would be cool to put them through automated testing.

sumit0190 commented 6 years ago

The automated thing is exactly what I was working at. I wrote a small script that took a bunch of my old .xex files and passed them to the recompiler_api, but then I realized it doesn't decompile .xex files through the command line for whatever reason. IMO it's a simple change - you don't have to work on it right away and if you don't mind, I can submit a PR because I've already fixed it in my local branch.

On the subject of command-line APIs, another thing I found is that launching xenon_launcher from the command-line asks for the fsroot switch, but the code actually looks for root; that was a simple fix and once I made that change everything else worked fine (mostly fine; for some reason D3D11_CREATE_DEVICE_DEBUG wasn't working correctly so I had to set the flags to 0).

Super-impressive work though; good job!

rexdex commented 6 years ago

Thanks again for the kind words and sorry for all the bugs :)

I think I could PR the changes if you don't mind.

On 17 October 2017 at 02:43, Sumit Tiwari notifications@github.com wrote:

The automated thing is exactly what I was working at. I wrote a small script that took a bunch of my old .xex files and passed them to the recompiler_api, but then I realized it doesn't decompile .xex files through the command line for whatever reason. IMO it's a simple change - you don't have to work on it right away and if you don't mind, I can submit a PR because I've already fixed it in my local branch.

On the subject of command-line APIs, another thing I found is that launching xenon_launcher from the command-line asks for the fsroot switch, but the code actually looks for root; that was a simple fix and once I made that change everything else worked fine (mostly fine; for some reason D3D11_CREATE_DEVICE_DEBUG wasn't working correctly so I had to set the flags to 0).

Super-impressive work though; good job!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rexdex/recompiler/issues/16#issuecomment-337083847, or mute the thread https://github.com/notifications/unsubscribe-auth/AHpBrU73ASbwg7oRU2EtM0jbb9M56Iqtks5ss_gXgaJpZM4P7ZzJ .

-- Without order nothing can exist, without chaos nothing can evolve.

sumit0190 commented 6 years ago

Sure thing; I'll work on the changes and submit something soon. I will also modify the "How to run it" section to include information about using the GUI and the command-line APIs (I see a bunch of PRs that have cleaned up the README a little but I don't think anyone actually built the code, much less use it, which is why no one bothered checking that section).

rexdex commented 6 years ago

That's what I think as well. I will post the test applications along with the ground-through output generated by them (on actual X360 dev kit). There are few vectorized instructions that I need to check. Also, having some kind of tests is in general a good idea, especially that the way stuff can break here is very subtle (aka. spooky action at the distance).

On 17 October 2017 at 02:54, Sumit Tiwari notifications@github.com wrote:

Sure thing; I'll work on the changes and submit something soon. I will also modify the "How to run it" section to include information about using the GUI and the command-line APIs (I see a bunch of PRs that have cleaned up the README a little but I don't think anyone actually built the code, much less use it, which is why no one bothered checking that section).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rexdex/recompiler/issues/16#issuecomment-337085494, or mute the thread https://github.com/notifications/unsubscribe-auth/AHpBrV5pYBwWa4J_IYenrfwUbVrlY94vks5ss_rSgaJpZM4P7ZzJ .

-- Without order nothing can exist, without chaos nothing can evolve.

sumit0190 commented 6 years ago

That would be super cool. I also suggest making issues here on GitHub as you discover them; that way potential contributors can start hacking away.