Skip to content

Missing x86 mnemonics #6236

@MrQuantum1915

Description

@MrQuantum1915

Work environment

Questions Answers
OS/arch/bits (mandatory) Arch Linux x86_64
File format of the file you reverse (mandatory) N.A
Architecture/bits of the file (mandatory) x86 16bit
rizin -v full output, not truncated (mandatory) rizin 0.9.0 @ linux-x86-64 commit: 3bbf3b3

Expected behavior

POPA and PUSHA should be properly analysed and there type be set properly.

Actual behavior

Currently the type is set to null. The reason is currently there are missing mnemonics of x86 16 bit in x86_mnemonics.h.
For example POPA/PUSHA which are 16bit equivalent of 32 bit POPAD/PUSHAD are absent from mnemonics header and also the analysis_x86_zydis.c does not have any handling of them.

You can also see there is no ESIL information set about this instructions which points to missing analysis of this instructions.

Steps to reproduce the behavior

You can see the type field is set to null

rizin malloc://32
[0x00000000]> e asm.arch=x86
[0x00000000]> e asm.bits=16
[0000:0000]> wa "popa;pusha"
[0000:0000]> ao
address: 0x0
opcode: popa
disasm: popa
pseudo: popa 
mnemonic: popa
description: pop all general-purpose registers
mask: ff
prefix: 0
id: 610
bytes: 61
refptr: 0
size: 1
sign: false
type: null
cycles: 1
rzil: empty
opex:
  operands: []
family: cpu
[0000:0000]> s 1
[0000:0001]> ao
address: 0x1
opcode: pusha
disasm: pusha
pseudo: pusha 
mnemonic: pusha
description: push all general-purpose registers
mask: ff
prefix: 0
id: 666
bytes: 60
refptr: 0
size: 1
sign: false
type: null
cycles: 1
rzil: empty
opex:
  operands: []
family: cpu

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions