Skip to content
Snippets Groups Projects
Commit bb665926 authored by Pietro Fezzardi's avatar Pietro Fezzardi Committed by Alessandro Di Federico
Browse files

Fix ISA recognition in translate script

The header of an ELF file contains two bytes representing the ISA.
These two bytes are offset 0x12 in the file, which is offset 18, not
offset 17 like it was in the script.
parent bbd34712
No related branches found
No related tags found
No related merge requests found
...@@ -78,22 +78,22 @@ import sys ...@@ -78,22 +78,22 @@ import sys
file = open(sys.argv[1], "rb") file = open(sys.argv[1], "rb")
file.seek(5) file.seek(5)
result = hexlify(file.read(1)) result = hexlify(file.read(1))
file.seek(17) file.seek(18)
result += hexlify(file.read(2)) result += hexlify(file.read(2))
file.close() file.close()
print(result.decode("utf-8"))' "$INPUT") print(result.decode("utf-8"))' "$INPUT")
case "$ARCHID" in case "$ARCHID" in
010028) 012800)
ARCH=arm; ARCH=arm;
;; ;;
020200) 020008)
ARCH=mips; ARCH=mips;
;; ;;
01003e) 013e00)
ARCH=x86_64; ARCH=x86_64;
;; ;;
010003) 010300)
ARCH=i386; ARCH=i386;
;; ;;
*) *)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment