Created
May 19, 2016 07:16
-
-
Save XMPPwocky/ccc990d2b349d798717176041f9e7111 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 <stdio.h> | |
#include <string.h> | |
void main() { | |
const char *code = (const char *)main; | |
int oldcount = -1; | |
while (1) { | |
int count = 0; | |
const char *temp = code; | |
while (temp) { | |
// 0x100 bytes should be enough for anybody. | |
temp = (const char *)memchr(temp, 0xcc, 0x100); | |
if (temp) { | |
count++; temp++; | |
} | |
} | |
if (oldcount != count) { | |
if (oldcount == -1) oldcount = count; | |
else { | |
printf("%d\n", count); | |
break; | |
} | |
} | |
} | |
printf("breakpoint between\n"); | |
printf("these\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment