Function at 0x405940
Capabilities:
Read file on windows

Disassembly:
pop edx
xor eax, 0x96adddb
or byte [edi - 0x3efc2e87], bl
in al, dx
nop
pop esi
jge 0x405962
push esi
mov al, byte [esi + 7]
jb 0x4058dd
pop es
lea ebx, [ebp + 0x1e9ccb9a]
and edi, dword [esi - 0x7f]
sbb dh, ah
and byte [eax + 0x5e5f719e], 0x5b
push ebp
mov ebp, esp
add esp, 0xfffffac8
push ebx
push esi
push edi
push edi
push ebp
push esi
or edi, 0xffffffff
inc edi
call fcn.00405dce
dec edx
dec edx
pop edx
jp 0x405911
cld
sti
xchg ebp, eax
arpl dx, sp
test dword [edi + 0x4c], esp
lodsb al, byte [esi]
mov dl, dh
pop edi
sbb al, 0xd4
dec edi
shl ebx, 1
pop ds
shl byte [ecx + edx*4 - 0x55], 0xfb
dec edi
jns 0x4059ac
stosd dword es:[edi], eax
popfd
or bl, byte [ebp - 0x3cb8174c]
invalid
pop ecx
xor edx, 0xe8be09f0
lea edx, [edi + eax - 0x6d]
and edx, 0xab3566ea
lea edx, [ebx + ebp + 0x837ba]
sub edx, ebp
sub edx, ebx
lea ecx, [ecx + edx]
sub edx, 0xffffffd1
mov edx, 0x407a9a
mov edx, dword [ecx]
and edx, 0xff
ror ecx, 5
mov ecx, 0x4a5882
xor ecx, dword [esp + 8]
sbb ecx, 0x75
add ecx, dword [esp + 0x18]
rol ecx, 0xdf
lea ecx, [eax + edx + 0x3158cec5]
sub ecx, edx
sub ecx, eax
lea edx, [edx + eax - 0x3158cfad]
sub edx, eax
lea edx, [edx + ecx]
test edx, edx
je 0x405a36
rol ebp, 0x47
rcl ebp, 0x63
and esi, edi
mov edi, 0x486402
xor edi, dword [esp + 0x28]
push dword fs:[0]
jmp 0x405a36
pop edx
pop ecx
jmp 0x405a9d
mov esi, 0x48debb
lea edi, [ebp - 0x234]
mov ecx, 0x80
rep movsd dword es:[edi], dword [esi]
xor eax, eax
mov dword [ebp - 8], eax
push 0
push pe_nt_image_headers32
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
call fcn.00481980
mov dword [ebp + 0x10], eax
mov dword [ebp + 0x14], edx
push dword [ebp + 0x18]
call fcn.0047e904
pop ecx
add eax, 0x1f
push eax
call fcn.0047e1d8
pop ecx
mov dword [ebp - 0x10], eax
push dword [ebp + 0x18]
call fcn.0047e904
pop ecx
add eax, 0x1f
push eax
push 0
push dword [ebp - 0x10]
call fcn.0047e7f4
add esp, 0xc
push 0
push 0
push 3
push 0
push 3
push 0xc0000000
push dword [ebp + 0x18]
call sub.kernel32.dll_CreateFileA
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0xffffffff
jne 0x405b31
push 0
push 0
push 0x48e75c
push 0
call sub.user32.dll_MessageBoxA
jmp 0x405e59
push 0
push 0
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push dword [ebp - 0x1c]
call sub.kernel32.dll_SetFilePointerEx
push 0
lea eax, [ebp - 4]
push eax
push pe_nt_image_headers32
lea edx, [ebp - 0x234]
push edx
push dword [ebp - 0x1c]
call sub.kernel32.dll_ReadFile
test eax, eax
jne 0x405b7e
push 0
push 0
push 0x48e772
push 0
call sub.user32.dll_MessageBoxA
push dword [ebp - 0x1c]
call sub.kernel32.dll_CloseHandle
jmp 0x405e59
cmp dword [ebp - 0x1c], 0xffffffff
je 0x405b8c
push dword [ebp - 0x1c]
call sub.kernel32.dll_CloseHandle
mov dword [ebp - 0x20], 0x1c6
xor ecx, ecx
mov dword [ebp - 0x24], ecx
jmp 0x405db2
mov eax, dword [ebp - 0x20]
movsx edx, byte [ebp + eax - 0x238]
cmp edx, 5
je 0x405bbd
mov ecx, dword [ebp - 0x20]
movsx eax, byte [ebp + ecx - 0x238]
cmp eax, 0xf
jne 0x405bfc
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp + edx - 0x234]
xor edx, edx
add eax, dword [0x494c10]
adc edx, dword [0x494c14]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], edx
push dword [ebp + 0x18]
push dword [ebp - 0x14]
push dword [ebp - 0x18]
mov al, byte [ebp + 0xc]
push eax
push dword [ebp + 8]
call fcn.00405940
add esp, 0x14
add dword [ebp - 0x20], 0x10
jmp 0x405daf
mov edx, dword [ebp - 0x20]
cmp byte [ebp + edx - 0x238], 0
je 0x405dc0
cmp byte [ebp + 0xc], 0
je 0x405c3f
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
add eax, 0x7e00
adc edx, 0
mov ecx, dword [ebp - 0x10]
mov dword [ecx + 8], eax
mov dword [ecx + 0xc], edx
mov eax, dword [ebp - 0x10]
cmp dword [eax + 0xc], 0
jne 0x405c6c
cmp dword [eax + 8], 0
je 0x405dc0
jmp 0x405c6c
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
add eax, 0x7e00
adc edx, 0
mov ecx, dword [ebp - 0x10]
mov dword [ecx + 8], eax
mov dword [ecx + 0xc], edx
mov eax, dword [ebp - 0x10]
cmp dword [eax + 0xc], 0
jne 0x405c6c
cmp dword [eax + 8], 0x200
je 0x405dc0
push dword [ebp + 0x18]
push 0x48e77d
mov edx, dword [ebp - 0x10]
add edx, 0x14
push edx
call fcn.00480484
add esp, 0xc
mov ecx, dword [ebp - 0x10]
add ecx, 0x14
push ecx
call fcn.0047e904
pop ecx
mov edx, dword [ebp - 0x10]
mov word [edx + 0x12], ax
mov eax, dword [ebp - 0x20]
mov eax, dword [ebp + eax - 0x230]
xor edx, edx
mov ecx, dword [ebp - 0x10]
mov dword [ecx], eax
mov dword [ecx + 4], edx
push 0
push pe_nt_image_headers32
mov eax, dword [ebp - 0x10]
mov ebx, eax
mov eax, dword [ebx]
mov edx, dword [ebx + 4]
call fcn.00481980
mov dword [ebx], eax
mov dword [ebx + 4], edx
add dword [ebp - 0x20], 0x10
mov ecx, dword [ebp + 8]
mov al, byte [ecx]
mov byte [ebp - 0x25], al
jmp 0x405d2c
movsx edx, byte [ebp - 0x25]
push edx
push 0x48e784
lea ecx, [ebp - 0x434]
push ecx
call fcn.00480484
add esp, 0xc
push 0
push 0
push 3
push 0
push 3
push 0x80000000
lea eax, [ebp - 0x434]
push eax
call sub.kernel32.dll_CreateFileA
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0xffffffff
jne 0x405d21
call fcn.00403130
mov dword [ebp - 8], eax
mov dl, byte [ebp - 0x25]
mov byte [ebp - 9], dl
jmp 0x405d35
push dword [ebp - 0x2c]
call sub.kernel32.dll_CloseHandle
inc byte [ebp - 0x25]
movsx ecx, byte [ebp - 0x25]
cmp ecx, 0x5a
jle 0x405cd4
push 0
mov al, byte [ebp - 9]
push eax
push dword [ebp - 0x10]
push dword [ebp - 8]
call fcn.00401ea8
add esp, 0x10
mov dword [ebp - 0x34], eax
push dword [ebp + 0x18]
call fcn.0047e904
pop ecx
add eax, 0x1f
push eax
push 0
push dword [ebp - 0x10]
call fcn.0047e7f4
add esp, 0xc
cmp dword [ebp - 0x34], 0
je 0x405daf
mov esi, 0x48e0bb
lea edi, [ebp - 0x538]
mov ecx, 0x41
rep movsd dword es:[edi], dword [esi]
push dword [ebp - 0x34]
movsx eax, byte [ebp - 9]
push eax
push dword [ebp - 8]
push 0x48e78c
lea edx, [ebp - 0x538]
push edx
call fcn.00480484
add esp, 0x14
push 0
push 0
lea ecx, [ebp - 0x538]
push ecx
push 0
call sub.user32.dll_MessageBoxA
inc dword [ebp - 0x24]
call fcn.004030b8
cmp eax, dword [ebp - 0x24]
jg 0x405b9d
push dword [ebp - 0x10]
call fcn.0047dcdc
pop ecx
jmp 0x405e22
jmp 0x405e59
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret