Tracking of the "similarity" to the original binary.

This commit is contained in:
Anders Jenbo
2018-09-02 00:56:57 +02:00
committed by Dennis Duda
parent 1fe38c84f6
commit c63a2d2100
4 changed files with 15 additions and 3 deletions
+2
View File
@@ -1,4 +1,6 @@
*
!orig_full.asm
!status.sh
!VS6/COMMON/MSDEV98/BIN/MSPDB60.DLL
!VS6/COMMON/MSDEV98/BIN/RCDLL.DLL
!VS6/COMMON/MSDEV98/BIN/RC.EXE
Executable
+3
View File
@@ -0,0 +1,3 @@
/orig_full.asm
/VS6
/DevStudio_5.10
+2 -3
View File
@@ -4,7 +4,7 @@ Docker build system for devilution using the original tools.
In order to verify the accuracy of the source code and to generate a binary that is as close as possible to the original one, it is necessary to compile it using the original toolchain. This tool generates a docker image that can be used to compile devilution on any platform with that toolchain.
This build system is used in the devilution CI system as well in order to make sure that all changes can be compiled with the original toolchain.
This build system is used in the devilution CI system as well in order to make sure that all changes can be compiled with the original toolchain and also calculate the accuracy of the binary.
## Running
@@ -22,7 +22,7 @@ docker run -v $(pwd):/root/devilution -e MAKE_BUILD=pdb diasurgical/riivaaja
## Building a new image
Place the files for Visual C++ 5 SP3 (DevStudio_5.10) and Visual C++ SP5 PP5 (VS6) in the Riivaaja root folder. Make sure the versions of VC actually support optimizations (Professional and higher).
Place the files for Visual C++ 5 SP3 (DevStudio_5.10) and Visual C++ SP5 PP5 (VS6) in the Riivaaja root folder. Make sure the versions of VC actually support optimizations (Professional and higher). Optionally use Devilution-comparer to generate a orig_full.asm and put it in the root to allow Riivaaja to generate a project status.
Then run the following command:
@@ -38,4 +38,3 @@ Make sure that all the files needed have the right casing (see the `.dockerignor
We aim to expand this to support the following:
- Artifact generation
- Tracking of the "similarity" to the original binary.
Executable
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh
set -e
diff /root/orig_full.asm compare_full.asm > /tmp/asm.diff || true
insertions=$(cat /tmp/asm.diff | grep "^+" | wc -l)
deletions=$(cat /tmp/asm.diff | grep "^-" | wc -l)
total=$(cat /root/orig_full.asm | wc -l)
echo "$(((insertions + deletions) / (total * 2 / 100)))% change, $((insertions)) insertions(+), $((deletions)) deletions(-)"