mondul / HiyaCFW-Helper

Tool for making the HiyaCFW (and TWiLightMenu++) installation process simpler
The Unlicense
119 stars 18 forks source link

New update causes 1-2435-8325 error on CFW boot #74

Closed Kodtiz3D closed 5 years ago

Kodtiz3D commented 5 years ago

In two, possibly three, confirmed cases in Discord assistance channels, users reported 1-2435-8325 errors when attempting to boot with HiyaCFW. TWiLightMenu was not affected and worked without issue. When using HiyaCFW Helper 3.5 the error was replaced with An error has occurred, an issue with the Launcher not liking free space above 2GB. Not the Helper. It is very likely the switch to fatcat to extract the NAND contents is causing the issues aforementioned.

SimPiko commented 5 years ago

Happened to me too, tested both on Win7 and Win10.

I've compared files generated by 3.5 and 3.5.1 and noticed that 3.5.1 was making some files slightly bigger than older version(sometimes few bytes, sometimes more). So then I've compared those missized files with hex editor and found out that, for whatever reason, all 0x0A's were replaced with 0x0D/0x0A pair, like something was converting LF line breaks to CRLF line breaks! In BINARY files!

I'm guessing something went wrong on 7b1a92155e52f3e48a5c9f271fe7062d9cbe5f91, but don't know what exactly, probably something with 7za or fatcat as @Kodtiz3D said.

tl;dr version 3.5 generates bootable sdnand files, 3.5.1 messes up files by adding unnessesary bytes.

david-zzj commented 5 years ago

Happened to me too, tested on Win8 . My console is DSi 1.4U. Unlaunch autoboot TWmenu++ is fine, when changed to Hiya, it gave me Error 1-2435-8325.

driehoek91 commented 5 years ago

me too, after trying to find the differences of each file one by one with the previous build, the cause is in / sys/cert.sys if I use cert.sys from the previous build, Hiyacfw can run normally

david-zzj commented 5 years ago

Really? Can you upload a previous cert. sys for me? Thanks!

driehoek91 commented 5 years ago

it looks like cert.sys is connected to each nand backup. v3.4 v3.4.1 v3.5 has the same cert.sys, for v3.5.1 has a different cert.sys itself. but you might be able to try mine cert.zip

david-zzj commented 5 years ago

Ok,i will post result when i replace cert.sys later.

david-zzj commented 5 years ago

@driehoek91, replace cert. sys is no luck for me, the boot error still there. But I redo with hiya3.5 release all works again.

hiirotsuki commented 5 years ago

Can confirm, happens to me too with version 3.5.1

mondul commented 5 years ago

Problem seems to be on an issue with the VC++ 2003 compilation of fatcat, specifically on the conversion from string to a 64-bit unsigned integer. Will compile it using the latest Visual Studio Community, but it will require the 2015-2019 runtime installed, hope that's not an issue.

SimPiko commented 5 years ago

specifically on the conversion from string to a 64-bit unsigned integer.

Huh, that would kinda explain the extra bytes then, good find.

anatoliy88v commented 5 years ago

got the same problem yesterday, cert.sys did not help me

oboroc commented 5 years ago

I also got this error while using 3.5.1 too.

I then tried 3.5.0 and now it works.

mondul commented 5 years ago

Hi, compiled fatcat for Win64, needs the Visual C++ 2015-2019 runtime. Please replace the exe in the Windows release with the one from this archive and let me know if it works for you.

Kodtiz3D commented 5 years ago

I'll test on my Windows partition ASAP and see if there are any differences.

mondul commented 5 years ago

Finally got ahead of a Windows machine, tested the fatcat VC++ 2019 compilation and did not work, I was unable to compile it with mingw and tried also with cygwin without success, so had to nuke the release. I re-compiled the v3.5 and re-uploaded it, so please keep using that one until I find the way for fatcat to work correctly in Windows. Closing ticket.

oboroc commented 5 years ago

@mondul , can I help? I have Visual Studio 2019 Community, I can compile C/C++ code and comfortable doing it. What does fatcat do and were is it's source? I don't see anything fatcat in your repo.

mondul commented 5 years ago

@oboroc this is the fatcat repo: https://github.com/Gregwar/fatcat You will need CMake for generating the Visual Studio solution.

oboroc commented 5 years ago

Thank you for pointing me, @mondul ! I'm now trying to compare extracted files between fatcat under WSL and fatcat on Windows. I couldn't use the Linux binary you bundled with HiyaCFW-Helper-v3.5-Python3 release, it doesn't seem to work:

$ ./fatcat
-bash: ./fatcat: cannot execute binary file: Exec format error

I was able to install package with sudo apt install fatcat in WSL.

I compared files extracted with fatcat under Linux to files extracted with your Windows fatcat.exe, and they are identical. I used WinMerge. I don't think fatcat is the problem.

mondul commented 5 years ago

@oboroc Linux binaries does not work in WSL due how the real Linux kernel handles statically linked executable files. The problem with fatcat was that it uses some POSIX file functions, and those were not implemented correctly in Windows (they were treating all files as ASCII instead of binaries, so every time a 0xA new line character was read it was being replaced by 0xD 0xA, so that extra carriage return messed up all extracted files), so changed them for native Win32 API file functions and voilà! issue fixed. At the same time I changed the compiler from Visual C++ to mingw to avoid the runtime dependency. @Kodtiz3D the v3.5.1 release was updated with the new working fatcat binary, thanks for reporting this issue.

chronoss09 commented 3 years ago

Hi !

I have this error after Hiya boot splash, i used the last version of the Helper :(