Function at 0x4050f0
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 0x405107
jmp 0x4053d1
mov ecx, dword [ebp - 0x48]
cmp dword [ecx + 0x18], 0
je 0x405115
jmp 0x4053d1
mov edx, dword [ebp - 0x48]
movzx eax, byte [edx + 0x17]
cmp eax, 1
jne 0x40517e
mov ecx, dword [ebp - 0x48]
cmp dword [ecx + 4], 0xffff
jae 0x405159
push 0x2000
push 0
push 0
push 0
mov edx, dword [ebp - 0x48]
movzx eax, word [edx + 4]
push eax
mov ecx, 0x4d717c
call fcn.00401410
push eax
call dword [sym.imp.USER32.dll_LoadImageW]
mov ecx, dword [ebp - 0x48]
mov dword [ecx + 8], eax
jmp 0x405179
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 0x405359
mov edx, dword [ebp - 0x48]
cmp dword [edx + 4], 0xffff
jae 0x40525f
lea ecx, [ebp - 8]
call fcn.00401ec0
mov eax, dword [ebp - 0x48]
movzx ecx, byte [eax + 0x17]
cmp ecx, 2
jne 0x4051f5
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 0x4c1a58
call fcn.00436a40
lea ecx, [ebp - 8]
call fcn.00401c10
movzx ecx, al
test ecx, ecx
je 0x4051f5
lea ecx, [ebp - 8]
call fcn.00401c80
push eax
lea ecx, [ebp - 8]
call fcn.00401ca0
push eax
call fcn.004048a0
add esp, 8
mov edx, dword [ebp - 0x48]
mov dword [edx + 8], eax
jmp 0x405252
mov eax, dword [ebp - 0x48]
movzx ecx, byte [eax + 0x17]
cmp ecx, 3
jne 0x405252
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 0x4c1a60
call fcn.00436a40
lea ecx, [ebp - 8]
call fcn.00401c10
movzx ecx, al
test ecx, ecx
je 0x405252
lea ecx, [ebp - 8]
call fcn.00401c80
push eax
lea ecx, [ebp - 8]
call fcn.00401ca0
push eax
call fcn.00404670
add esp, 8
mov edx, dword [ebp - 0x48]
mov dword [edx + 8], eax
lea ecx, [ebp - 8]
call fcn.00401bf0
jmp 0x405359
mov dword [ebp - 0xc], 0
push 0x4c1a68
mov eax, dword [ebp - 0x48]
mov ecx, dword [eax + 4]
push ecx
lea edx, [ebp - 0xc]
push edx
call fcn.00495440
add esp, 0xc
test eax, eax
jne 0x405359
cmp dword [ebp - 0xc], 0
je 0x405359
push 2
push 0
mov eax, dword [ebp - 0xc]
push eax
call fcn.00496a06
add esp, 0xc
mov ecx, dword [ebp - 0xc]
push ecx
call fcn.004968ed
add esp, 4
mov dword [ebp - 0x14], eax
push 0
push 0
mov edx, dword [ebp - 0xc]
push edx
call fcn.00496a06
add esp, 0xc
mov eax, dword [ebp - 0x14]
push eax
call fcn.00495360
add esp, 4
mov dword [ebp - 0x40], eax
mov ecx, dword [ebp - 0x40]
mov dword [ebp - 0x10], ecx
cmp dword [ebp - 0x10], 0
je 0x40534d
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.004966b6
add esp, 0x10
cmp dword [ebp - 0x14], eax
jne 0x40533b
mov edx, dword [ebp - 0x48]
movzx eax, byte [edx + 0x17]
cmp eax, 2
jne 0x405319
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [ebp - 0x10]
push edx
call fcn.004048a0
add esp, 8
mov ecx, dword [ebp - 0x48]
mov dword [ecx + 8], eax
jmp 0x40533b
mov edx, dword [ebp - 0x48]
movzx eax, byte [edx + 0x17]
cmp eax, 3
jne 0x40533b
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [ebp - 0x10]
push edx
call fcn.00404670
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.0049640b
add esp, 4
mov ecx, dword [ebp - 0xc]
push ecx
call fcn.00496b53
add esp, 4
mov edx, dword [ebp - 0x48]
cmp dword [edx + 8], 0
jne 0x405388
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 0x4053c7
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