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

instead of printing Addr: ... for a heap chunk print Chunk: ... Alloc… #2115

Closed
wants to merge 2 commits into from

Conversation

dmur1
Copy link
Contributor

@dmur1 dmur1 commented Apr 13, 2024

@dmur1 dmur1 marked this pull request as draft April 13, 2024 10:59
@dmur1
Copy link
Contributor Author

dmur1 commented Apr 14, 2024

image

image

does anyone understand what's happening here? i really don't see how +16 is producing this value?

@dmur1 dmur1 marked this pull request as ready for review April 14, 2024 15:54
@dmur1
Copy link
Contributor Author

dmur1 commented Apr 14, 2024

i will defer to others as to whether a) this is a good idea b) its a good way to do it - i was just implemented the discussed change

@CptGibbon
Copy link
Collaborator

I get an uneasy feeling this will only work for 64 bit architecture because of that hardcoded +16

@disconnect3d
Copy link
Member

I get an uneasy feeling this will only work for 64 bit architecture because of that hardcoded +16

+1. Also: don't we somehow support/know what's the metadata/allocated buffer offset within the heap functionality?

Can't we reuse it here?

@CptGibbon
Copy link
Collaborator

don't we somehow support/know what's the metadata/allocated buffer offset within the heap functionality?
Can't we reuse it here?

pwndbg doesn't support that right now, though it's on my todo list.
Believe it or not malloc_chunk structs don't have a user data member, it's found using GLIBC's chunk2mem macro.

@disconnect3d
Copy link
Member

@CptGibbon What should we do here? Can we just merge it and fix it in the future if it ever breaks?

Shall we maybe do +2*ptrsize instead of +16?

@CptGibbon
Copy link
Collaborator

@CptGibbon What should we do here? Can we just merge it and fix it in the future if it ever breaks?

Shall we maybe do +2*ptrsize instead of +16?

Definitely use the pointer size math in place of a hardcoded number, I'm surprised that doesn't fail tests but I guess there aren't enough 32 bit malloc tests.

I don't understand the change from "address" to "chunk" or what "alloc" is supposed to mean but yeah it's probably harmless 🤷‍♂️

@disconnect3d
Copy link
Member

I spoke with @dmur1 and let's just drop this for now. I don't think this feature is super needed, unless more people ask for that.

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

Successfully merging this pull request may close these issues.

None yet

3 participants