qilingframework / qilingframework/qiling

Problem syscall_mmap_impl

Open
#1,444 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
6.1k
Forks
798
Avg merge
1d 1h
Merged PRs (30d)
9

Description

*Describe the bug
I wanted to try to run an Android shellcode with Qiling, but during execution I get the following error

Sample Code

shellcode = open("./t.sc", "rb").read()
    rootfs = "examples/rootfs/arm64_android6.0"
    ostype = "android"
    archtype = "arm64"
    output = "default"

    ql = Qiling(
        code=shellcode,
        rootfs=rootfs,
        archtype=QL_ARCH.ARM64, ostype=QL_OS.LINUX, verbose=QL_VERBOSE.DEBUG
    )

Error:

[+] 	Profile: default
[+] 	Received interrupt: 0x2
[x] 	Syscall ERROR: ql_syscall_mmap DEBUG: 'QlLoaderELF' object has no attribute 'mmap_address'
Traceback (most recent call last):
  File "qiling/qiling/os/posix/posix.py", line 213, in load_syscall
    retval = syscall_hook(self.ql, *params)
  File "qiling/qiling/os/posix/syscall/mman.py", line 220, in ql_syscall_mmap
    return syscall_mmap_impl(ql, addr, length, prot, flags, fd, pgoffset, 1)
  File "qiling/qiling/os/posix/syscall/mman.py", line 137, in syscall_mmap_impl
    addr = ql.mem.find_free_space(mapping_size, max(addr, ql.loader.mmap_address))
AttributeError: 'QlLoaderELF' object has no attribute 'mmap_address'

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Android ARM64 shellcode example, then inspect qiling/os/posix/syscall/mman.py at syscall_mmap_impl and the QlLoaderELF mmap_address access shown in the traceback. Done means the sample no longer raises this AttributeError during ql_syscall_mmap execution.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
operating-systems, reverse-engineering
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.