Skip to content

Instantly share code, notes, and snippets.

@Cee
Created July 30, 2014 16:28
Show Gist options
  • Save Cee/822ecb72b74a73eaf067 to your computer and use it in GitHub Desktop.
Save Cee/822ecb72b74a73eaf067 to your computer and use it in GitHub Desktop.
Getbuf
unsigned long long getbuf() {
char buf[36];
volatile char* variable_length;
int i;
unsigned long long val = (unsigned long long)Gets(buf);
variable_length = alloca((val % 40) < 36 ? 36 : val % 40);
for(i = 0; i < 36; i++) {
variable_length[i] = buf[i];
}
return val % 40;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment