Created
July 11, 2017 19:39
-
-
Save pressure679/3829624e6af3485eb82cf425618a4149 to your computer and use it in GitHub Desktop.
Memory fetcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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