HexHive / HexHive/retrowrite

Cannot recompile assembled code[BUG]

Open
#31 2 comments 0 reactions 1 assignee Claimed by @diagprov View on GitHub
analysis-needed bug
Dominant language
Python
Stars
750
Forks
87
PR merge metrics
No merged PRs in 30d

Description

When I try to compile the assembled code I get this error
```
(retro) bash-5.1$ file binary/quich
binary/quich: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2,
BuildID[sha1]=f78f9f350f2b849566bbc2062e349729a5493eba, for GNU/Linux 4.4.0,
with debug_info, not stripped

(retro) bash-5.1$ retrowrite binary/quich asm/quich_reassembled.s
.init_array frame_dummy pointer removed.
[*] Relocations for a section that's not loaded: .rela.dyn
[*] Relocations for a section that's not loaded: .rela.plt
[x] Couldn't find valid section ade0
[x] Couldn't find valid section afd8
[x] Couldn't find valid section afe0
[x] Couldn't find valid section afe8
[x] Couldn't find valid section aff0
[x] Couldn't find valid section aff8

(retro) bash-5.1$ gcc asm/quich_reassembled.s -lm -o binary/quich_reassembled
asm/quich_reassembled.s: Assembler messages:
asm/quich_reassembled.s:4898: Error: unrecognized symbol type "GLIBC_2.2.5_b220"
asm/quich_reassembled.s:4898: Error: junk at end of line, first unrecognized character is `,'
asm/quich_reassembled.s:4899: Error: junk at end of line, first unrecognized character is `@'
asm/quich_reassembled.s:4900: Error: invalid character '@' in mnemonic
asm/quich_reassembled.s:4936: Error: unrecognized symbol type "GLIBC_2.2.5_b230"
asm/quich_reassembled.s:4936: Error: junk at end of line, first unrecognized character is `,'
asm/quich_reassembled.s:4937: Error: junk at end of line, first unrecognized character is `@'
asm/quich_reassembled.s:4938: Error: invalid character '@' in mnemonic
asm/quich_reassembled.s:4974: Error: unrecognized symbol type "GLIBC_2.2.5_b240"
asm/quich_reassembled.s:4974: Error: junk at end of line, first unrecognized character is `,'
asm/quich_reassembled.s:4975: Error: junk at end of line, first unrecognized character is `@'
asm/quich_reassembled.s:4976: Error: invalid character '@' in mnemonic

```

### Steps To Reproduce:

Source code can be found at https://github.com/Usbac/quich, I added -pie to the
CFLAGS to make sure that the binary is compiled as position independent code
(PIE). Adding or removing the -g flags does not change anything.
### Environment:

OS: 5.14.21-2-MANJARO x86_64 GNU/Linux
GCC: gcc (GCC) 11.2.0
retrowrite at commit: 117dad525114bca695317e14affffd4e3de13cce

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.