qilingframework / qilingframework/qiling

asus-ac5300 firmware Invalid instruction (UC_ERR_INSN_INVALID), arm little endian

Open
#1,142 1 comment 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
When emulate asus-ac5300 firmware, Invalid instruction (UC_ERR_INSN_INVALID) occured,
firmware download link:
http://ftp.ufanet.ru/pub/firmware/Asus/RT-AC5300/RT-AC5300_3.0.0.4_380_7266-g6439257.trx

Sample Code

PROJECT_ROOT="/opt/firmwares/asus"
ql = Qiling([PROJECT_ROOT + "/usr/sbin/httpd"], PROJECT_ROOT, console=True, verbose=QL_VERBOSE.DEBUG)
ql.run()

Error
File "/home/test/PycharmProjects/Py3.8Emu/venv/lib/python3.8/site-packages/qiling/core.py", line 879, in emu_start
self.uc.emu_start(begin, end, timeout, count)
File "/home/test/PycharmProjects/Py3.8Emu/venv/lib/python3.8/site-packages/unicorn/unicorn.py", line 465, in emu_start
raise UcError(status)
unicorn.unicorn.UcError: Invalid instruction (UC_ERR_INSN_INVALID)

Additional context
file command output:
ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped

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

Start with the sample that launches /usr/sbin/httpd from the ASUS firmware and reproduce the failure. Trace the emulation path to qiling/core.py:879 and inspect the ARM little-endian setup and instruction that triggers UC_ERR_INSN_INVALID. Done means the sample emulates this firmware without the reported invalid-instruction error, with the cause and verification documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
reverse-engineering
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.