CTF/gits2012teaser/2-ALsRevenge

Question
Use your team GUID and generate a serial. ([[Media:49dd327824d5afe9cdf931ea4b13719f.bin|File]]) Hint: [[Media:17b82879c583eeae763ecfa9a135e431.cpp|File]]

Solution

 * file [[Media:49dd327824d5afe9cdf931ea4b13719f.bin|49dd327824d5afe9cdf931ea4b13719f.bin]] says xz compressed file -> xzcat > f
 * file f says LLVM bitcode -> llvm-dis > f.s (only works with LLVM 2.8, not with 3.0)
 * analyze disassembly, extract C representation:


 * it looks like a multiplication over a galois field, with the irreducible polynomial 0x1a348fccd93aea5a7 (note leading bit not in C), but it actually isn't, because the high bit gets checked after the shift, not before.
 * lacking math knowledge and math package fu, decided to treat the problem as a linear equation system:
 * The shifting and xoring produces a set of integers, call them name_i. If the serial bit s_i is set, name_i gets added to the result.  So you can roughly say r = N * s, with r being the result vector, s the serial vector and N the names matrix.
 * lacking math package fu, implement a gaussian elimination manually: