Function at 0x405180
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov dword [ebp - 0x48], ecx
mov eax, dword [ebp - 0x48]
cmp dword [eax + 8], 0
je 0x405197
jmp 0x405461
mov ecx, dword [ebp - 0x48]
cmp dword [ecx + 0x18], 0
je 0x4051a5
jmp 0x405461
mov edx, dword [ebp - 0x48]
movzx eax, byte [edx + 0x17]
cmp eax, 1
jne 0x40520e
mov ecx, dword [ebp - 0x48]
cmp dword [ecx + 4], 0xffff
jae 0x4051e9
push 0x2000
push 0
push 0
push 0
mov edx, dword [ebp - 0x48]
movzx eax, word [edx + 4]
push eax
mov ecx, 0x4d5a94
call fcn.00401410
push eax
call dword [sym.imp.USER32.dll_LoadImageW]
mov ecx, dword [ebp - 0x48]
mov dword [ecx + 8], eax
jmp 0x405209
push 0x2010
push 0
push 0
push 0
mov edx, dword [ebp - 0x48]
mov eax, dword [edx + 4]
push eax
push 0
call dword [sym.imp.USER32.dll_LoadImageW]
mov ecx, dword [ebp - 0x48]
mov dword [ecx + 8], eax
jmp 0x4053e9
mov edx, dword [ebp - 0x48]
cmp dword [edx + 4], 0xffff
jae 0x4052ef
lea ecx, [ebp - 8]
call fcn.00401f10
mov eax, dword [ebp - 0x48]
movzx ecx, byte [eax + 0x17]
cmp ecx, 2
jne 0x405285
push ecx
mov ecx, esp
mov dword [ebp - 0x30], esp
mov edx, dword [ebp - 0x48]
mov eax, dword [edx + 4]
push eax
call fcn.004018f0
push ecx
mov ecx, esp
mov dword [ebp - 0x34], esp
push 0x4bf7fc
call fcn.0041cbf0
lea ecx, [ebp - 8]
call fcn.00401c60
movzx ecx, al
test ecx, ecx
je 0x405285
lea ecx, [ebp - 8]
call fcn.00401cd0
push eax
lea ecx, [ebp - 8]
call fcn.00401cf0
push eax
call fcn.00404930
add esp, 8
mov edx, dword [ebp - 0x48]
mov dword [edx + 8], eax
jmp 0x4052e2
mov eax, dword [ebp - 0x48]
movzx ecx, byte [eax + 0x17]
cmp ecx, 3
jne 0x4052e2
push ecx
mov ecx, esp
mov dword [ebp - 0x38], esp
mov edx, dword [ebp - 0x48]
mov eax, dword [edx + 4]
push eax
call fcn.004018f0
push ecx
mov ecx, esp
mov dword [ebp - 0x3c], esp
push 0x4bf804
call fcn.0041cbf0
lea ecx, [ebp - 8]
call fcn.00401c60
movzx ecx, al
test ecx, ecx
je 0x4052e2
lea ecx, [ebp - 8]
call fcn.00401cd0
push eax
lea ecx, [ebp - 8]
call fcn.00401cf0
push eax
call fcn.00404690
add esp, 8
mov edx, dword [ebp - 0x48]
mov dword [edx + 8], eax
lea ecx, [ebp - 8]
call fcn.00401c40
jmp 0x4053e9
mov dword [ebp - 0xc], 0
push 0x4bf80c
mov eax, dword [ebp - 0x48]
mov ecx, dword [eax + 4]
push ecx
lea edx, [ebp - 0xc]
push edx
call fcn.004949bb
add esp, 0xc
test eax, eax
jne 0x4053e9
cmp dword [ebp - 0xc], 0
je 0x4053e9
push 2
push 0
mov eax, dword [ebp - 0xc]
push eax
call fcn.00495f74
add esp, 0xc
mov ecx, dword [ebp - 0xc]
push ecx
call fcn.00495e5b
add esp, 4
mov dword [ebp - 0x14], eax
push 0
push 0
mov edx, dword [ebp - 0xc]
push edx
call fcn.00495f74
add esp, 0xc
mov eax, dword [ebp - 0x14]
push eax
call fcn.004948d0
add esp, 4
mov dword [ebp - 0x40], eax
mov ecx, dword [ebp - 0x40]
mov dword [ebp - 0x10], ecx
cmp dword [ebp - 0x10], 0
je 0x4053dd
mov edx, dword [ebp - 0xc]
push edx
mov eax, dword [ebp - 0x14]
push eax
push 1
mov ecx, dword [ebp - 0x10]
push ecx
call fcn.00495c24
add esp, 0x10
cmp dword [ebp - 0x14], eax
jne 0x4053cb
mov edx, dword [ebp - 0x48]
movzx eax, byte [edx + 0x17]
cmp eax, 2
jne 0x4053a9
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [ebp - 0x10]
push edx
call fcn.00404930
add esp, 8
mov ecx, dword [ebp - 0x48]
mov dword [ecx + 8], eax
jmp 0x4053cb
mov edx, dword [ebp - 0x48]
movzx eax, byte [edx + 0x17]
cmp eax, 3
jne 0x4053cb
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [ebp - 0x10]
push edx
call fcn.00404690
add esp, 8
mov ecx, dword [ebp - 0x48]
mov dword [ecx + 8], eax
mov edx, dword [ebp - 0x10]
mov dword [ebp - 0x44], edx
mov eax, dword [ebp - 0x44]
push eax
call fcn.00495979
add esp, 4
mov ecx, dword [ebp - 0xc]
push ecx
call fcn.004960c3
add esp, 4
mov edx, dword [ebp - 0x48]
cmp dword [edx + 8], 0
jne 0x405418
xor eax, eax
mov ecx, dword [ebp - 0x48]
mov word [ecx + 0x14], ax
mov edx, dword [ebp - 0x48]
mov dword [edx + 0xc], 0
mov eax, dword [ebp - 0x48]
mov dword [eax + 0x10], 0
mov ecx, dword [ebp - 0x48]
mov byte [ecx + 0x16], 0
jmp 0x405457
lea edx, [ebp - 0x2c]
push edx
push 0x18
mov eax, dword [ebp - 0x48]
mov ecx, dword [eax + 8]
push ecx
call dword [sym.imp.GDI32.dll_GetObjectW]
mov edx, dword [ebp - 0x48]
movzx ecx, word [edx + 0x14]
mov eax, dword [ebp - 0x28]
cdq
idiv ecx
mov edx, dword [ebp - 0x48]
mov dword [edx + 0xc], eax
mov eax, dword [ebp - 0x48]
mov ecx, dword [ebp - 0x24]
mov dword [eax + 0x10], ecx
movzx edx, word [ebp - 0x1a]
cmp edx, 0x20
sete al
mov ecx, dword [ebp - 0x48]
mov byte [ecx + 0x16], al
mov edx, dword [ebp - 0x48]
mov dword [edx + 0x18], 1
mov esp, ebp
pop ebp
ret