#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int n = 5;
int main(int argc, char** argv) {
char* p;
char* q;
p = malloc(1024);
q = malloc(1024);
printf("real size = %d\n",*(((int*)p)-1) & 0xFFFFFFF8);
if(argc >= 2) {
strcpy(p, argv[1]);
}
free(q);
printf("n = 0x%08X\n", n);
free(p);
return EXIT_SUCCESS;
}
I wish I could dump this structure in memory:
I would like to dump this structure in memory:
struct chunk {
int prev_size;
int size;
struct chunk *fd;
struct chunk *bk;
};