Skip to content

Instantly share code, notes, and snippets.

@pedro-javierf
Last active August 24, 2016 21:30
Show Gist options
  • Save pedro-javierf/7d4edc033ab07c832777e4a37fa2b287 to your computer and use it in GitHub Desktop.
Save pedro-javierf/7d4edc033ab07c832777e4a37fa2b287 to your computer and use it in GitHub Desktop.
Memory pattern searcher test
//Should work using only C pointers
#define PATTERNBYTE1 0xAA
#define PATTERNBYTE2 0xBB
#define PATTERNBYTEC 0xCC
int main(void)
{
char *pointer=(char*)0x20000000; //Framebuffer address is over this address
char *Address_of_thing_were_searching_for = 0;// 0 = NULL
int i = 0;
while(1==1)
{
//Hmm.. is this better now?
if(pointer[i]==PATTERNBYTE1 && pointer[i+1]==PATTERNBYTE2 && pointer[i+2]==PATTERNBYTE3 )
{
Address_of_thing_were_searching_for = &pointer[i];
break;
}
i++;
}
/*Try write the framebfufers..*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment