Function at 0x407c10
Capabilities:
Delete file
Read file on windows
Resolve function by parsing pe exports
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x288
mov eax, dword [section..data]
xor eax, esp
mov dword [esp + 0x284], eax
cmp dword [ebp + 8], 4
push esi
mov esi, dword [ebp + 0xc]
push edi
mov dword [esp + 0x14], esi
jl 0x40891e
mov eax, dword [esi + 4]
xor edi, edi
mov byte [esp + 0x24], 0
mov ecx, 0x40d12c
lea esp, [esp]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x407c70
test dl, dl
je 0x407c6c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x407c70
add eax, 2
add ecx, 2
test dl, dl
jne 0x407c50
xor eax, eax
jmp 0x407c75
sbb eax, eax
or eax, 1
test eax, eax
jne 0x407c83
mov byte [esp + 0x24], 1
mov edi, 1
mov eax, dword [esi + edi*4 + 4]
mov edx, 0x40d130
lea esp, [esp]
mov cl, byte [eax]
cmp cl, byte [edx]
mov byte [esp + 0xf], cl
mov ecx, dword [esi + edi*4 + 4]
jne 0x407cc6
cmp byte [esp + 0xf], 0
je 0x407cc2
mov cl, byte [eax + 1]
cmp cl, byte [edx + 1]
mov byte [esp + 0xf], cl
mov ecx, dword [esi + edi*4 + 4]
jne 0x407cc6
add eax, 2
add edx, 2
cmp byte [esp + 0xf], 0
jne 0x407c90
xor eax, eax
jmp 0x407ccb
sbb eax, eax
or eax, 1
test eax, eax
jne 0x408192
lea eax, [edi + 7]
cmp dword [ebp + 8], eax
jle 0x408192
mov eax, dword [esi + edi*4 + 0xc]
inc edi
push 0x40d134
mov dword [esp + 0x1c], eax
push dword [esi + edi*4 + 4]
call dword [sym.imp.MSVCR120.dll_fopen]
add esp, 8
mov dword [esp + 0x10], eax
test eax, eax
jne 0x407d31
push str.ERROR:_Please_check_your_input_file__n
call dword [sym.imp.MSVCR120.dll_printf]
add esp, 4
push 0
call dword [sym.imp.MSVCR120.dll_fclose]
add esp, 4
xor eax, eax
pop edi
pop esi
mov ecx, dword [esp + 0x284]
xor ecx, esp
call fcn.0040abe5
mov esp, ebp
pop ebp
ret
push dword [esi + edi*4 + 0xc]
call dword [sym.imp.MSVCR120.dll_atoi]
add esp, 4
mov dword [esp + 0x28], eax
push dword [esi + edi*4 + 0x10]
call dword [sym.imp.MSVCR120.dll_atoi]
add esp, 4
mov dword [esp + 0x38], eax
push dword [esi + edi*4 + 0x14]
call dword [sym.imp.MSVCR120.dll_atoi]
add esp, 4
mov dword [esp + 0x20], eax
push dword [esi + edi*4 + 0x18]
call dword [sym.imp.MSVCR120.dll_atoi]
add esp, 4
mov dword [esp + 0x2c], eax
push dword [esi + edi*4 + 0x1c]
call dword [sym.imp.MSVCR120.dll_atoi]
add esp, 4
mov dword [esp + 0x3c], eax
cmp dword [esp + 0x28], 1
ja 0x408188
cmp dword [esp + 0x38], 1
ja 0x408188
mov ecx, dword [esp + 0x20]
dec ecx
cmp ecx, 3
ja 0x408188
cmp dword [esp + 0x2c], 1
ja 0x408188
cmp eax, 1
je 0x407dd7
cmp eax, 2
je 0x407dd7
cmp eax, 4
je 0x407dd7
cmp eax, 8
je 0x407dd7
cmp eax, 0x10
je 0x407dd7
cmp eax, 0x20
jne 0x408188
push 0x30
lea eax, [esp + 0xb4]
mov dword [esp + 0x20], 0
push 0
push eax
mov dword [esp + 0x3c], 0
call sub.MSVCR120.dll_memset
xorps xmm0, xmm0
add esp, 0xc
cmp dword [esp + 0x28], 0
movdqa xmmword [esp + 0x60], xmm0
movdqa xmmword [esp + 0x40], xmm0
je 0x4080e1
cmp dword [esp + 0x38], 0
je 0x4080e1
lea eax, [edi + 0xc]
cmp dword [ebp + 8], eax
jge 0x407e5a
push str.ERROR:_Not_enough_parameters_for_finalized_EDAT__n
call dword [sym.imp.MSVCR120.dll_printf]
mov esi, dword [esp + 0x14]
add esp, 4
push esi
call dword [sym.imp.MSVCR120.dll_fclose]
add esp, 4
xor eax, eax
pop edi
pop esi
mov ecx, dword [esp + 0x284]
xor ecx, esp
call fcn.0040abe5
mov esp, ebp
pop ebp
ret
push dword [esi + edi*4 + 0x20]
call dword [sym.imp.MSVCR120.dll_atoi]
add esp, 4
mov dword [esp + 0x1c], eax
push 0x10
push 0
push dword [esi + edi*4 + 0x24]
call dword [sym.imp.MSVCR120.dll_strtol]
mov edx, dword [esi + edi*4 + 0x28]
add esp, 0xc
mov dword [esp + 0x30], eax
lea eax, [esp + 0xb0]
sub eax, edx
lea ecx, [ecx]
mov cl, byte [edx]
lea edx, [edx + 1]
mov byte [eax + edx - 1], cl
test cl, cl
jne 0x407e90
mov eax, dword [esp + 0x1c]
dec eax
cmp eax, 2
ja 0x4080d7
push dword [esi + edi*4 + 0x2c]
call dword [sym.imp.MSVCR120.dll_atoi]
add esp, 4
cmp eax, 8
ja case.default.0x407ec1
jmp dword [eax*4 + 0x40893c]
movdqu xmm0, xmmword [0x40e128]
movdqu xmmword [esp + 0x40], xmm0
mov eax, dword [esi + edi*4 + 0x30]
lea edi, [esi + edi*4]
test eax, eax
je 0x4080e1
push 0x40d134
push eax
call dword [sym.imp.MSVCR120.dll_fopen]
mov ecx, dword [edi + 0x30]
lea edx, [esp + 0x188]
add esp, 8
xorps xmm0, xmm0
mov esi, eax
movdqa xmmword [esp + 0x50], xmm0
call fcn.0040ab80
mov edx, str.rifkey.bin
lea ecx, [esp + 0x180]
lea ebx, [ebx]
mov al, byte [ecx]
cmp al, byte [edx]
jne 0x408059
test al, al
je 0x407f44
mov al, byte [ecx + 1]
cmp al, byte [edx + 1]
jne 0x408059
add ecx, 2
add edx, 2
test al, al
jne 0x407f20
xor eax, eax
jmp 0x40805e
movdqa xmm0, xmmword [0x40e0b0]
movdqa xmmword [esp + 0x40], xmm0
jmp case.0x407ec1.0
movdqa xmm0, xmmword [0x40e140]
movdqa xmmword [esp + 0x40], xmm0
jmp case.0x407ec1.0
movdqu xmm0, xmmword [0x40e0c0]
jmp 0x407ed0
movdqu xmm0, xmmword [0x40e150]
jmp 0x407ed0
movdqu xmm0, xmmword [0x40e118]
jmp 0x407ed0
movdqu xmm0, xmmword [0x40e170]
jmp 0x407ed0
mov ecx, dword [esi + edi*4 + 0x30]
test ecx, ecx
je 0x407fd5
call fcn.0040a9e0
test al, al
je 0x407fd5
mov edx, dword [esi + edi*4 + 0x30]
lea ecx, [esp + 0x50]
call fcn.0040a8d0
movdqa xmm0, xmmword [esp + 0x50]
inc edi
movdqa xmmword [esp + 0x40], xmm0
jmp case.0x407ec1.0
push 0x40d134
push str.klic.bin
call dword [sym.imp.MSVCR120.dll_fopen]
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
je 0x40801e
push eax
push 1
lea eax, [esp + 0x58]
push 0x10
push eax
call dword [sym.imp.MSVCR120.dll_fread]
movdqa xmm0, xmmword [esp + 0x60]
push dword [esp + 0x24]
movdqa xmmword [esp + 0x54], xmm0
call dword [sym.imp.MSVCR120.dll_fclose]
add esp, 0x14
jmp case.0x407ec1.0
push str.ERROR:_Please_place_your_binary_custom_klic_in_a_klic.bin_file__n
call dword [sym.imp.MSVCR120.dll_printf]
mov esi, dword [esp + 0x14]
add esp, 4
push esi
mov esi, dword [sym.imp.MSVCR120.dll_fclose]
call esi
add esp, 4
push 0
call esi
add esp, 4
xor eax, eax
pop edi
pop esi
mov ecx, dword [esp + 0x284]
xor ecx, esp
call fcn.0040abe5
mov esp, ebp
pop ebp
ret
sbb eax, eax
or eax, 1
test eax, eax
jne 0x408091
test esi, esi
jne 0x408070
push str.ERROR:_Please_place_your_binary_RIF_key_in_a_rifkey.bin_file__n
jmp 0x407e2d
push esi
push 1
lea eax, [esp + 0x68]
push 0x10
push eax
call dword [sym.imp.MSVCR120.dll_fread]
mov edi, dword [sym.imp.MSVCR120.dll_fclose]
add esp, 0x10
push esi
call edi
add esp, 4
jmp 0x4080e7
test esi, esi
jne 0x40809f
push str.ERROR:_Please_place_your_binary_RAP_key_in_a_rap_file__n
jmp 0x407e2d
push esi
push 1
lea eax, [esp + 0x58]
push 0x10
push eax
call dword [sym.imp.MSVCR120.dll_fread]
add esp, 0x10
lea edx, [esp + 0x60]
lea ecx, [esp + 0x50]
call fcn.004042b0
mov edi, dword [sym.imp.MSVCR120.dll_fclose]
push esi
call edi
add esp, 4
jmp 0x4080e7
push str.ERROR:_Invalid_klic_mode__n
jmp 0x407e2d
push str.ERROR:_Invalid_finalized_EDAT_parameters__n
jmp 0x407e2d
mov edi, dword [sym.imp.MSVCR120.dll_fclose]
mov esi, dword [esp + 0x18]
push 0x40d2cc
push esi
call dword [sym.imp.MSVCR120.dll_fopen]
push dword [esp + 0x2c]
cmp dword [esp + 0x44], 0
mov edx, eax
mov dword [esp + 0x20], edx
setne cl
cmp dword [esp + 0x34], 0
movzx ecx, cl
push ecx
setne cl
cmp dword [esp + 0x3c], 0
movzx ecx, cl
push ecx
setne al
movzx eax, al
push eax
push dword [esp + 0x54]
lea eax, [esp + 0x7c]
push dword [esp + 0x4c]
push dword [esp + 0x3c]
push dword [esp + 0x44]
push eax
lea eax, [esp + 0x6c]
push eax
lea eax, [esp + 0xe0]
push eax
push esi
mov esi, dword [esp + 0x48]
mov ecx, esi
call fcn.004070e0
add esp, 0x38
push esi
test al, al
je 0x408178
call edi
add esp, 4
push dword [esp + 0x14]
call edi
add esp, 4
push dword [esp + 0x18]
call dword [sym.imp.MSVCR120.dll_remove]
jmp 0x407e41
call edi
add esp, 4
push dword [esp + 0x14]
call edi
jmp 0x407e41
push str.ERROR:_Invalid_parameters__n
jmp 0x407e2d
mov edx, 0x40d2d0
mov eax, ecx
lea esp, [esp]
mov cl, byte [eax]
cmp cl, byte [edx]
mov byte [esp + 0xf], cl
mov ecx, dword [esi + edi*4 + 4]
jne 0x4081d6
cmp byte [esp + 0xf], 0
je 0x4081d2
mov cl, byte [eax + 1]
cmp cl, byte [edx + 1]
mov byte [esp + 0xf], cl
mov ecx, dword [esi + edi*4 + 4]
jne 0x4081d6
add eax, 2
add edx, 2
cmp byte [esp + 0xf], 0
jne 0x4081a0
xor eax, eax
jmp 0x4081db
sbb eax, eax
or eax, 1
test eax, eax
jne 0x4084ea
lea eax, [edi + 4]
cmp dword [ebp + 8], eax
jle 0x4084ea
mov ecx, dword [esi + edi*4 + 8]
inc edi
push 0x40d134
push ecx
mov dword [esp + 0x28], ecx
mov eax, dword [esi + edi*4 + 8]
mov dword [esp + 0x1c], eax
call dword [sym.imp.MSVCR120.dll_fopen]
add esp, 8
mov dword [esp + 0x10], eax
test eax, eax
jne 0x408227
push str.ERROR:_Please_check_your_input_file__n
call dword [sym.imp.MSVCR120.dll_printf]
jmp 0x407e41
push dword [esi + edi*4 + 0xc]
call dword [sym.imp.MSVCR120.dll_atoi]
mov ecx, eax
xorps xmm0, xmm0
add esp, 4
movdqa xmmword [esp + 0x60], xmm0
movdqa xmmword [esp + 0x40], xmm0
cmp ecx, 8
ja case.default.0x40824e
jmp dword [ecx*4 + 0x408960]
movdqu xmm0, xmmword [0x40e128]
movdqu xmmword [esp + 0x40], xmm0
mov eax, dword [esi + edi*4 + 0x10]
lea edi, [esi + edi*4]
test eax, eax
je 0x408465
push 0x40d134
push eax
call dword [sym.imp.MSVCR120.dll_fopen]
mov ecx, dword [edi + 0x10]
lea edx, [esp + 0x188]
add esp, 8
xorps xmm0, xmm0
mov esi, eax
movdqa xmmword [esp + 0x50], xmm0
call fcn.0040ab80
mov edx, str.rifkey.bin
lea ecx, [esp + 0x180]
jmp 0x4082b0
mov al, byte [ecx]
cmp al, byte [edx]
jne 0x4083d5
test al, al
je 0x4082d4
mov al, byte [ecx + 1]
cmp al, byte [edx + 1]
jne 0x4083d5
add ecx, 2
add edx, 2
test al, al
jne 0x4082b0
xor eax, eax
jmp 0x4083da
movdqa xmm0, xmmword [0x40e0b0]
movdqa xmmword [esp + 0x40], xmm0
jmp case.0x40824e.0
movdqa xmm0, xmmword [0x40e140]
movdqa xmmword [esp + 0x40], xmm0
jmp case.0x40824e.0
movdqu xmm0, xmmword [0x40e0c0]
jmp 0x40825d
movdqu xmm0, xmmword [0x40e150]
jmp 0x40825d
movdqu xmm0, xmmword [0x40e118]
jmp 0x40825d
movdqu xmm0, xmmword [0x40e170]
jmp 0x40825d
mov ecx, dword [esi + edi*4 + 0x10]
test ecx, ecx
je 0x408365
call fcn.0040a9e0
test al, al
je 0x408365
mov edx, dword [esi + edi*4 + 0x10]
lea ecx, [esp + 0x50]
call fcn.0040a8d0
movdqa xmm0, xmmword [esp + 0x50]
inc edi
movdqa xmmword [esp + 0x40], xmm0
jmp case.0x40824e.0
push 0x40d134
push str.klic.bin
call dword [sym.imp.MSVCR120.dll_fopen]
add esp, 8
mov dword [esp + 0x3c], eax
test eax, eax
je 0x4083ae
push eax
push 1
lea eax, [esp + 0x58]
push 0x10
push eax
call dword [sym.imp.MSVCR120.dll_fread]
movdqa xmm0, xmmword [esp + 0x60]
push dword [esp + 0x4c]
movdqa xmmword [esp + 0x54], xmm0
call dword [sym.imp.MSVCR120.dll_fclose]
add esp, 0x14
jmp case.0x40824e.0
push str.ERROR:_Please_place_your_binary_custom_klic_in_a_klic.bin_file__n
call dword [sym.imp.MSVCR120.dll_printf]
mov edi, dword [esp + 0x14]
add esp, 4
mov esi, dword [sym.imp.MSVCR120.dll_fclose]
push edi
call esi
add esp, 4
push 0
call esi
jmp 0x407e41
sbb eax, eax
or eax, 1
test eax, eax
jne 0x40841b
test esi, esi
jne 0x4083fa
push str.ERROR:_Please_place_your_binary_RIF_key_in_a_rifkey.bin_file__n
call dword [sym.imp.MSVCR120.dll_printf]
mov edi, dword [esp + 0x14]
add esp, 4
push edi
jmp 0x407e3b
push esi
push 1
lea eax, [esp + 0x68]
push 0x10
push eax
call dword [sym.imp.MSVCR120.dll_fread]
add esp, 0x10
push esi
mov esi, dword [sym.imp.MSVCR120.dll_fclose]
call esi
add esp, 4
jmp 0x40846b
test esi, esi
jne 0x408437
push str.ERROR:_Please_place_your_binary_RAP_key_in_a_rap_file__n
call dword [sym.imp.MSVCR120.dll_printf]
mov edi, dword [esp + 0x14]
add esp, 4
push edi
jmp 0x407e3b
push esi
push 1
lea eax, [esp + 0x58]
push 0x10
push eax
call dword [sym.imp.MSVCR120.dll_fread]
add esp, 0x10
lea edx, [esp + 0x60]
lea ecx, [esp + 0x50]
call fcn.004042b0
push esi
mov esi, dword [sym.imp.MSVCR120.dll_fclose]
call esi
add esp, 4
jmp 0x40846b
mov esi, dword [sym.imp.MSVCR120.dll_fclose]
push 0x40d2d4
push dword [esp + 0x18]
call dword [sym.imp.MSVCR120.dll_fopen]
push dword [esp + 0x2c]
mov edi, dword [esp + 0x1c]
lea ecx, [esp + 0x6c]
push ecx
lea ecx, [esp + 0x50]
mov dword [esp + 0x28], eax
push ecx
push dword [esp + 0x34]
mov edx, eax
mov ecx, edi
call fcn.00405c70
add esp, 0x18
push edi
test al, al
je 0x4084c2
call esi
add esp, 4
push dword [esp + 0x18]
call esi
add esp, 4
push dword [esp + 0x14]
call dword [sym.imp.MSVCR120.dll_remove]
jmp 0x407e41
call esi
add esp, 4
push dword [esp + 0x18]
call esi
jmp 0x407e41
push str.ERROR:_Invalid_klic_mode__n
call dword [sym.imp.MSVCR120.dll_printf]
mov edi, dword [esp + 0x14]
add esp, 4
push edi
jmp 0x407e3b
mov eax, 0x40d2d8
nop
mov dl, byte [ecx]
cmp dl, byte [eax]
jne 0x408510
test dl, dl
je 0x40850c
mov dl, byte [ecx + 1]
cmp dl, byte [eax + 1]
jne 0x408510
add ecx, 2
add eax, 2
test dl, dl
jne 0x4084f0
xor eax, eax
jmp 0x408515
sbb eax, eax
or eax, 1
test eax, eax
jne 0x40891e
lea eax, [edi + 3]
cmp dword [ebp + 8], eax
jle 0x40891e
mov eax, dword [esp + 0x14]
mov esi, dword [esi + edi*4 + 0xc]
push 0x40d134
push dword [eax + edi*4 + 8]
call dword [sym.imp.MSVCR120.dll_fopen]
push 0x40d134
push esi
mov dword [esp + 0x20], eax
call dword [sym.imp.MSVCR120.dll_fopen]
add esp, 0x10
mov esi, eax
cmp dword [esp + 0x10], 0
mov dword [esp + 0x1c], esi
je 0x408217
test esi, esi
jne 0x40857f
push str.ERROR:_Please_check_your_source_file__n
call dword [sym.imp.MSVCR120.dll_printf]
add esp, 4
push dword [esp + 0x10]
jmp 0x407e3b
mov eax, dword [esp + 0x14]
mov eax, dword [eax + edi*4 + 0x10]
test eax, eax
je 0x4085cd
push eax
call dword [sym.imp.MSVCR120.dll_atoi]
mov edi, eax
add esp, 4
test edi, edi
je 0x4085cf
cmp edi, 1
je 0x4085cf
cmp edi, 2
je 0x4085cf
push str.ERROR:_Invalid_parameters__n
call dword [sym.imp.MSVCR120.dll_printf]
mov esi, dword [sym.imp.MSVCR120.dll_fclose]
add esp, 4
push dword [esp + 0x10]
call esi
add esp, 4
push dword [esp + 0x1c]
call esi
jmp 0x407e41
xor edi, edi
push 2
push 0
push 0
push esi
call dword [sym.imp.MSVCR120.dll__fseeki64]
push esi
call dword [sym.imp.MSVCR120.dll__ftelli64]
add esp, 0x14
mov dword [esp + 0x20], eax
mov dword [esp + 0x18], edx
push 0
push 0
push 0
push esi
call dword [sym.imp.MSVCR120.dll__fseeki64]
xorps xmm0, xmm0
lea eax, [esp + 0xf0]
push 0x40
push 0
push eax
movdqa xmmword [esp + 0x6c], xmm0
movdqa xmmword [esp + 0x5c], xmm0
movdqa xmmword [esp + 0x7c], xmm0
movdqa xmmword [esp + 0x8c], xmm0
movdqa xmmword [esp + 0x9c], xmm0
call sub.MSVCR120.dll_memset
add esp, 0x1c
lea eax, [esp + 0x3c]
push dword [esp + 0x10]
push 1
push 4
push eax
call dword [sym.imp.MSVCR120.dll_fread]
push 0
push 0
push 0
push dword [esp + 0x2c]
call dword [sym.imp.MSVCR120.dll__fseeki64]
lea eax, [esp + 0x5c]
mov dword [esp + 0x58], 0x454353
mov eax, dword [eax]
lea ecx, [esp + 0x58]
add esp, 0x20
cmp eax, dword [ecx]
jne 0x4086e3
push dword [esp + 0x10]
lea eax, [esp + 0xa0]
push 1
push 0x10
push eax
call dword [sym.imp.MSVCR120.dll_fread]
mov eax, dword [esp + 0xba]
mov ecx, eax
sar ecx, 8
shl eax, 8
and ecx, 0xff
or ecx, eax
sub ecx, 0x60
movzx eax, cx
cwde
mov dword [esp + 0x24], eax
push 0
cdq
push edx
push eax
push dword [esp + 0x2c]
call dword [sym.imp.MSVCR120.dll__fseeki64]
add esp, 0x20
cmp byte [esp + 0x24], 0
je 0x4086e3
push str.SCE_file_detected__n
call dword [sym.imp.MSVCR120.dll_printf]
add esp, 4
push dword [esp + 0x14]
push str.NPD_offset_inside_SCE:_0x_08x_n
call dword [sym.imp.MSVCR120.dll_printf]
add esp, 8
push dword [esp + 0x10]
lea eax, [esp + 0x124]
push 1
push 0x60
push eax
call dword [sym.imp.MSVCR120.dll_fread]
push dword [esp + 0x20]
lea eax, [esp + 0x74]
push 1
push 0x10
push eax
call dword [sym.imp.MSVCR120.dll_fread]
add esp, 0x20
cmp byte [esp + 0x24], 0
je 0x40877c
cmp edi, 1
jne 0x408722
push str.MODE:_Text_n
jmp 0x408733
cmp edi, 2
jne 0x40872e
push str.MODE:_Unicode_text_n
jmp 0x408733
push str.MODE:_Binary_n
call dword [sym.imp.MSVCR120.dll_printf]
add esp, 4
push str.DEV_HASH:
call dword [sym.imp.MSVCR120.dll_printf]
add esp, 4
xor esi, esi
lea esp, [esp]
movzx eax, byte [esp + esi + 0x60]
push eax
push str._02X
call dword [sym.imp.MSVCR120.dll_printf]
inc esi
add esp, 8
cmp esi, 0x10
jl 0x408750
push 0x40c784
call dword [sym.imp.MSVCR120.dll_printf]
mov esi, dword [esp + 0x20]
add esp, 4
push str.Bruteforcing_klic..._n
call dword [sym.imp.MSVCR120.dll_printf]
add esp, 4
mov dword [esp + 0x14], 0
cmp dword [esp + 0x18], 0
jl 0x4088a6
jg 0x4087aa
cmp dword [esp + 0x20], 0
jbe 0x4088a6
xorps xmm0, xmm0
movlpd qword [esp + 0x30], xmm0
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x30]
jmp 0x4087c0
push 0
push edx
push eax
push esi
call dword [sym.imp.MSVCR120.dll__fseeki64]
add esp, 0x10
push esi
push 1
cmp edi, 1
jne 0x4087e8
lea eax, [esp + 0x78]
push 0x20
push eax
call dword [sym.imp.MSVCR120.dll_fread]
add esp, 0x10
jmp 0x408825
cmp edi, 2
jne 0x408841
lea eax, [esp + 0xe8]
push 0x40
push eax
call dword [sym.imp.MSVCR120.dll_fread]
add esp, 0x10
lea edx, [esp + 0x70]
xor ecx, ecx
jmp 0x408810
mov al, byte [esp + ecx + 0xe1]
lea edx, [edx + 1]
add ecx, 2
mov byte [edx - 1], al
cmp ecx, 0x40
jl 0x408810
lea ecx, [esp + 0x70]
call fcn.0040a9e0
test al, al
je 0x408886
lea edx, [esp + 0x70]
lea ecx, [esp + 0x40]
call fcn.0040a8d0
jmp 0x408851
lea eax, [esp + 0x48]
push 0x10
push eax
call dword [sym.imp.MSVCR120.dll_fread]
add esp, 0x10
push ecx
push 0x40e0b0
lea edx, [esp + 0x48]
lea ecx, [esp + 0x58]
call fcn.0040a860
add esp, 4
lea eax, [esp + 0x64]
lea ecx, [esp + 0x54]
push eax
lea eax, [esp + 0x128]
push 0x60
push eax
call fcn.0040aae0
add esp, 0x10
test al, al
jne 0x4088ce
mov eax, dword [esp + 0x14]
inc eax
mov dword [esp + 0x14], eax
cdq
cmp edx, dword [esp + 0x18]
jl 0x4087c0
jg 0x4088a6
cmp eax, dword [esp + 0x20]
jb 0x4087c0
push str.Failed_to_bruteforce_klic__n
call dword [sym.imp.MSVCR120.dll_printf]
mov esi, dword [sym.imp.MSVCR120.dll_fclose]
add esp, 4
push dword [esp + 0x10]
call esi
add esp, 4
push dword [esp + 0x1c]
call esi
jmp 0x407e41
push str.Found_valid_klic__Saved_to_klic.bin_n
call dword [sym.imp.MSVCR120.dll_printf]
add esp, 4
push 0x40d2d4
push str.klic.bin
call dword [sym.imp.MSVCR120.dll_fopen]
mov esi, eax
lea eax, [esp + 0x48]
push esi
push 1
push 0x10
push eax
call dword [sym.imp.MSVCR120.dll_fwrite]
push esi
mov esi, dword [sym.imp.MSVCR120.dll_fclose]
call esi
add esp, 0x1c
push dword [esp + 0x10]
call esi
add esp, 4
push dword [esp + 0x1c]
call esi
jmp 0x407e41
call fcn.00407a70
mov ecx, dword [esp + 0x28c]
xor eax, eax
pop edi
pop esi
xor ecx, esp
call fcn.0040abe5
mov esp, ebp
pop ebp
ret