-
Notifications
You must be signed in to change notification settings - Fork 920
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
Produce byte-identical executable using the same compiler #11
Comments
I don't know much about this but from efforts in the Linux community (Debian and maybe others) to produce byte identical executables, you will need to remove any type of code that may cause the compiler to generate output that is variable. Things like timestamps used in the compiler and other things will need to be taken into account. Producing byte identical output is primarily being used (from what I understand) for validity purposes. To make sure that the output produce from the original author can be faithfully reproduced by others. Therefore if a downstream source produces a non byte identical output compared to the author's, then either the author has changed or is compromise, or the downstream is.
For this project, given that Blizzard isn't developing it anymore, I don't think this goal should be pursued. You will be limiting your tool chain and since your resources are already limited, the project will be hindered. You should consider just continue your improvements and stabilization efforts.
…On June 11, 2018 7:27:16 AM EDT, Robin Eklind ***@***.***> wrote:
This issue tracks a very ambitions goal of Devilution, the production
of a byte-identical executable to the 1.09b original. To achieve this
goal, the exact same compiler has to be used as was used to produce the
original executable.
For `diablo.exe` version 1.09b, this corresponds to Visual C++ 5.10,
and for the debug release `diablo.exe` version 1.00 (1996-12-21) this
corresponds to Visual C++ 4.20 compiled in debug mode; as based on PEiD
output.
![PDiD
109b](https://user-images.githubusercontent.com/1414531/41229100-0e9556ec-6d7b-11e8-8d01-3ac649d45cb2.png)
![PEiD 100
dbg](https://user-images.githubusercontent.com/1414531/41229105-12c0b324-6d7b-11e8-9e7a-215c76b336fc.png)
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/galaxyhaxz/devilution/issues/11
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
Also what I mean by byte identical is that at the end of every build, the checksums (hash) for the executable is identical to the original. Since Blizzard didn't have this byte identical goal, it may well be you will never get the same haha as the one used in the original game, but you may be able to get the hashes to be the same within your own multiple compilations of the same commit (reproducible builds is something you may want to look into from Debian's efforts for this).
…On June 11, 2018 7:27:16 AM EDT, Robin Eklind ***@***.***> wrote:
This issue tracks a very ambitions goal of Devilution, the production
of a byte-identical executable to the 1.09b original. To achieve this
goal, the exact same compiler has to be used as was used to produce the
original executable.
For `diablo.exe` version 1.09b, this corresponds to Visual C++ 5.10,
and for the debug release `diablo.exe` version 1.00 (1996-12-21) this
corresponds to Visual C++ 4.20 compiled in debug mode; as based on PEiD
output.
![PDiD
109b](https://user-images.githubusercontent.com/1414531/41229100-0e9556ec-6d7b-11e8-8d01-3ac649d45cb2.png)
![PEiD 100
dbg](https://user-images.githubusercontent.com/1414531/41229105-12c0b324-6d7b-11e8-9e7a-215c76b336fc.png)
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/galaxyhaxz/devilution/issues/11
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
Indeed. Timestamps would have to be removed and other parts that are variable from build to build as well. Good thing is those are easily identified. So one approach would be to simply extract the contents of the We can also keep track of which offsets correspond to which function, and in this way check off one function at the time. Note, relative offsets to addresses will be variable if the output binary rearranges where code and data is stored, and also depending on the size of these parts. It most definitely won't be an easy challenge. But, at least to me, that's what makes it fun! Also, this is not goal number one. That would be to fix crashes, improve stability, fix builds across the main platforms (Windows, Linux, Mac), etc. Rather, this can be thought of as an aspirational goal that Devilution may one day achieve, or perhaps more likely not. But I for one would definitely want to be part of making it happen! Cheers, |
I personally don't a byte for byte copy is possible. You would literally have the exact code any extra variables or optimizations or anything would completely throw it off. Mewmew , I respect your energy ) |
There are already projects like https://github.com/pret/pokeruby or https://github.com/MimicYou/pokeredbeta that build hash-perfect recreations of their originals. |
Wow, that is really cool! Thanks for pointing out these projects. |
Hey, Diablo is already decompiled and refactored, the project is called The Hell and source code was hosted on Assembla at least in 2013 |
@gp-alex That's great! Do you know where this source code is hosted? |
You are correct, Hellfire was decompiled as early as 2006 IIRC, and The Hell released their sources a few years ago at the Khandurus network. However, it seems to have completely disappeared from the internet, same with The Dark/Khandurus. The Hell 2 creator still has a copy. He reached out to me a few days ago and said he might pop in a make a contribution or two. |
Just make sure this stays as original as possible. I have seen The Hell mod and I thought it was grindingly unbalanced and a weird distortion of what Diablo is. |
No worries, this is tracked by #11. |
What compiler was used to generate the exe in the 0.2 release? I patch between it and Diablo.exe seams to indicate a 60% correlation. |
I used VC++ 5.10 for all release builds. The GNU makefiles currently don't properly add the Icon and resource files. |
Added an issue to track this #48. |
See this comment for a major update! |
I think this issue can be closed. It's topic should be exactly the same as #111 which is newer. PS: If I should stop looking for these housekeeping tasks, please tell me ;) |
It's great you are looking for housekeeping tasks :) Please continue. As for this issue, it is similar but slightly different from #111. For instance, there are other issues to consider even when we have exactly the same compiler, such as time stamps being included in the binary. This issue mentions some of those aspects. However, I'd be fine with closing this issue as the primary work now is to get bin perfect assembly, which is tracked by #111 and the bin exact milestone. Later on when we want to figure out specific issues, such as how to handle time stamps, we can open new dedicated issues for those. Closing for now. We can re-open at a later time, should we feel like. |
This issue tracks a very ambitions goal of Devilution, the production of a byte-identical executable to the 1.09b original. To achieve this goal, the exact same compiler has to be used as was used to produce the original executable.
For
diablo.exe
version 1.09b, this corresponds to Visual C++ 5.10, and for the debug releasediablo.exe
version 1.00 (1996-12-21) this corresponds to Visual C++ 4.20 compiled in debug mode; as based on PEiD output.Edit: reference discussion: https://github.com/galaxyhaxz/devilution/pull/10#issuecomment-396211436
The text was updated successfully, but these errors were encountered: