This file contains 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 <stdint.h> | |
#include <stdbool.h> | |
int main() { | |
uint32_t input_bytes[4]; | |
uint32_t x_pos = 0, y_pos = 0; | |
bool values_match_rules = false; | |
for (x_pos = 0; x_pos < 255; x_pos++) { | |
if ((x_pos & 0x80) == 0) { | |
continue; | |
} | |
if ((x_pos & 0x20) == 0) { | |
continue; | |
} | |
if ((x_pos & 0x40) != 0) { | |
continue; | |
} | |
if ((x_pos & 0x20) == 0) { | |
continue; | |
} | |
if ((x_pos & 0x2) == 0) { | |
continue; | |
} | |
if ((x_pos & 0x1) == 0) { | |
continue; | |
} | |
if ((x_pos & 0x10) != 0) { | |
continue; | |
} | |
if ((x_pos & 0x8) != 0) { | |
continue; | |
} | |
if ((x_pos & 4) == 0) { | |
continue; | |
} | |
for (y_pos = 0; y_pos < 255; y_pos++) { | |
if ((y_pos & 0x01) != 0) { | |
continue; | |
} | |
if ((y_pos & 0x80) != 0) { | |
continue; | |
} | |
if ((y_pos & 0x40) == 0) { | |
continue; | |
} | |
if ((y_pos & 0x20) != 0) { | |
continue; | |
} | |
if ((y_pos & 0x4) == 0) { | |
continue; | |
} | |
if ((y_pos & 0x2) == 0) { | |
continue; | |
} | |
if ((y_pos & 0x10) != 0) { | |
continue; | |
} | |
if ((y_pos & 0x8) == 0) { | |
continue; | |
} | |
values_match_rules = true; | |
break; | |
} | |
if (values_match_rules) { | |
break; | |
} | |
} | |
printf("%x %x\n", x_pos, y_pos); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment