Byte Babies

SwampCTF 2025: You Shall Not Passsss

Mar 31, 2025 - yoshixi - writeup, rev

author: @yoshixi

Challenge Info:

Category: Rev

Challenge Resources

youshalnotpass Download

Solution

We first decompile with binary ninja

In the main function, We allocate 3 pointers and 1 variable, change a variable until its non-zero, do a lot more assignments to variables from constants loaded within memory, and perform a hashing function for each of them (there are like 20 of thes variables). Another loop of a pointer, and then we run the 2nd function libcmain 3alloca nonzero lastassgn The second function is a lot more interesting. It constructs a list, with the first element as a function. Then, it calls that function. 2ndfunc

Debugging

So, the function data is dynamicaly loaded. We debug to see whats going on.

def find_a(b_hex, c_hex):
  b_int = int(b_hex, 16)  # Convert b from hex to integer
  c_int = int(c_hex, 16)  # Convert c from hex to integer
  a_int = c_int ^ b_int  # Perform the XOR operation
  a_hex = hex(a_int)  # Convert a back to hexadecimal
  return a_hex

b_decimal = int(input('b_decimal: '))
b_hex = hex(b_decimal & 0xFF) #ensure 8 bit representation.
c_hex = input("c_hex: ")

result_hex = int(find_a(b_hex, c_hex), 16)
print(f"a = {result_hex}, chr(a) = {chr(result_hex)}")

Kept on running the script until i got the flag.

Flag is : swampCTF{531F_L0AD1NG_T0TALLY_RUL3Z}