Skip to content

upx packed elf execution fails - Syscall ERROR: ql_syscall_mmap  #1294

@idanr1986

Description

@idanr1986

*Describe the bug
when executing a packed elf file using upx I get the following error
[+] mmap - mapping needed for 0x400000
[x] Syscall ERROR: ql_syscall_mmap DEBUG: Error: mapping needed but failed
this happens because the requested address is already mapped.

when inspecting the elf execution with strace we can see that this is a normal behavior that is handled by the os.
map(0x7f52b079d000, 147456, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f52b079d000
mmap(0x7f52b079d000, 13352, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f52b079d000

Sample Code
cp /bin/ls ./rootfs/x8664_linux/bin/
upx ./rootfs/x8664_linux/bin/ls

ql = Qiling(["./rootfs/x8664_linux/bin/ls"], "./rootfs/x8664_linux", QL_VERBOSE.DEBUG)
ql.run()

Expected behavior
the ability to execute upx packed binaries in qiling, which is very imported for malware analysis

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions