For this particular challenge, participants were given an x64 binary asking for a valid serial number.

If the serial number is wrong, they should see the image below.

This seems like those traditional crackmes. Let’s try to find the function that is checking users’ input. In order to find it, we should always look for suspicious strings if applicable.

Using Hopper, we found the following strings as indicated in the image below.

So let’s pick one of the “strings” and see where it was referenced.

Ok, let’s try and see whether we can find any GetDlgItemText/GetDlgItemTextW API calls. Ok, it seems like we got one at 140001464.

If we step debug it and follow the flow, we will come across a string length check at 1400014b3. Now we know that the input string must be 32 characters in length.

Stepping through again, at 140001500 we will encounter a check to ensure that the input characters must be 1, 2 or 3. This makes sure that the serial for this challenge is only comprised of 1, 2 and 3.

If we were to analyze the application at 140001750, we can see that there is an array with an initial capacity of [0, 13, 7]. However the maximum capacity of the “jugs” is [19, 13, 7] and the expected end state is having the array be [10, 10, 0]. You basically have three “jugs” with a size of 7, 13 and 19. The 7 and 13 size “jugs” are filled and the container with size 19 is empty. What you need is 10 in two of the containers (13 and 19).

Let’s re-write it in pseudo codes. Let’s assume that 3 “jugs” are under the array, M and the 3 jugs are a,b and c.

for (int i = 0; i < szSerial.Length; i += 2){
    a = convert_it_to_int(Substring_of_szSerial(i, 1));
    b = convert_it_to_int (Substring_of_szSerial (i + 1, 1));
    if (a != b){
        switch (b){
            case 1:
                c = 19;
            case 2:
                c = 13;
            case 3:
                c = 7;
        if ((M[b] + M[a]) > c){
            M[a] += M[b] - c;
            L[b] = c;
            M[b] += L[a];
            M[a] = 0;

At first it may seem to be very confusing what is actually going on here. But let’s take a closer look.

This is the limit of the mugs.

Limit: 19    13    7
             A     B     C
Jug:	1  | 2   | 3
Water:	0  | 13 | 7

If [B] +[A] > Limit-of-[A]
    Fill [B] and put the remaining in [A]
    Fill [B] and clear [A]

Now in the serial, if we were to start with 31, it simply means to fill up jug C to jug A.

So the aim of this is to move around the “beer” so jug A == 10 and jug B == 10.

We would have realized that this is the classic “Liquid Pouring Puzzle” that some, if not most of us, have seen while we were in school.

You can write your tool based on the findings. But if we were to do it with pen and paper. We should get something like the one below.


Rewriting this to serial code: 31211332133221321332133221321332

Using that as the serial, we will solve it and get this message back.