Rating:

-compiled binary no header or tables

used r2 to decompile and debug.




[0x01002059]> pdf
/ (fcn) entry0 68
|   entry0 ();
|           0x01002004      58             pop eax
|           0x01002005      3c02           cmp al, 2                   ; 2            CHECKS IF THERE IS A ARGUMENT
|       ,=< 0x01002007      740b           je 0x1002014
|       |   ; CODE XREF from entry0 (0x100205d)
|      .--> 0x01002009      b37f           mov bl, 0x7f                ; 127
|      :|   0x0100200b      31c0           xor eax, eax                               0
|      :|   0x0100200d      40             inc eax                                    1 == exit
|      :|   0x0100200e      cd80           int 0x80                                   syscall
|      :|   0x01002010      0200           add al, byte [eax]
|      :|   0x01002012      0300           add eax, dword [eax]
|      :|   ; CODE XREF from entry0 (0x1002007)
|      :`-> 0x01002014      b420           mov ah, 0x20                ; 32         or space 
|      :,=< 0x01002016      eb16           jmp 0x100202e
..
|      :|   ; CODE XREF from entry0 (0x1002016)
|      :`-> 0x0100202e      31c9           xor ecx, ecx                             ;
|      :    0x01002030      bb00200001     mov ebx, map.home_m42d_Desktop_CTFs_akbar_Native_native.rwx ; 0x1002000
|      :    0x01002035      5e             pop esi                                  ; (path) 
|      :    0x01002036      5e             pop esi                                  ; (arguments)
|      :    0x01002037      eb01           jmp 0x100203a                            ; a NOP is a NOP
|      :    0x0100203a      204b0a         and byte [ebx + 0xa], cl
|      :    ; CODE XREF from entry0 (0x100205b)
|      :.-> 0x0100203d      56             push esi                                 ;  arg pointer back on stack
|      ::   0x0100203e      53             push ebx                                 ;  push pointer to beginning of file on stack
|      ::   0x0100203f      01ce           add esi, ecx                             ; 
|      ::   0x01002041      01cb           add ebx, ecx                             ;  add counter2 to file pointer 
|      ::   0x01002043      31d2           xor edx, edx                             ;
|      ::   0x01002045      30c0           xor al, al                               ;
|      ::   ; CODE XREF from entry0 (0x100204f)
|     .---> 0x01002047      0203           add al, byte [ebx]                  ; add byte that filepointer points to to al
|     :::   0x01002049      00e3           add bl, ah                              ; move file pointer 32 bytes
|     :::   0x0100204b      42             inc edx                                   ; counter2++
|     :::   0x0100204c      83fa04         cmp edx, 4                            ;
|     `===< 0x0100204f      75f6           jne 0x1002047                     ; so this loop happens 4 times 
|      ::   0x01002051      5b             pop ebx                                  ;
|      ::   0x01002052      3206           xor al, byte [esi]                       ; xor the value of that calculated with the byte counter 
|      ::   0x01002054      08430a         or byte [ebx + 0xa], al                  ; OR het resultaat met wat filepointer + 10
|      ::   0x01002057      5e             pop esi                                  ; reset file pointer to start of file
|      ::   0x01002058      41             inc ecx                                  ; counter++
|      ::   ;-- eip:
|      ::   0x01002059 b    38e1           cmp cl, ah                               ; counter == 0x20
|      :`=< 0x0100205b      75e0           jne 0x100203d                            ;
\      `==< 0x0100205d      ebaa           jmp 0x1002009                            ;

python script to extract flag.

f = open("native", "r")
b = f.read()
m = ""
for p in range(0,32):
    m += chr(int(hex(ord(b[p])+ord(b[p+0x20])+ord(b[p+0x40])+ord(b[p+0x60]))[-2:],16))
print m

FLAG{tiny_f1f_analysis_is__real}