-
Notifications
You must be signed in to change notification settings - Fork 192
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
When using rcedit on 7-Zip created archive, file gets corrupted #69
Comments
I'm also seeing issues with rcedit corrupting my executable after setting the version string. It could be this issue. Is it possible to get a fix? |
Same exact issue. |
yup. executables created with 7zsd.sfx will be corrupted randomly. |
I use 7sfx files from: https://github.com/chrislake/7zsfxmm and the following approach:
You'r changing the icon of the SFX module which is in front of the archive. |
yup. fixed. thanks. |
Oh, I get it! I was doing the commands Draykee posted in the opposite order and it was not working. So maybe rcedit could be made to work even when the commands are completed the other way around so that other people would not have this problem? |
im having a similar issue with https://github.com/leafac/caxa |
Since rcedit relies on the |
Indeed that's correct. dotnet5/6 binaries also store the application code (as IL) after the "official end" of the native binary, but it's worth noting that, at least in the dotnet case, simply copying the data away beforehand and putting it back at the end afterwards will not help - you'll still end up with a corrupt exe. The "offset" pointing to this extra code stored at the end is written within the real executable code, so unless you know how to update this offset to match the new executable length, the exe will still be garbage. I don't know for sure that other approaches will suffer the same problem (eg. 7z) but I suspect so, and it will likely be impossible to find a universal solution that works for every exe using this approach. I work-around this problem in dotnet exe's specifically by extracting all of the embedded code at the end and then compiling a whole new binary bundle just like the SDK does it, setting the icon before re-appending the extracted code. |
Oh, yes, if there's an offset somewhere to the appended data then rcedit can't hope to support it. But that's why appending zip files to an exe is so popular, it works because the header is at the end of the file without needing to hardcode the offset. And so I expect that what I described will work in quite a lot of cases. Don't know about 7zip. |
Legend |
Also trying to modify 7z SFX, and rcedit never finishes execution stuck in some kind of infinite loop. I am using 7z SFX from this repo: https://github.com/garyzyg/7zs-windows Executing like this: |
I am trying to change the resources of an sfx exe archive created with 7-Zip. When I do so however, the content of the archive is replaced with the files for the resources. Yes I said replaced. If I do this with a large archive, the file size of the file is reduced dramatically. See below for details.
"C:\Program Files\7-Zip\7z.exe" a -sfx7z.sfx "<path of archive to create ending in .exe>" "<path of file or folder to archive>"
rcedit-x64.exe "<path of archive>" --set-version-string "LegalCopyright" "Copyright (c) 2017 <name>"
The text was updated successfully, but these errors were encountered: