Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JMP32 class to disassembler #451

Merged
merged 1 commit into from
May 7, 2024

Conversation

Alan-Jowett
Copy link
Collaborator

This pull request primarily focuses on enhancing the ubpf/disassembler.py script with support for 32-bit jumps in the eBPF bytecode disassembly process. The changes include the addition of a new opcode and class for 32-bit jumps, and an update to the disassemble_one function to handle the new opcode and class.

Here are the key changes:

  • ubpf/disassembler.py: Added a new opcode jmp32 to the JMP_OPCODES dictionary, which maps opcodes to their string names.
  • ubpf/disassembler.py: Introduced a new class BPF_CLASS_JMP32 with a value of 6, representing the class for 32-bit jumps.
  • ubpf/disassembler.py: Updated the disassemble_one function to handle the new BPF_CLASS_JMP32 class. It now checks if the class is BPF_CLASS_JMP32 and if so, it retrieves the opcode name and appends "32" to it, indicating a 32-bit jump. The function then proceeds to disassemble the bytecode instruction accordingly.

Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
@Alan-Jowett Alan-Jowett merged commit a2f230d into iovisor:main May 7, 2024
1 check passed
@coveralls
Copy link

Coverage Status

coverage: 81.235%. remained the same
when pulling 36f1517 on Alan-Jowett:update_unassembler
into 5d4d78d on iovisor:main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants