Skip to content

Instantly share code, notes, and snippets.

@pressure679
Created July 11, 2017 19:39
Show Gist options
  • Save pressure679/3829624e6af3485eb82cf425618a4149 to your computer and use it in GitHub Desktop.
Save pressure679/3829624e6af3485eb82cf425618a4149 to your computer and use it in GitHub Desktop.
Memory fetcher
#include <stdlib.h>
#include <stdio.h>
int main() {
unsigned char *pointer = (unsigned char *) malloc(0);
unsigned int i;
unsigned int hex;
unsigned int start = (unsigned int) pointer + 0x14c0;
for (; (unsigned int)pointer < start; pointer += 0x20) {
printf("0x%p\n", pointer);
for (i = 1; i <= 0x20; i++) {
hex = *(pointer + i - 1);
printf(hex < 0x20 ? "0%x" : "%2x", hex);
if (i % 4 == 0) printf(" ");
}
printf("|");
for (i = 0; i < 0x20; i++) {
printf("%s", (pointer + i));
}
printf("Wn\n\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment