Posted on by and filed under HITCON CTF 2016.

This was my first encounter with Power PC, so this challenge was definitely fun learning experience for me. Here is my best attempt at the decompiled source code.
                        
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int global_values[] = {0xCFE,0x859,0x95D,0x871,0x40D,6,0xADE,0xFA8,0x561,0x9DA, \
    0x878,0x682,0xFA9,0xF5F,0x25E,0xDB0,0xFBF,0xBC6,0xD38,0x95D,0xD09,0x7ED,0x307, \
    0x1C0,0x399,0x956,0xA45,0x292,0xC8A,0x92F,0x4A,0x964,0x194,0x9DA,0x11F};
int main(){
    char input[35];
    int *checked_against = global_values;
    int i;
    //print welcome string
    scanf("%s",input);
    if(strlen(input) == 35){
        srand(7777);
        for(i = 0; i < 35;  i++){
            int random = rand();
            char y = input[i]^clrlwi(random);
            input[i]= y;
        } 
        for(i=0; i< 35; i++){
            if(input[i] != checked_against[i]){
                goto FAIL;
            }
        }
        printf("Good job!! now you can submit your flag :)");
        return 0;
    }
FAIL:
    printf("Your flag is incorrect :(");
    return 0;
}
                        
                    
There is a global array containing values that are checked against user input.

View the rest of this post here.