Function at 0x409850
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x474
push ebx
mov ebx, dword [esp + 0x47c]
mov eax, 0x200
push ebp
xor ebp, ebp
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], eax
xor eax, eax
push edi
xor edi, edi
cmp ebx, ebp
setne al
mov dword [esp + 0x18], ebp
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x20], edi
cmp eax, ebp
je 0x409c2e
push esi
lea eax, [esp + 0x1c]
push eax
push 0x14
call fcn.0040aba0
xor ecx, ecx
add esp, 8
test eax, eax
setge cl
mov esi, ecx
cmp esi, ebp
je 0x409bf7
xor edx, edx
mov dword [esp + 0x30], edx
mov dword [esp + 0x34], edx
mov dword [esp + 0x38], edx
push ebp
mov dword [esp + 0x40], edx
push 0x80
mov byte [esp + 0x60], 0
xor eax, eax
mov dword [esp + 0x48], edx
mov ecx, 0xa
lea edi, [esp + 0x61]
rep stosd dword es:[edi], eax
push 3
mov dword [esp + 0x50], edx
push ebp
mov dword [esp + 0x58], edx
push 1
stosw word es:[edi], ax
mov dword [esp + 0x60], edx
push SysReAllocString
mov dword [esp + 0x68], edx
push ebx
stosb byte es:[edi], al
mov dword [esp + 0x48], ebp
mov dword [esp + 0x70], edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
xor eax, eax
cmp ebx, 0xffffffff
setne al
mov esi, eax
cmp esi, ebp
je 0x40999f
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
push ebp
lea ecx, [esp + 0x14]
push ecx
mov ebp, 0x2c
push ebp
lea edx, [esp + 0x64]
push edx
push ebx
call edi
test eax, eax
je 0x40993f
cmp dword [esp + 0x10], ebp
je 0x409943
xor esi, esi
jmp 0x40999f
mov eax, dword [esp + 0x60]
push 1
push 0
add eax, 0xffffffd4
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, eax
test esi, esi
je 0x40999f
push 0
lea ecx, [esp + 0x14]
push ecx
push ebp
lea edx, [esp + 0x38]
push edx
push ebx
call edi
test eax, eax
je 0x409976
cmp dword [esp + 0x10], ebp
je 0x40997a
xor esi, esi
jmp 0x40999f
xor eax, eax
mov edi, 0x423028
lea esi, [esp + 0x54]
mov ecx, 4
repe cmpsb byte [esi], byte es:[edi]
mov edx, eax
sete dl
mov dword [esp + 0x24], 1
mov esi, edx
test esi, esi
jne 0x4099b9
mov edi, dword [sym.imp.msvcrt.dll_printf]
push str.Invalid_file_header_n
call edi
add esp, 4
test esi, esi
je 0x409be7
jmp 0x4099bf
mov edi, dword [sym.imp.msvcrt.dll_printf]
mov esi, dword [esp + 0x48c]
mov al, byte [esi]
xor ebp, ebp
test al, al
mov dword [esp + 0x28], ebp
je 0x409a17
mov edi, esi
lea eax, [esp + 0x30]
push edi
push eax
call dword [sym.imp.msvcrt.dll__stricmp]
add esp, 8
test eax, eax
je 0x409a09
mov eax, edi
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4099f0
sub eax, edx
lea ebp, [eax + ebp + 1]
mov al, byte [esi + ebp]
test al, al
lea edi, [esi + ebp]
jne 0x4099d4
jmp 0x409a11
mov dword [esp + 0x28], 1
mov edi, dword [sym.imp.msvcrt.dll_printf]
mov esi, dword [esp + 0x28]
test esi, esi
jne 0x409a33
lea ecx, [esp + 0x30]
push ecx
push str.Untrusted_publisher_name:__s_n
call edi
add esp, 8
jmp 0x409be7
mov eax, dword [esp + 0x50]
test eax, eax
jle 0x409a5f
push 0
call dword [sym.imp.msvcrt.dll_time]
mov ecx, dword [esp + 0x54]
add esp, 4
cmp ecx, eax
jge 0x409a5f
push str.Signature_expired_n
call edi
add esp, 4
xor esi, esi
jmp 0x409be7
mov ebp, dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea edx, [esp + 0x14]
push edx
push 4
lea eax, [esp + 0x20]
push eax
push ebx
call ebp
test eax, eax
je 0x409a81
cmp dword [esp + 0x10], 4
je 0x409a88
xor esi, esi
jmp 0x409be7
mov edx, dword [esp + 0x14]
push 0
lea ecx, [esp + 0x14]
push ecx
push edx
lea eax, [esp + 0x90]
push eax
push ebx
call ebp
test eax, eax
je 0x409aad
mov eax, dword [esp + 0x14]
cmp dword [esp + 0x10], eax
je 0x409abb
push str.Failed_to_read_public_key_n
xor esi, esi
call edi
jmp 0x409be4
lea ecx, [esp + 0x20]
push ecx
push eax
mov eax, dword [esp + 0x24]
lea edx, [esp + 0x8c]
push edx
push eax
push 0xd
call fcn.0040aba0
xor ecx, ecx
add esp, 0x14
test eax, eax
setge cl
mov esi, ecx
test esi, esi
jne 0x409af1
push str.Failed_to_import_public_key_n
call edi
jmp 0x409be4
push 0
lea edx, [esp + 0x14]
push edx
push 4
lea eax, [esp + 0x24]
push eax
push ebx
call ebp
test eax, eax
je 0x409b0d
cmp dword [esp + 0x10], 4
je 0x409b14
xor esi, esi
jmp 0x409be7
mov edx, dword [esp + 0x18]
push 0
lea ecx, [esp + 0x14]
push ecx
push edx
lea eax, [esp + 0x290]
push eax
push ebx
call ebp
test eax, eax
je 0x409b39
mov ecx, dword [esp + 0x10]
cmp ecx, dword [esp + 0x18]
je 0x409b47
push str.Failed_to_read_signature_n
xor esi, esi
call edi
jmp 0x409be4
mov edx, dword [esp + 0x60]
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x14]
add edx, eax
lea esi, [edx + ecx + 4]
push esi
call dword [sym.imp.msvcrt.dll_malloc]
mov edi, eax
add esp, 4
test edi, edi
je 0x409b93
push 0
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
test eax, eax
jne 0x409b93
push eax
lea edx, [esp + 0x14]
push edx
push esi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x409b93
cmp dword [esp + 0x10], esi
je 0x409bad
mov eax, dword [esp + 0x488]
push eax
push str.Failed_to_read_file__s_n
xor esi, esi
call dword [sym.imp.msvcrt.dll_printf]
add esp, 8
jmp 0x409bd9
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x20]
push ecx
mov ecx, dword [esp + 0x20]
lea edx, [esp + 0x288]
push edx
push esi
push edi
push eax
push ecx
push 0x19
call fcn.0040aba0
xor edx, edx
add esp, 0x1c
test eax, eax
setge dl
mov esi, edx
test edi, edi
je 0x409be7
push edi
call dword [sym.imp.msvcrt.dll_free]
add esp, 4
cmp ebx, 0xffffffff
je 0x409bf3
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [esp + 0x24]
mov eax, dword [esp + 0x20]
test eax, eax
je 0x409c0a
push eax
push 0x12
call fcn.0040aba0
add esp, 8
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x409c1d
push eax
push 0x15
call fcn.0040aba0
add esp, 8
test esi, esi
pop esi
je 0x409c2e
pop edi
pop ebp
xor eax, eax
pop ebx
add esp, 0x474
ret
neg edi
sbb edi, edi
and edi, 0x80000007
inc edi
mov eax, edi
pop edi
pop ebp
pop ebx
add esp, 0x474
ret