Skip to content

Add support for qXfer:libraries:read#181

Closed
mrexodia wants to merge 3 commits intodaniel5151:masterfrom
mrexodia:libraries-win-support
Closed

Add support for qXfer:libraries:read#181
mrexodia wants to merge 3 commits intodaniel5151:masterfrom
mrexodia:libraries-win-support

Conversation

@mrexodia
Copy link
Contributor

Description

Adds support for qXfer:libraries:read which is used by IDA Pro for Windows targets to read the module list. Draft for integrating gdbstub into https://github.com/sha0coder/mwemu for debugging malware in IDA Pro.

API Stability

  • This PR does not require a breaking API change

Checklist

  • Documentation
    • Ensured any public-facing rustdoc formatting looks good (via cargo doc)
    • (if appropriate) Added feature to "Debugging Features" in README.md
  • Validation
    • Included output of running examples/armv4t with RUST_LOG=trace + any relevant GDB output under the "Validation" section below
    • Included output of running ./example_no_std/check_size.sh before/after changes under the "Validation" section below
  • If implementing a new protocol extension IDET
    • Included a basic sample implementation in examples/armv4t
    • IDET can be optimized out (confirmed via ./example_no_std/check_size.sh)
    • OR implementation requires introducing non-optional binary bloat (please elaborate under "Description")
  • If upstreaming an Arch implementation
    • I have tested this code in my project, and to the best of my knowledge, it is working as intended.

Validation

GDB output
!!!!! EXAMPLE OUTPUT !!!!!

(gdb) info mem
Using memory regions provided by the target.
Num Enb Low Addr   High Addr  Attrs
0   y  	0x00000000 0x100000000 rw nocache
armv4t output
!!!!! EXAMPLE OUTPUT !!!!!
<TODO>

@daniel5151
Copy link
Owner

I'll have page in context behind that PR... but based on a quick skim, it seems like we should be able to land #170 as is (i.e: without blocking it on needing the Exec stop reason). I can prioritize doing that sometime before the end of this weekend.

Once that's done, you'll want to rebase this diff, as I wouldn't want to mix-and-match these two features in a single commit.

@daniel5151
Copy link
Owner

(also, I know this is still a draft, but please make sure to add this new IDET to the armv4t example in-tree)

@mrexodia mrexodia force-pushed the libraries-win-support branch from 006ebcb to 51a1aba Compare January 23, 2026 12:45
@mrexodia mrexodia force-pushed the libraries-win-support branch from 51a1aba to 763e9d6 Compare January 23, 2026 12:51
@mrexodia
Copy link
Contributor Author

I think I got things working now, but unfortunately it requires 3 independent changes to work. So far I have them committed in this branch, but I guess you prefer to have them separate @daniel5151? Also #170 overlaps, but has (I think) a bug in the library stop reason response.

@daniel5151
Copy link
Owner

@mrexodia looks like the 3 changes you're proposing are:

  1. adding some new stop reasons (overlapping with Support more stop reasons #170)
  2. tweaking the RLE behavior
  3. adding support for qXfer:libraries:read

For testing, you may want to maintain a branch on your fork with all 3 changes stacked on-top of eachother, but to make tracking and reviewing change easier, I'd ask that each bugfix / feature is its own diff.

I don't think @bet4it will mind if I commandeer #170 and drive it over the finish line with that bugfix you pointed out (I agree that it should be library:; as opposed to library;). And you can feel free to send in PRs for the other two things (which we can discuss more on those individual diffs).

Once 1 and 2 land in master, you can rebase this PR (so it'll just focus on qXfer:libraries:read functionality)

@mrexodia mrexodia closed this Jan 23, 2026
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.

2 participants