Skip to content

Instantly share code, notes, and snippets.

@hak8or
Created March 14, 2015 22:35
Show Gist options
  • Select an option

  • Save hak8or/64a1a0b0dfed58b7ebb1 to your computer and use it in GitHub Desktop.

Select an option

Save hak8or/64a1a0b0dfed58b7ebb1 to your computer and use it in GitHub Desktop.
asdasda
void find_none_zeroed_memory(unsigned char volatile * const base, unsigned char volatile * const top){
unsigned char volatile *offset = base;
dbg_info("Looking for modified memory. \n");
while (offset < top) {
// Do some magic because this and my desktops endian'ness are opposits.
volatile char num[4] = {*offset, *(offset + 1), *(offset + 2), *(offset + 3)};
long output = num[3] | num[2] << 8 | num[1] << 16 | num[0] << 24;
if (output != 0x00)
dbg_info("Contents at %x : %x \n", offset, output);
offset = offset + 4;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment