Function at 0x408650
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
push eax
mov eax, 0x4088
call fcn.00418c10
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 0x4086e4
cmp esi, 0x4000
je 0x4086e4
mov eax, dword [ebp + 0x10]
test esi, esi
mov dword [eax], str.file_format_error
jle 0x4086e0
cmp byte [ebp - 0x4078], 0
jne 0x4086e0
cmp esi, 1
je 0x4086e0
mov dl, byte [ebp - 0x4077]
xor ebx, ebx
mov bl, dl
mov byte [ebp - 0x407d], dl
test ebx, ebx
je 0x408707
cmp ebx, 3
je 0x408707
lea esi, [esi]
xor ebx, ebx
jmp 0x4086ef
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 0x4086e0
cmp byte [ebp - 0x4076], 0
jne 0x4086e0
cmp byte [ebp - 0x4075], 0
jne 0x4086e0
cmp byte [ebp - 0x4074], 0
jne 0x4086e0
cmp byte [ebp - 0x4073], 0
jne 0x4086e0
sub esp, 0xc
mov eax, dword [ebp - 0x4094]
push 1
push 0
push eax
lea eax, [ebp - 0x4072]
push esi
push eax
call fcn.0040ae50
add esp, 0x20
mov ecx, eax
add eax, 6
js 0x4086e0
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 0x4086e0
push eax
push eax
mov eax, dword [ebp - 0x4090]
push 1
inc eax
push eax
call fcn.00408f20
add esp, 0x10
mov dword [ebp - 0x408c], eax
test eax, eax
je 0x4087ff
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 0x40881d
sub esp, 0xc
mov ecx, dword [ebp - 0x408c]
push ecx
call fcn.00409450
mov edx, dword [ebp + 8]
add esp, 0x10
mov dword [edx], eax
mov edx, dword [ebp - 0x4094]
test edx, edx
je 0x408954
mov eax, dword [ebp - 0x4094]
mov edx, dword [ebp - 0x408c]
mov dword [eax + 0x20], edx
mov eax, dword [ebp - 0x4098]
test eax, eax
jne 0x4088bd
mov eax, dword [ebp - 0x4094]
test eax, eax
je 0x40893d
mov edx, dword [ebp - 0x4090]
mov eax, dword [ebp - 0x4088]
add edx, eax
mov dword [ebp - 0x4084], edx
cmp byte [ebp - 0x407d], 0
jne 0x4088c7
mov eax, esi
mov edx, dword [ebp - 0x4084]
sub eax, edx
cmp eax, 3
jle 0x4086e0
mov edx, dword [ebp - 0x4084]
mov al, byte [ebp + edx - 0x4078]
cmp al, byte [ebp + edx - 0x4076]
jne 0x4088ac
mov al, byte [ebp + edx - 0x4077]
cmp al, byte [ebp + edx - 0x4075]
je 0x40896b
mov eax, dword [ebp + 0x10]
or ebx, 0xffffffff
mov dword [eax], str.wrong_passphrase
jmp 0x4086ef
mov ebx, 1
jmp 0x4086ef
sub esp, 0xc
lea ebx, [ebp - 0x78]
push ebx
call fcn.00411c60
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.00411cd0
pop eax
pop edx
push ebx
lea ebx, [ebp - 0x1c]
push ebx
call fcn.00412610
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.00411660
add esp, 0x10
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x10], 0
jmp 0x40886f
test ebx, ebx
setne al
xor ebx, ebx
mov bl, al
mov eax, dword [ebp + 0x10]
mov dword [eax], 0
jmp 0x4086ef
sub esp, 0xc
mov eax, dword [ebp - 0x408c]
push eax
call fcn.00408e20
add esp, 0x10
jmp 0x40883a
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.0040ae30
add esp, 0x10
test eax, eax
js 0x4086e0
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.0040df60
add esp, 0x10
test eax, eax
js 0x4086e0
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.0040df60
add esp, 0x10
test eax, eax
js 0x4086e0
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.0040df60
add esp, 0x10
test eax, eax
js 0x4086e0
sub esp, 0xc
mov ebx, dword [ebp - 0x4094]
push ebx
call fcn.0040b020
add esp, 0x10
test eax, eax
jne 0x4088bd
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.00409990
add esp, 0x10
jmp 0x4086ef