Function at 0x408610
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
push eax
mov eax, 0x4088
call fcn.00418e10
mov eax, dword [ebp - 0x10]
mov ebx, eax
mov eax, dword [ebp + 0x10]
lea edi, [ebp - 0x4078]
mov dword [ebp - 0x4094], edx
mov dword [eax], 0
mov dword [ebp - 0x4098], ecx
push ebx
push 0x4000
push 1
push edi
call sub.msvcrt.dll_fread
mov dword [esp], ebx
mov esi, eax
call sub.msvcrt.dll_fclose
add esp, 0x10
test esi, esi
js 0x4086a4
cmp esi, 0x4000
je 0x4086a4
mov eax, dword [ebp + 0x10]
test esi, esi
mov dword [eax], str.file_format_error
jle 0x4086a0
cmp byte [ebp - 0x4078], 0
jne 0x4086a0
cmp esi, 1
je 0x4086a0
mov dl, byte [ebp - 0x4077]
xor ebx, ebx
mov bl, dl
mov byte [ebp - 0x407d], dl
test ebx, ebx
je 0x4086c7
cmp ebx, 3
je 0x4086c7
lea esi, [esi]
xor ebx, ebx
jmp 0x4086af
mov edx, dword [ebp + 0x10]
xor ebx, ebx
mov dword [edx], str.error_reading_file
push edx
push 0x4000
push 0
push edi
call sub.msvcrt.dll_memset
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [esi - 2]
cmp eax, 3
jle 0x4086a0
cmp byte [ebp - 0x4076], 0
jne 0x4086a0
cmp byte [ebp - 0x4075], 0
jne 0x4086a0
cmp byte [ebp - 0x4074], 0
jne 0x4086a0
cmp byte [ebp - 0x4073], 0
jne 0x4086a0
sub esp, 0xc
mov eax, dword [ebp - 0x4094]
push 1
push 0
push eax
lea eax, [ebp - 0x4072]
push esi
push eax
call fcn.0040ae60
add esp, 0x20
mov ecx, eax
add eax, 6
js 0x4086a0
lea edx, [edi + eax]
xor eax, eax
add ecx, 0xa
mov al, byte [edx + 3]
mov dword [ebp - 0x4090], eax
xor eax, eax
mov al, byte [edx]
shl eax, 0x18
or dword [ebp - 0x4090], eax
xor eax, eax
mov al, byte [edx + 1]
shl eax, 0x10
or dword [ebp - 0x4090], eax
xor eax, eax
mov al, byte [edx + 2]
mov edx, dword [ebp - 0x4090]
shl eax, 8
mov dword [ebp - 0x4088], ecx
or edx, eax
mov eax, esi
mov dword [ebp - 0x4090], edx
sub eax, ecx
cmp dword [ebp - 0x4090], eax
jg 0x4086a0
push eax
push eax
mov eax, dword [ebp - 0x4090]
push 1
inc eax
push eax
call fcn.00408ee0
add esp, 0x10
mov dword [ebp - 0x408c], eax
test eax, eax
je 0x4087bf
mov edx, dword [ebp - 0x4088]
push ecx
lea eax, [edi + edx]
mov edx, dword [ebp - 0x4090]
push edx
push eax
mov eax, dword [ebp - 0x408c]
push eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp - 0x408c]
mov edx, dword [ebp - 0x4090]
add esp, 0x10
mov byte [eax + edx], 0
mov eax, dword [ebp + 8]
test eax, eax
je 0x4087dd
sub esp, 0xc
mov ecx, dword [ebp - 0x408c]
push ecx
call fcn.00409410
mov edx, dword [ebp + 8]
add esp, 0x10
mov dword [edx], eax
mov edx, dword [ebp - 0x4094]
test edx, edx
je 0x408914
mov eax, dword [ebp - 0x4094]
mov edx, dword [ebp - 0x408c]
mov dword [eax + 0x20], edx
mov eax, dword [ebp - 0x4098]
test eax, eax
jne 0x40887d
mov eax, dword [ebp - 0x4094]
test eax, eax
je 0x4088fd
mov edx, dword [ebp - 0x4090]
mov eax, dword [ebp - 0x4088]
add edx, eax
mov dword [ebp - 0x4084], edx
cmp byte [ebp - 0x407d], 0
jne 0x408887
mov eax, esi
mov edx, dword [ebp - 0x4084]
sub eax, edx
cmp eax, 3
jle 0x4086a0
mov edx, dword [ebp - 0x4084]
mov al, byte [ebp + edx - 0x4078]
cmp al, byte [ebp + edx - 0x4076]
jne 0x40886c
mov al, byte [ebp + edx - 0x4077]
cmp al, byte [ebp + edx - 0x4075]
je 0x40892b
mov eax, dword [ebp + 0x10]
or ebx, 0xffffffff
mov dword [eax], str.wrong_passphrase
jmp 0x4086af
mov ebx, 1
jmp 0x4086af
sub esp, 0xc
lea ebx, [ebp - 0x78]
push ebx
call fcn.00411ca0
pop eax
mov eax, dword [ebp + 0xc]
push eax
call sub.msvcrt.dll_strlen
add esp, 0xc
mov ecx, dword [ebp + 0xc]
push eax
push ecx
push ebx
call fcn.00411d30
pop eax
pop edx
push ebx
lea ebx, [ebp - 0x1c]
push ebx
call fcn.00412690
mov ecx, dword [ebp - 0x4084]
lea eax, [esi + 7]
add esp, 0xc
sub eax, ecx
mov edx, dword [ebp - 0x4084]
and eax, 0xfffffff8
push eax
lea eax, [edi + edx]
push eax
push ebx
call fcn.004116a0
add esp, 0x10
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x10], 0
jmp 0x40882f
test ebx, ebx
setne al
xor ebx, ebx
mov bl, al
mov eax, dword [ebp + 0x10]
mov dword [eax], 0
jmp 0x4086af
sub esp, 0xc
mov eax, dword [ebp - 0x408c]
push eax
call fcn.00408de0
add esp, 0x10
jmp 0x4087fa
mov ebx, dword [ebp - 0x4084]
push eax
mov eax, dword [ebp - 0x4094]
add ebx, 4
push eax
mov eax, esi
sub eax, ebx
push eax
lea eax, [edi + ebx]
push eax
call fcn.0040ae40
add esp, 0x10
test eax, eax
js 0x4086a0
lea ebx, [eax + ebx]
push eax
mov eax, dword [ebp - 0x4094]
add eax, 0x1c
push eax
mov eax, esi
sub eax, ebx
push eax
lea eax, [edi + ebx]
push eax
call fcn.0040dfa0
add esp, 0x10
test eax, eax
js 0x4086a0
lea ebx, [eax + ebx]
mov eax, dword [ebp - 0x4094]
add eax, 0x18
push ecx
push eax
mov eax, esi
sub eax, ebx
push eax
lea eax, [edi + ebx]
push eax
call fcn.0040dfa0
add esp, 0x10
test eax, eax
js 0x4086a0
add eax, ebx
push edx
mov edx, dword [ebp - 0x4094]
sub esi, eax
add edx, 0x14
lea eax, [edi + eax]
push edx
push esi
push eax
call fcn.0040dfa0
add esp, 0x10
test eax, eax
js 0x4086a0
sub esp, 0xc
mov ebx, dword [ebp - 0x4094]
push ebx
call fcn.0040b030
add esp, 0x10
test eax, eax
jne 0x40887d
mov edx, dword [ebp + 0x10]
sub esp, 0xc
mov ecx, dword [ebp - 0x4094]
xor ebx, ebx
mov dword [edx], str.rsa_verify_failed
push ecx
call fcn.00409950
add esp, 0x10
jmp 0x4086af