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

Feature survey: are convenient funtions like uall, ptr_mangle, ptr_demangle needed? #2447

Open
RocketMaDev opened this issue Aug 14, 2024 · 6 comments
Labels

Comments

@RocketMaDev
Copy link

While tackling chanllenges, I find that some useful funtions like unpack 6 bytes of recv, processing pointers xored with fs:[0x30] not implemented yet. Could anyone tell me if these funtions are need to be implemented in pwntools? Plz let me know and I would like to include them in a new PR once I finished my first PR #2442.

@Arusekk
Copy link
Member

Arusekk commented Aug 19, 2024

I would love u48/p48, as well as ptr_mangle from glibc 2.4+ (I would love to get architecture-aware behaviour there), and maybe some ptr_mangle_cookie that would return the cookie suitable for ptr_(de)mangle, given actual pointer and mangled value.

@RocketMaDev
Copy link
Author

I would love u48/p48...

But when recving heap address, another u40 is needed for glibc 2.32+, why don't we just create uall? @Arusekk

@Arusekk
Copy link
Member

Arusekk commented Aug 19, 2024

You cannot reliably uall on a tube, recv has to know the correct length or it can return patrial or extra data anyway. But unpack_all would be a better name than uall I guess.

@RocketMaDev
Copy link
Author

Let me do some explanation. uall takes bytes object and convert it into int, not a tube. In other word, uall == unpack(word_size='all'), instead of unpack(recv(), 'all'). And uall is shorter and easy to type out just like u64. unpack_all is a bit too long.

@Arusekk
Copy link
Member

Arusekk commented Aug 22, 2024

I meant tube.u64() which expands to u64(tube.recvn(8)) and friends. I would still prefer both unpack_all and u48 (u40 can go there as well). Feel free to submit a PR with either combination.

@RocketMaDev
Copy link
Author

I see. If we add u48 and u40, there will be less situations to call unpack_all. In that case, it doesn't matter if unpack_all is that long.

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

No branches or pull requests

2 participants