Skip to content

pwnlib.fmtstr - impossible overlapping byte writes #2499

Closed as not planned
Closed as not planned
@George-TL

Description

I'm reading documentation and there is something odd...

pwn.context.clear(arch = 'i386')
writes = { 0x0: 0xaa, 0x4: 0xbb }
print(pwn.fmtstr_payload(1, writes, write_size='byte'))
writes = { 0x0: 0xaa, 0x3: 0xbb }
print(pwn.fmtstr_payload(1, writes, write_size='byte'))

first one works fine, second crashes with:
ValueError: normalize_writes(): data at offset 3 overlaps with previous data which ends at offset 4

Same for 64 bit:

pwn.context.clear(arch = 'amd64')
writes = { 0x0: 0xaa, 0x8: 0xbb }
print(pwn.fmtstr_payload(1, writes, write_size='byte'))
writes = { 0x0: 0xaa, 0x7: 0xbb }
print(pwn.fmtstr_payload(1, writes, write_size='byte'))

first one works fine, second crashes with:
ValueError: normalize_writes(): data at offset 7 overlaps with previous data which ends at offset 8

Yes, I'm doing byte writes.
There should be no overlapping of any kind.
Please, update documentation with examples how to achieve such writes.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions