EOF{wh3r3_ar3_my_po1n+5}file "a (3)"
# Output: ELF 32-bit LSB executable, Intel 80386
strings "a (3)" | grep -i "flag\|eof"
# Found hint: "strings lol.. zsteg the file bro"
Observation: The binary is a 32-bit executable with a misleading hint about zsteg (which is for images).
Using a disassembler (Ghidra/IDA), key functions identified:
main() - Prompts for a number inputrecursive_fibonacci_mask() - Complex recursive functionprint_flag() - Generates and prints the flagdump() - Helper function (returns 0)Critical Flow:
if (input > 10) {
seed = recursive_fibonacci_mask(input);
print_flag(seed);
}
The print_flag() Function:
void print_flag(unsigned int seed) {
unsigned int data[24] = { /* hardcoded array */ };
srand(seed);
for (int i = 0; i < 24; i++) {
int r = rand();
char c = (r - data[i]) & 0xFF;
printf("%c", c);
}
}
Key Discovery:
The seed value is hardcoded as 0xff10ca3b in the binary's logic!
The Data Array Location:
The data array is stored at virtual address 0x0804a0a0 in the binary:
import struct
with open("a (3)", "rb") as f:
content = f.read()
# Search for the data pattern
target = bytes.fromhex("80033018e240063f")
offset = content.find(target)
print(f"Found at offset: 0x{offset:x}")
# Extract 96 bytes (24 integers)
data = content[offset:offset+96]
values = [struct.unpack('
Extracted Data Array:
unsigned int data[] = {
0x18300380, 0x3f0640e2, 0x47c88dae, 0x4770cb65,
0x70868fee, 0x5887f01e, 0x07b695b3, 0x7e5fe4f7,
0x2b2bcab8, 0x7b1c25a5, 0x6cc1d210, 0x1029aafa,
0x2b07785e, 0x45c80fee, 0x2d96388c, 0x0135865e,
0x4eb1e13d, 0x5182204f, 0x21f78a34, 0x212d3340,
0x40e64e84, 0x1c66c1b7, 0x6712a7ce, 0x4252dd56
};
#include
#include
unsigned int data[] = {
0x18300380, 0x3f0640e2, 0x47c88dae, 0x4770cb65,
0x70868fee, 0x5887f01e, 0x07b695b3, 0x7e5fe4f7,
0x2b2bcab8, 0x7b1c25a5, 0x6cc1d210, 0x1029aafa,
0x2b07785e, 0x45c80fee, 0x2d96388c, 0x0135865e,
0x4eb1e13d, 0x5182204f, 0x21f78a34, 0x212d3340,
0x40e64e84, 0x1c66c1b7, 0x6712a7ce, 0x4252dd56
};
int main() {
unsigned int seed = 0xff10ca3b;
printf("Flag: ");
srand(seed);
for (int i = 0; i < 24; i++) {
int r = rand();
unsigned int val = data[i];
char c = (r - val) & 0xFF;
printf("%c", c);
}
printf("\n");
return 0;
}
Compilation and Execution:
gcc -o solve_final solve_final.c
./solve_final
Output: EOF{wh3r3_ar3_my_po1n+5}
Translation: "where are my points?" - A humorous complaint about CTF scoring! 😄
0xff10ca3b was embedded in the binary's logicrand() function for pseudo-random character generationstrings, hexdump, file - For initial analysis# 1. Disassemble binary to understand logic
# Use Ghidra/IDA to find print_flag() and data array location
# 2. Extract data array
python3 extract_data.py # Extract 24 integers from offset
# 3. Compile and run solver
gcc -o solve solve.c
./solve
# Output: EOF{wh3r3_ar3_my_po1n+5}
This challenge demonstrates the importance of reverse engineering skills, understanding C standard library functions (rand(), srand()), and the ability to extract and analyze binary data structures!