Function at 0x403600
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x10
push ebx
mov ebx, dword [esp + 0x1c]
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
mov esi, dword [esp + 0x20]
push edi
lea eax, [esp + 0x10]
push 0
push eax
lea ecx, [esi + 0x10]
push 0x100
push ecx
push ebx
mov dword [esp + 0x24], 0
call ebp
test eax, eax
je 0x40399f
lea edx, [esp + 0x10]
push 0
push edx
lea eax, [esp + 0x30]
push 4
push eax
push ebx
call ebp
test eax, eax
je 0x40399f
mov eax, dword [esp + 0x28]
cmp eax, 0x400
jg 0x403992
test eax, eax
jl 0x403992
mov edi, dword [sym.imp.KERNEL32.dll_GlobalAlloc]
lea ecx, [eax + eax*4]
shl ecx, 3
sub ecx, eax
push ecx
push 0
call edi
mov ecx, dword [esp + 0x28]
lea edx, [esp + 0x10]
push 0
push edx
lea edx, [ecx + ecx*4]
mov dword [esi + 0x110], eax
shl edx, 3
sub edx, ecx
push edx
push eax
push ebx
call ebp
test eax, eax
je 0x40399f
mov eax, dword [esp + 0x28]
lea ecx, [esp + 0x10]
push 0
push ecx
lea edx, [esp + 0x30]
push 4
push edx
push ebx
mov dword [esi + 0x2228], eax
call ebp
test eax, eax
je 0x40399f
mov eax, dword [esp + 0x28]
cmp eax, 0x10000
jg 0x40398b
test eax, eax
jl 0x40398b
shl eax, 4
push eax
push 0
call edi
mov edx, dword [esp + 0x28]
lea ecx, [esp + 0x10]
push 0
push ecx
shl edx, 4
push edx
push eax
push ebx
mov dword [esi + 0x114], eax
call ebp
test eax, eax
je 0x40399f
lea eax, [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x30]
push 4
push ecx
push ebx
call ebp
test eax, eax
je 0x40399f
mov eax, dword [esp + 0x28]
cmp eax, 0x2000
jg 0x403984
test eax, eax
jl 0x403984
lea edx, [eax + eax*4]
shl edx, 2
push edx
push 0
call edi
mov ecx, dword [esp + 0x28]
xor edx, edx
cmp ecx, edx
mov dword [esp + 0x1c], eax
mov dword [esi + 0x118], eax
mov dword [esi + 0x222c], ecx
mov dword [esp + 0x14], edx
jle 0x4037f7
mov dword [esp + 0x18], edx
jmp 0x40376b
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x10]
push 0
push edx
lea esi, [ecx + eax]
push 0x14
push esi
push ebx
call ebp
test eax, eax
je 0x40399f
mov edi, dword [esi + 8]
imul edi, dword [esi + 4]
mov dword [esi], 0
mov al, byte [esi + 0xc]
test al, 1
je 0x4037a1
add edi, 0x400
mov eax, dword [esi + 0x10]
test eax, eax
je 0x4037aa
mov edi, eax
test edi, edi
je 0x4037cd
push edi
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
lea ecx, [esp + 0x10]
push 0
push ecx
push edi
push eax
push ebx
mov dword [esi], eax
call ebp
test eax, eax
je 0x40399f
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x28]
inc eax
add edx, 0x14
cmp eax, ecx
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], edx
jl 0x403767
mov edi, dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov esi, dword [esp + 0x24]
lea edx, [esp + 0x10]
push 0
push edx
lea eax, [esi + 0x11c]
push 0x2100
push eax
push ebx
call ebp
test eax, eax
je 0x40399f
lea ecx, [esp + 0x10]
push 0
push ecx
lea edx, [esp + 0x30]
push 4
push edx
push ebx
call ebp
test eax, eax
je 0x40399f
mov ecx, dword [esp + 0x28]
cmp ecx, 0x100
jg 0x40397d
test ecx, ecx
jl 0x40397d
lea eax, [ecx*8]
sub eax, ecx
lea eax, [eax + eax*2]
shl eax, 1
push eax
push 0
call edi
mov ecx, eax
mov eax, dword [esp + 0x28]
mov dword [esi + 0x221c], ecx
mov dword [esi + 0x2230], eax
xor esi, esi
mov dword [esp + 0x1c], ecx
cmp eax, esi
mov dword [esp + 0x14], esi
jle 0x403952
mov dword [esp + 0x18], esi
jmp 0x403887
mov ecx, dword [esp + 0x1c]
add esi, ecx
lea ecx, [esp + 0x10]
push 0
push ecx
push 0x2a
push esi
push ebx
call ebp
test eax, eax
je 0x40399f
mov ebp, dword [esi + 0x24]
test ebp, ebp
je 0x40392c
push ebp
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edi, eax
push edi
mov dword [esi], edi
call dword [sym.imp.KERNEL32.dll_GlobalSize]
cmp eax, ebp
jb 0x403970
lea edx, [esp + 0x10]
push 0
push edx
push ebp
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40399f
mov eax, dword [0x42474c]
test eax, eax
je 0x40392c
mov al, byte [esi + 0x28]
and eax, 0xf
dec eax
jne 0x40392c
mov eax, dword [0x4280cc]
push 1
push edi
push eax
call fcn.00415cd0
mov ecx, dword [esp + 0x30]
mov edi, dword [esp + 0x20]
add esp, 0xc
mov dword [esi + 0x24], eax
mov edx, dword [ecx + 0x2220]
shl edx, 8
add edx, edi
mov dword [edx*4 + 0x430640], eax
mov eax, dword [esi]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov dword [esi], 0
mov eax, dword [esp + 0x14]
mov esi, dword [esp + 0x18]
mov ecx, dword [esp + 0x28]
mov ebp, dword [sym.imp.KERNEL32.dll_ReadFile]
inc eax
add esi, 0x2a
cmp eax, ecx
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], esi
jl 0x403883
lea ecx, [esp + 0x10]
push 0
push ecx
lea edx, [esp + 0x2c]
push 4
push edx
push ebx
call ebp
neg eax
pop edi
pop esi
sbb eax, eax
pop ebp
inc eax
pop ebx
add esp, 0x10
ret
pop edi
pop esi
pop ebp
mov eax, 2
pop ebx
add esp, 0x10
ret
push 0x41e894
jmp 0x403997
push 0x41e87c
jmp 0x403997
push 0x41e858
jmp 0x403997
push 0x41e83c
call fcn.00414880
add esp, 4
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x10
ret