Skip to content

Instantly share code, notes, and snippets.

@tyrion
Created March 16, 2015 23:01
Show Gist options
  • Save tyrion/17911228ccaecd1a3128 to your computer and use it in GitHub Desktop.
Save tyrion/17911228ccaecd1a3128 to your computer and use it in GitHub Desktop.
shambles MIPS
// dati smerdati input = smerdo
void sub4(int i, int smerdo) {
int *deadboob = 0xaddress;
bool v0 = 0;
i *= 4;
int t0 = deadboob[i];
int t2;
for (int j = 0; j != 32; ++j) {
t2 = smerdo >> j;
t2 &= 1;
if (t2 != 0) {
t2 = t0 >> t3;
t2 &= 1;
v0 ^= t2;
v0 &= 1;
}
}
t0 = deadboob[i] / 2;
t0 *= -v0;
deadboob[i] = t0;
}
int *input_utente;
*inizio_char_strani
void main() {
write(input_utente, 0, 32)
check_length(32);
swap_input(); // smerda l'input usando i char strani. è un for
for (j = 0; j < 32; j++) {
for (i = 0; i < 8: ++i) {
encrypt_word(i, input_utente[i * 4])
}
swap_encrypted_words();
}
check_encrypted()
}
a0 = s0, a1 = dati smerdata input
bool subb4(int a0, int a1) {
char *s2 = 0xdeadb00b; // s2
a0 *= 4;
s2 += a0;
int t0 = s2[0];
int t3=0;
bool v0=0;
do {
int t2 = a1 >> t3;
t2 &= 1;
if (t2 == 0) {
} else {
t2 = t0 >> t3;
t2 &= 1; // 0 or 1
v0 ^= t2;
v0 &= 1;
}
t3 += 1;
t5 = t3 - 32;
} while (t5 != 0);
t0 = *s2;
t0 >> 1; // useless
v0 << 31;
t0 |= v0; // useless
*s2 = t0;
return v0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment