(size, address, count, to_string=False, repeat=False)
return lines
Traditionally, windbg will display 16 bytes of data per line.
Traditionally, windbg will display 16 bytes of data per line.
Traditionally windbg will display 16 bytes of data per line .
def dX(size, address, count, to_string=False, repeat=False):
    """
    Traditionally, windbg will display 16 bytes of data per line.
    """
    values = []

    if repeat:
        count = dX.last_count
        address = dX.last_address
    else:
        address = int(address) & pwndbg.arch.ptrmask
        count = int(count)

    type   = get_type(size)

    for i in range(count):
        try:
            gval = pwndbg.memory.poi(type, address + i * size)
            # print(str(gval))
            values.append(int(gval))
        except gdb.MemoryError:
            break

    if not values:
        print('Could not access the provided address')
        return

    n_rows = int(math.ceil(count * size / float(16)))
    row_sz = int(16 / size)
    rows   = [values[i*row_sz:(i+1)*row_sz] for i in range(n_rows)]
    lines  = []

    # sys.stdout.write(repr(rows) + '\n')

    for i, row in enumerate(rows):
        if not row:
            continue
        line = [enhex(pwndbg.arch.ptrsize, address + (i*16)),'   ']
        for value in row:
            line.append(enhex(size, value))
        lines.append(' '.join(line))

    if not to_string:
        print('\n'.join(lines))

    dX.last_count = count
    dX.last_address = address + len(rows)*16

    return lines
def dX ( size , address , count , to_string = False , repeat = False ) : values = [ ] if repeat : count = dX . last_count address = dX . last_address else : address = int ( address ) & pwndbg . arch . ptrmask count = int ( count ) type = get_type ( size ) for i in range ( count ) : try : gval = pwndbg . memory . poi ( type , address + i * size ) # print(str(gval)) values . append ( int ( gval ) ) except gdb . MemoryError : break if not values : print ( 'Could not access the provided address' ) return n_rows = int ( math . ceil ( count * size / float ( 16 ) ) ) row_sz = int ( 16 / size ) rows = [ values [ i * row_sz : ( i + 1 ) * row_sz ] for i in range ( n_rows ) ] lines = [ ] # sys.stdout.write(repr(rows) + '\n') for i , row in enumerate ( rows ) : if not row : continue line = [ enhex ( pwndbg . arch . ptrsize , address + ( i * 16 ) ) , '   ' ] for value in row : line . append ( enhex ( size , value ) ) lines . append ( ' ' . join ( line ) ) if not to_string : print ( '\n' . join ( lines ) ) dX . last_count = count dX . last_address = address + len ( rows ) * 16 return lines