Skip to content

Instantly share code, notes, and snippets.

@JackMc
Created May 23, 2022 23:56
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save JackMc/095a5c6c83ae24d6225615eff9cda009 to your computer and use it in GitHub Desktop.
#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