Replace pwnlib.asm.asm with pwndbg.lib.zig.asm#3207
Merged
disconnect3d merged 9 commits intopwndbg:devfrom Aug 8, 2025
Merged
Conversation
Contributor
|
I think at this point we can remove this comment from pyproject.toml |
Member
Author
|
PR fixed |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR replaces pwnlib.asm.asm with a new pwndbg.lib.zig.asm implementation to handle assembly compilation using Zig as the backend. The change removes the dependency on pwntools' assembly functionality and introduces a custom Zig-based assembler with support for multiple architectures.
- Replaces all
pwnlib.asm.asmcalls withpwndbg.aglib.asm.asm - Implements a new Zig-based assembly compilation system with comprehensive architecture support
- Adds extensive unit tests for the new assembler functionality
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
pwndbg/lib/zig.py |
Implements the core Zig-based assembly compilation functionality with architecture mappings |
pwndbg/aglib/asm.py |
Provides the public API wrapper for the Zig assembler with pwntools compatibility |
tests/unit_tests/test_zig_asm.py |
Comprehensive test suite validating assembly compilation across multiple architectures |
pwndbg/gdblib/shellcode.py |
Updates import and function call to use new assembler |
pwndbg/commands/search.py |
Removes architecture parameter and uses new assembler API |
pwndbg/commands/msr.py |
Updates import and function calls to use new assembler |
pwndbg/aglib/shellcode.py |
Updates import and function call to use new assembler |
pyproject.toml |
Updates dependency comment for ziglang package |
docs/commands/memory/search.md |
Removes documentation for removed --arch parameter |
.github/workflows/tests.yml |
Adds unit-tests to CI pipeline |
disconnect3d
reviewed
Aug 6, 2025
disconnect3d
reviewed
Aug 6, 2025
| elif type == "asm" or asmbp: | ||
| bits_for_arch = pwnlib.context.context.architectures.get(arch, {}).get("bits") | ||
| value = pwnlib.asm.asm(value, arch=arch, bits=bits_for_arch) | ||
| value = pwndbg.aglib.asm.asm(value) |
Member
There was a problem hiding this comment.
With the previous code we allowed for search cross-arch instructions... but idk if that feature was used by anyone
disconnect3d
reviewed
Aug 6, 2025
disconnect3d
reviewed
Aug 6, 2025
disconnect3d
reviewed
Aug 6, 2025
Member
Author
|
fixed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before:

After:
