Skip to content

ptrlib 3.0.0 - #49

Merged
ptr-yudai merged 71 commits into
masterfrom
change-to-v3
Sep 27, 2025
Merged

ptrlib 3.0.0#49
ptr-yudai merged 71 commits into
masterfrom
change-to-v3

Conversation

@ptr-yudai

Copy link
Copy Markdown
Owner

Make ptrlib modern again

What's this Pull Request for?

Choose one or more of the following items.

  • Bug fix
  • Add/Remove feature
  • Cleaning code (including optimization/typo fix)
  • Others

Please explain the detail here:

  • Support UDP client and IPv6 support
  • Support TCP/UDP server
  • Support tty/pty in interactive shell
  • Support ARM/MIPS assembler (as well as ROP gadget)
  • Packet logger feature in Tube
  • Extended packer (p64, p32, ...)
  • Extended socket (after, regex, timeout, ...)
  • Better assembler/disassembler
  • Better FSB craft
  • Support for more architecture
  • Better type annotation for VScode
  • Experimental support for debugger (WIP)

What have you done so far?

Tell me what you've tested to assure your change is right.

  • All tests passed on your machine (python -m unittest)
  • Added test cases for new feature
  • Nothing / Test not required

(It's not mandatory to check even one of them, but test cases make it easy for the author to review your PR.)

Comment

All methods have been formatted to comply with type annotations and now throw exceptions when errors occur.
Additionally, functions requiring context, such as architecture-dependent assemblers, now use classes instead of specifying the architecture via arguments.
Several features have undergone fundamental changes in usage to reflect user feedback.

For example, the following functions have been removed or deprecated:

  • flat (Use p64([...]) instead)
  • recvlineafter, sendlineafter, ... (Use after(...).recvline(...) or after(...).sendline(...) instead)
  • assemble (Use CPU class instead)

Some annoying generators such as elf.gadget or elf.search can now be treated as an integer too!

# Traditional notation
g = elf.gadget("pop rdi; ret;")
next(g)
flat([
  next(g),
  next(elf.find("/bin/sh"))
], map=p64);

# New notation also works
p64([
  elf.gadget("pop rdi; ret")[1],
  elf.find("/bin/sh")
])

@ptr-yudai
ptr-yudai merged commit 51a1d79 into master Sep 27, 2025
4 of 16 checks passed
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.

1 participant