Skip to content

Shellcode does not have an entry_point set #1608

@semchapeu

Description

@semchapeu

Describe the bug

Shellcode does not have an entry_point set. This amongst other things prevents the usage of qdb on shellcode. Through experimentation I found that in my example below the shellcode is loaded at 0x11ff000, if set manually qdb works.

Sample Code

from qiling import Qiling
from qiling.const import QL_VERBOSE
from qiling.const import QL_ARCH, QL_OS

X86_LIN = bytes.fromhex('31c050682f2f7368682f62696e89e3505389e1b00bcd80')
ql = Qiling(code=X86_LIN, archtype=QL_ARCH.X86, ostype=QL_OS.LINUX, verbose=QL_VERBOSE.DEBUG)
ql.debugger = "qdb"
assert ql.entry_point == None # entry_point not set
assert not "entry_point" in dir(ql.loader) # entry_point does not exist
ql.loader.entry_point = 0x11ff000 # set entry_point manually
ql.run()

Expected behavior
The entry_point of shellcode should be set automatically

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions