Created
June 26, 2019 09:07
-
-
Save extremecoders-re/d0a6f9a8697e530172e65844dead5bb4 to your computer and use it in GitHub Desktop.
IDC Script to do hexdump
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
// | |
// IDC Script to do hexdump | |
// | |
auto i; | |
auto addr = get_inf_attr(INF_MIN_EA); | |
auto max_addr = get_inf_attr(INF_MAX_EA); | |
auto ofile = fopen("hexdump.txt", "w"); | |
auto b; | |
for (addr=0; addr<max_addr; addr=addr+16) | |
{ | |
fprintf(ofile, "%08X ", addr); | |
for (i=addr; i < addr+16; i++) | |
{ | |
if (is_loaded(i) == 1) | |
{ | |
b = byte(i); | |
fprintf(ofile, "%02X ", byte(i)); | |
} | |
else | |
fprintf(ofile, "?? ", byte(i)); | |
} | |
fprintf(ofile, " "); | |
for (i=addr; i < addr+16; i++) | |
{ | |
if (is_loaded(i) == 1) | |
{ | |
b = byte(i); | |
if (b >= 32 && b < 127) | |
fprintf(ofile, "%c", b); | |
else | |
fprintf(ofile, "."); | |
} | |
else | |
fprintf(ofile, "?"); | |
} | |
fprintf(ofile, "\n"); | |
} | |
fclose(ofile); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment