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

Hacer que mem_hexdump solo imprima los bytes leídos #190

Open
RaniAgus opened this issue Nov 13, 2024 · 0 comments
Open

Hacer que mem_hexdump solo imprima los bytes leídos #190

RaniAgus opened this issue Nov 13, 2024 · 0 comments

Comments

@RaniAgus
Copy link
Contributor

RaniAgus commented Nov 13, 2024

En este ejemplo:

#include <commons/memory.h>

int main() {
    int numero = 16;
    int *puntero = 0x10;
    mem_hexdump(&numero, sizeof(numero));
    mem_hexdump(&puntero, sizeof(puntero));
    return 0;
}

mem_hexdump() me imprime los primeros 16 bytes indistintamente de si el parámetro que le pase tiene 16 bytes, rellenando con ceros el espacio restante:

0x00000000: 10 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

0x00000000: 10 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

Sería más didáctico si solo imprimiera los bytes que esperaría que imprima, ejemplo:

0x00000000: 10 00 00 00                                       |....|

0x00000000: 10 00 00 00 00 00 00 00                           |........|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant