Skip to content

Instantly share code, notes, and snippets.

@KaoRz
Created November 10, 2018 19:19
Show Gist options
  • Save KaoRz/89b371a49abd043fd546331eadc6438a to your computer and use it in GitHub Desktop.
Save KaoRz/89b371a49abd043fd546331eadc6438a to your computer and use it in GitHub Desktop.
Write-up: Basic conditional decision - CTF HoneyCON 2018 (Reversing challenge)
#include <stdio.h>
void main() {
char x[] = {0x68, 0x6F, 0x6F, 0x65, 0x79, 0x5F, 0x63, 0x6F, 0x6F};
char y[] = {0x0B, 0X00, 0x00, 0x09, 0x03, 0x00, 0x1B, 0x00, 0x1D};
char z[10];
int i;
char word, test;
for(i = 0; i < 9; i++) {
for(word = 0x01; word < 0xFF; word++) {
test = x[i] ^ word;
if(test == y[i]) {
z[i] = word;
break;
}
}
}
z[9] = '\0';
printf("FLAG --> %s\n", z);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment