You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use --mode raw to decompile x86 code. It mostly works, but if input file contains 18 leading zeroes, then it complains about file being COFF64. For example the following bash script:
offset=18
dd if=/dev/zero bs=$offset count=1 >raw.bin
printf "\x31\xc0\xc3" >>raw.bin # xor eax, eax; ret
./retdec-decompiler.py \
--mode raw \
--arch x86 \
--endian little \
--raw-section-vma 0 \
--raw-entry-point $offset \
raw.bin
produces an error:
##### Gathering file information...
RUN: /media/data/b/u/p/retdec/sandbox/bin/retdec-fileinfo -c /media/data/b/u/p/retdec/140/raw.bin.c.json --similarity /media/data/b/u/p/retdec/140/raw.bin --no-hashes=all --crypto /media/data/b/u/p/retdec/sandbox/bin/../share/retdec/support/generic/yara_patterns/signsrch/signsrch.yara --max-memory-half-ram
Input file : /media/data/b/u/p/retdec/140/raw.bin
File format : COFF
File class : 64-bit
File type : Relocatable file
Architecture : Unknown machine type (0)
Overlay offset : 0
Overlay size : 0x15
Warning: Unknown compiler or packer.
##### Trying to unpack /media/data/b/u/p/retdec/140/raw.bin into /media/data/b/u/p/retdec/140/raw.bin-unpacked.tmp by using generic unpacker...
RUN: /media/data/b/u/p/retdec/sandbox/bin/retdec-unpacker /media/data/b/u/p/retdec/140/raw.bin -o /media/data/b/u/p/retdec/140/raw.bin-unpacked.tmp --max-memory-half-ram
##### Unpacking by using generic unpacker: nothing to do
##### Trying to unpack /media/data/b/u/p/retdec/140/raw.bin into /media/data/b/u/p/retdec/140/raw.bin-unpacked.tmp by using UPX...
RUN: upx -d /media/data/b/u/p/retdec/140/raw.bin -o /media/data/b/u/p/retdec/140/raw.bin-unpacked.tmp
upx: /media/data/b/u/p/retdec/140/raw.bin: EOFException: premature end of file
##### Unpacking by using UPX: nothing to do
Error: Unsupported target format 'COFF64'. Supported formats: ELF32, PE32, Intel HEX 32, Mach-O 32.
while if I change offset to 17 or less, then decompilation works.
I thought --mode raw is supposed to skip format guessing and unpacking. Is this right?
The text was updated successfully, but these errors were encountered:
I ran into this bug too. My file started with a few kilobytes of padding zeroes. I was able to work around the problem by replacing the zeroes with random bytes.
I use --mode raw to decompile x86 code. It mostly works, but if input file contains 18 leading zeroes, then it complains about file being COFF64. For example the following bash script:
produces an error:
while if I change offset to 17 or less, then decompilation works.
I thought --mode raw is supposed to skip format guessing and unpacking. Is this right?
The text was updated successfully, but these errors were encountered: