Function at 0x405760
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x124
push ebx
push esi
mov esi, dword [esp + 0x138]
push edi
push ebp
mov edi, 0xffffffff
test esi, esi
je 0x405b5a
cmp dword [esp + 0x13c], 0
je 0x405b5a
push 2
mov eax, dword [esi]
push 0
push 0xffffff7e
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, edi
jne 0x4057a7
mov edi, 0xfffffffc
lea eax, [esp + 0x10]
push 0
lea ecx, [esp + 0x1c]
push eax
push 0x82
mov edx, dword [esi]
push ecx
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
push edx
call ebx
test eax, eax
jne 0x4057d9
mov ebp, 0xfffffffc
mov eax, ebp
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x124
ret
mov eax, 0x82
cmp dword [esp + 0x10], eax
jb 0x405905
cmp dword [esp + 0x96], eax
jne 0x405905
cmp dword [esp + 0x18], 0x10000
jne 0x405905
cmp word [esp + 0x86], 0x4b4d
jne 0x405905
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x18]
push eax
push ecx
call fcn.004056e0
mov ecx, dword [esp + 0x8e]
add esp, 8
shr ecx, 0x10
cmp ax, cx
jne 0x405905
mov ebp, dword [esp + 0x20]
mov ebx, dword [esp + 0x144]
and ebp, 0xffff
test ebx, ebx
je 0x4058e9
mov edi, ebx
xor eax, eax
mov ecx, 0x25
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov word [ebx + 0xa], 0x14
mov cx, word [esp + 0x20]
mov eax, dword [esp + 0x1c]
mov word [ebx + 8], cx
push str.SYM_DISK_IMAGE_FILE
lea edx, [ebx + 0xc]
mov dword [ebx], 0x20000
push edx
mov dword [ebx + 4], eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov cx, word [esp + 0x38]
mov edi, dword [esp + 0x3e]
mov word [ebx + 0x20], cx
lea edx, [esp + 0x3a]
lea ecx, [ebx + 0x22]
mov eax, dword [edx]
mov edx, dword [edx + 8]
mov dword [ecx], eax
lea eax, [ebx + 0x30]
mov dword [ecx + 4], edi
push eax
mov dword [ecx + 8], edx
mov word [ebx + 0x2e], 0x54
lea ecx, [esp + 0x4c]
push ecx
push ebx
call fcn.00405580
add esp, 0xc
mov ecx, dword [ebx]
mov dword [ebx + 0x92], 0x96
push ecx
push ebx
call fcn.004056e0
movzx eax, ax
shl eax, 0x10
add esp, 8
or eax, 0x4b4d
mov dword [ebx + 0x84], eax
push 0
mov eax, dword [esi]
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, ebp
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x124
ret
push 0
mov eax, dword [esi]
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x40591e
mov edi, 0xfffffffc
cmp edi, 0xfffffffc
je 0x405947
lea eax, [esp + 0x14]
push 0
lea ecx, [esp + 0xa0]
push eax
push 0x96
mov edx, dword [esi]
push ecx
push edx
call ebx
test eax, eax
jne 0x405947
mov eax, 0xffffffff
jmp 0x40594e
mov eax, dword [esp + 0x9c]
test eax, eax
jge 0x405964
mov ebp, 0xfffffffc
mov eax, ebp
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x124
ret
mov eax, 0x96
cmp dword [esp + 0x10], eax
jb 0x4059f7
cmp dword [esp + 0x12e], eax
jne 0x4059f7
cmp dword [esp + 0x9c], 0x20000
jne 0x4059f7
cmp word [esp + 0x120], 0x4b4d
jne 0x4059f7
mov eax, dword [esp + 0x9c]
lea ecx, [esp + 0x9c]
push eax
push ecx
call fcn.004056e0
mov ecx, dword [esp + 0x128]
add esp, 8
shr ecx, 0x10
cmp ax, cx
jne 0x4059f7
mov ebp, dword [esp + 0xa4]
mov ebx, dword [esp + 0x144]
and ebp, 0xffff
test ebx, ebx
je 0x405b4d
lea esi, [esp + 0x9c]
mov edi, ebx
mov ecx, 0x25
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov eax, ebp
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x124
ret
push 2
mov eax, dword [esi]
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, 0x2d0000
cmp eax, ecx
jge 0x405a4a
mov ecx, 0x168000
cmp eax, ecx
jge 0x405a4a
mov ecx, 0x12c000
cmp eax, ecx
jge 0x405a4a
mov ecx, 0xb4000
cmp eax, ecx
jge 0x405a4a
mov ecx, 0xa0000
cmp eax, ecx
jge 0x405a4a
mov ecx, 0x5a000
cmp eax, ecx
jge 0x405a4a
mov ecx, 0x50000
cmp eax, 0x50000
jge 0x405a4a
xor ecx, ecx
test ecx, ecx
jle 0x405b48
mov dword [esp + 0x9c], 0x20000
mov dword [esp + 0xa0], ecx
cmp ecx, 0xa0000
jle 0x405a7e
mov word [esp + 0xa4], 2
cmp ecx, 0x12c000
jne 0x405a88
mov word [esp + 0xa4], 1
lea eax, [esp + 0xa8]
push 0x14
mov word [esp + 0xaa], 0x14
push str.SYM_DISK_IMAGE_FILE
push eax
call sub.MFC30.DLL_afx_lstrcpyn
mov word [esp + 0xbc], 0xc
lea eax, [esp + 0xcc]
lea ecx, [esp + 0x9c]
mov byte [esp + 0xbe], 0
mov word [esp + 0xca], 0x54
mov dword [esp + 0x12e], 0x96
push eax
push 0
push ecx
call fcn.00405580
mov ecx, dword [esp + 0xa8]
lea edx, [esp + 0xa8]
add esp, 0xc
push ecx
push edx
call fcn.004056e0
movzx eax, ax
shl eax, 0x10
mov ebx, dword [esp + 0x14c]
add esp, 8
or eax, 0x4b4d
mov dword [esp + 0x120], eax
mov ebp, dword [esp + 0xa4]
and ebp, 0xffff
test ebx, ebx
je 0x405b4d
lea esi, [esp + 0x9c]
mov edi, ebx
mov ecx, 0x25
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov eax, ebp
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x124
ret
mov ebp, 0xffffffef
mov eax, ebp
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x124
ret
mov eax, 0xffffffff
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x124
ret