fgets(v5, 28, stdin), which means the length that the program checks is 27 byte
Loop if A[i] ^ v5[i] != B[i] => fail
Therefore the correct input is v5[i] = A[i] ^ B[i], with v5 is user input
Then in the pseudo code we can see that off_4034C8 points to array A, and off_4034B0 points to array B. So to extract the key, I used an LD=PRELOAD hook that overrides fgets, dereferences off_4034C8 and off_4034B0, computes A ^ B , writes it into the input buffer, and prints the 27-byte result.