Function at 0x409130
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
push ebx
push esi
push edi
push 0x3c
lea eax, [ebp - 0x48]
mov dword [ebp - 8], 0
mov edi, edx
mov dword [ebp - 4], 0
push 0
push eax
mov dword [ebp - 0xc], edi
mov esi, ecx
call fcn.0042a4e0
mov eax, dword [ebp + 8]
add esp, 0xc
mov ebx, dword [ebp + 0xc]
mov dword [eax + 8], 1
mov dword [eax], 0xc
mov dword [eax + 4], 0x26
xor eax, eax
mov word [edi + 2], ax
mov dword [edi + 4], eax
mov dword [edi + 8], eax
mov dword [edi + 0x14], eax
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
test ebx, ebx
je 0x409198
push eax
push eax
push ebx
push dword [esi]
call edi
push 0
lea eax, [ebp - 8]
push eax
push 0x28
lea eax, [ebp - 0x48]
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40940d
mov eax, dword [ebp - 8]
cmp eax, 0x24
jb 0x40940d
cmp dword [ebp - 0x48], 0x4643534d
jne 0x40940d
cmp word [ebp - 0x2c], 0
jne 0x4091ed
mov edx, dword [ebp + 8]
mov dword [edx], 0xb
mov dword [edx + 4], 0x12
pop edi
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret
cmp eax, 0x28
jb 0x4091e4
mov al, byte [ebp - 0x2a]
test al, 7
je 0x40924d
test al, 4
je 0x409206
movzx eax, word [ebp - 0x24]
add eax, 0x28
jmp 0x40920b
mov eax, 0x24
push 0
push 0
push eax
push dword [esi]
mov dword [ebp - 4], eax
call edi
cmp dword [ebp - 4], eax
jne 0x40923b
test byte [ebp - 0x2a], 3
jne 0x40923b
push 0
lea eax, [ebp - 8]
push eax
push 4
lea eax, [ebp - 4]
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 4]
jmp 0x409253
mov edx, dword [ebp + 8]
mov al, 1
pop edi
pop esi
pop ebx
mov dword [edx], 9
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x24]
mov dword [ebp - 4], eax
test eax, eax
je 0x4091e4
mov ecx, dword [ebp - 0x38]
cmp eax, ecx
jb 0x4091e4
cmp eax, dword [ebp - 0x40]
ja 0x4091e4
push 0
push 0
lea eax, [ecx + ebx]
push eax
push dword [esi]
call edi
cmp eax, 0xffffffff
je 0x4091e4
mov eax, dword [ebp - 4]
sub eax, dword [ebp - 0x38]
mov dword [ebp - 4], eax
add eax, 0x12
push eax
push 0
push dword [0x45764c]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
mov dword [ebp + 0xc], ebx
test ebx, ebx
jne 0x4092b5
mov edx, dword [ebp + 8]
mov al, 1
pop edi
pop esi
pop ebx
mov dword [edx], 5
mov dword [edx + 4], 8
mov esp, ebp
pop ebp
ret
push 0
lea eax, [ebp - 8]
push eax
push dword [ebp - 4]
push ebx
push dword [esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4093f5
mov eax, dword [ebp - 8]
cmp eax, 0x11
jb 0x4093f5
xorps xmm0, xmm0
movups xmmword [eax + ebx], xmm0
mov word [eax + ebx + 0x10], 0
mov di, word [ebp - 0x2c]
test di, di
je 0x4093a9
mov esi, dword [ebp - 8]
nop dword [eax]
mov ecx, dword [ebp - 0xc]
lea edx, [ebx + 0x10]
mov eax, dword [ebx]
add dword [ecx + 4], eax
inc word [ecx + 2]
test edx, edx
je 0x409361
mov ecx, 0x100
mov eax, edx
nop word [eax + eax]
cmp byte [eax], 0
je 0x40932b
inc eax
sub ecx, 1
jne 0x409320
test ecx, ecx
je 0x409340
mov eax, 0x100
sub eax, ecx
mov dword [0x457630], eax
movzx eax, ax
jmp 0x40934c
mov dword [0x457630], 0
xor eax, eax
movzx eax, ax
test ecx, ecx
je 0x409361
inc eax
movzx eax, ax
mov word [0x457630], ax
mov ecx, eax
jmp 0x40937d
mov dword [0x457630], 0
test edx, edx
je 0x40937b
cmp byte [edx], 0
je 0x40937b
mov ecx, 0x100
jmp 0x40937d
xor ecx, ecx
movzx eax, cx
add eax, 0x10
add ebx, eax
mov eax, 0xffff
add di, ax
lea eax, [ecx + 0x10]
movzx eax, ax
mov word [ebp - 0x2c], di
cmp esi, eax
jbe 0x4093a9
sub esi, eax
mov dword [ebp - 8], esi
test di, di
jne 0x409300
push dword [ebp + 0xc]
push 0
push dword [0x45764c]
call dword [sym.imp.KERNEL32.dll_HeapFree]
cmp word [ebp - 0x2c], 0
mov edx, dword [ebp + 8]
je 0x4093dc
pop edi
mov eax, 0x7a
mov ecx, 4
mov dword [edx], ecx
pop esi
mov dword [edx + 4], eax
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret
xor eax, eax
mov dword [edx + 8], 0
pop edi
xor ecx, ecx
mov dword [edx], ecx
pop esi
mov dword [edx + 4], eax
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
push 0
push dword [0x45764c]
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop edi
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp + 8]
xor al, al
pop edi
pop esi
pop ebx
mov dword [edx], 2
mov dword [edx + 4], 0xd
mov esp, ebp
pop ebp
ret