Function at 0x408c20
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
push eax
mov eax, 0x4088
call fcn.0041a3a0
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 0x408cb4
cmp esi, 0x4000
je 0x408cb4
mov eax, dword [ebp + 0x10]
test esi, esi
mov dword [eax], str.file_format_error
jle 0x408cb0
cmp byte [ebp - 0x4078], 0
jne 0x408cb0
cmp esi, 1
je 0x408cb0
mov dl, byte [ebp - 0x4077]
xor ebx, ebx
mov bl, dl
mov byte [ebp - 0x407d], dl
test ebx, ebx
je 0x408cd7
cmp ebx, 3
je 0x408cd7
lea esi, [esi]
xor ebx, ebx
jmp 0x408cbf
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 0x408cb0
cmp byte [ebp - 0x4076], 0
jne 0x408cb0
cmp byte [ebp - 0x4075], 0
jne 0x408cb0
cmp byte [ebp - 0x4074], 0
jne 0x408cb0
cmp byte [ebp - 0x4073], 0
jne 0x408cb0
sub esp, 0xc
mov eax, dword [ebp - 0x4094]
push 1
push 0
push eax
lea eax, [ebp - 0x4072]
push esi
push eax
call fcn.0040afd0
add esp, 0x20
mov ecx, eax
add eax, 6
js 0x408cb0
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 0x408cb0
push eax
push eax
mov eax, dword [ebp - 0x4090]
push 1
inc eax
push eax
call fcn.004094f0
add esp, 0x10
mov dword [ebp - 0x408c], eax
test eax, eax
je 0x408dcf
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 0x408ded
sub esp, 0xc
mov ecx, dword [ebp - 0x408c]
push ecx
call fcn.00409a20
mov edx, dword [ebp + 8]
add esp, 0x10
mov dword [edx], eax
mov edx, dword [ebp - 0x4094]
test edx, edx
je 0x408f24
mov eax, dword [ebp - 0x4094]
mov edx, dword [ebp - 0x408c]
mov dword [eax + 0x20], edx
mov eax, dword [ebp - 0x4098]
test eax, eax
jne 0x408e8d
mov eax, dword [ebp - 0x4094]
test eax, eax
je 0x408f0d
mov edx, dword [ebp - 0x4090]
mov eax, dword [ebp - 0x4088]
add edx, eax
mov dword [ebp - 0x4084], edx
cmp byte [ebp - 0x407d], 0
jne 0x408e97
mov eax, esi
mov edx, dword [ebp - 0x4084]
sub eax, edx
cmp eax, 3
jle 0x408cb0
mov edx, dword [ebp - 0x4084]
mov al, byte [ebp + edx - 0x4078]
cmp al, byte [ebp + edx - 0x4076]
jne 0x408e7c
mov al, byte [ebp + edx - 0x4077]
cmp al, byte [ebp + edx - 0x4075]
je 0x408f3b
mov eax, dword [ebp + 0x10]
or ebx, 0xffffffff
mov dword [eax], str.wrong_passphrase
jmp 0x408cbf
mov ebx, 1
jmp 0x408cbf
sub esp, 0xc
lea ebx, [ebp - 0x78]
push ebx
call fcn.00415f00
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.00415f90
pop eax
pop edx
push ebx
lea ebx, [ebp - 0x1c]
push ebx
call fcn.004168f0
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.004158c0
add esp, 0x10
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x10], 0
jmp 0x408e3f
test ebx, ebx
setne al
xor ebx, ebx
mov bl, al
mov eax, dword [ebp + 0x10]
mov dword [eax], 0
jmp 0x408cbf
sub esp, 0xc
mov eax, dword [ebp - 0x408c]
push eax
call fcn.004093f0
add esp, 0x10
jmp 0x408e0a
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.0040afb0
add esp, 0x10
test eax, eax
js 0x408cb0
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.00411440
add esp, 0x10
test eax, eax
js 0x408cb0
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.00411440
add esp, 0x10
test eax, eax
js 0x408cb0
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.00411440
add esp, 0x10
test eax, eax
js 0x408cb0
sub esp, 0xc
mov ebx, dword [ebp - 0x4094]
push ebx
call fcn.0040b1a0
add esp, 0x10
test eax, eax
jne 0x408e8d
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.00409f60
add esp, 0x10
jmp 0x408cbf