JayFoxRox / xbox-tools

A collection of tools related to original Xbox
62 stars 11 forks source link

dump-xbox abnormal execution #34

Open ghost opened 7 years ago

ghost commented 7 years ago

I am trying to use the dump-xbox utility to get the eeprom and cert keys from my xbox. I managed to compile it with nxdk and upload it to my xbox but when I try to execute it, my keys appear as a long string of 02X (the same hex present in the code). I also noticed that the variables errors and MB of RAM show up as "i" instead of numbers. Do you know what could I be doing wrong? I attach the compilation log below. Also, may I ask if you can release the compiled xbe? There shouldn't be any legal issues if it is compiled with nxdk instead of the MS xdk. dump-xbox-compilation

JayFoxRox commented 7 years ago

This is an issue with nxdk having the worst libc you could possibly imagine (it doesn't know many printf format identifiers). We should use a better libc (such as newlib or cromwell libc) in nxdk for the future.

Overall the dump-xbox port / tool is not ideal. It will hopefully get more contributions in the future so we can use it as a legal and up-to-date dumping tool.

The dumped files should still be correct (check keys.bin in the folder you ran the tool in, with a hex-editor).

If the files are incorrect / missing: For now, either compile with OpenXDK (and keep fingers crossed that it even runs) or use the tools present in your dashboard to gain access to the eeprom. Not sure about the cert key; but you could use nxdk-rdt for it - writing your own short python script.

Unfortunately it turned out that dumping the kernel for XQEMU is not possible. The xboxkrnl.exe dumps with this tool will result in a bad dump (INIT section missing). Keep this in mind, depending on what you intend to do.

Sorry for all the trouble :(

ghost commented 7 years ago

Well, I have tried to compile dump-xbox with Openxdk as well in both Linux and Windows but I didn't have much luck. In linux I don't seem to be able to build oxdk because of compiling errors no matter what version of mingw I use. In windows, if I use the pre-built version, it compiles but at the end the linker throws out some errors. All the files that dump-xbox is supposed to generate are missing in my xbox. I tried to run it from the app and games folder in the E partition but it doesn't matter, the result is the same. Well, now I will retry to build the tool with oxdk and see if I can solve those linking problems.

JayFoxRox commented 7 years ago

See #36 as to why the files are missing - I forgot about that. I'll try to find time to look into it soon. I'm just more focused on nxdk-rdt (related scripts are in the python-scripts folder) and XQEMU currently.

ghost commented 7 years ago

Well, this is strange. If I activate the dumpFile function, the compiler says that FILE* and f are undeclared despite stdio.h being included in the source. I have just written a small program to test #include and it works as expected. Also, the complier complains about an implicit declaration of fopen() and fwrite(). Have you some ideas?

JayFoxRox commented 7 years ago

Horrible libc in nxdk which does not provide those functions.

We need more active developers in the Xbox scene to fix these sort of stupid / annoying issues. We barely have capacity to get anything done in Xbox emulation - let alone toolchains or new homebrew.

ghost commented 7 years ago

Despite all my efforts, I don't seem to be able to build dump-xbox with oxdk. Now I get a ton of undefined references to a slew of functions. I guess it is the same problem of before. Well, I think I will give up at this point. dump-xbox oxdk compilation.txt

JayFoxRox commented 7 years ago

fair enough, I'll look into it and respond on this issue when I have solved all problems with nxdk.

ghost commented 7 years ago

JayFoxRox, I was finally been able to dump the keys but do you know if there is a method to verify if they are correct? My eeprom key appears as all zeros and that seems very strange to me while the cert key appears as a normal hex string so that one could be correct but I don't know how to be sure of it.

JayFoxRox commented 7 years ago

No, you can obviously hash them and compare the hash with that others give you. However, I don't have such hashes yet. I won't share keys (for comparison or otherwise) as they are protected by law. Just test if they work for whatever purpose you need them?

Be assured: The eeprom key should almost never be all-zeros (unless you have a patched bios which does this, in which case you wouldn't have had to dump it)

ghost commented 7 years ago

Well, I have run a bios checker utility on my xbox and the bios is recognized as an original 4034 so this means that I must have made a mistake in the code.

JayFoxRox commented 7 years ago

.. if you can run a bios checker it can't be original 4034 because that wouldn't allow you to run unsigned code. Depending on the mod to allow this, the eeprom key could have been changed / disabled too to avoid locking yourself out. However, none of this is related to this issue. If you need usage help with this contact me on other channels (freenode IRC or most common XMPP servers - username "JayFoxRox" everywhere)