Function at 0x40c470
Capabilities:
Extract resource via kernel32 functions
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4497e8
mov eax, dword fs:[0]
push eax
sub esp, 0x2c
push ebx
push esi
mov eax, dword [0x45b030]
xor eax, esp
push eax
lea eax, [esp + 0x38]
mov dword fs:[0], eax
xor ebx, ebx
cmp dword [edi + 8], ebx
jne 0x40c819
mov al, byte [edi + 0x17]
cmp al, 1
jne 0x40c4f0
mov eax, dword [edi + 4]
cmp eax, 0xffff
jae 0x40c4d8
mov ecx, dword [0x45e588]
push 0x2000
push ebx
push ebx
movzx eax, ax
push ebx
push eax
push ecx
call dword [sym.imp.USER32.dll_LoadImageW]
mov dword [edi + 8], eax
jmp 0x40c7c2
push 0x2010
push ebx
push ebx
push ebx
push eax
push ebx
call dword [sym.imp.USER32.dll_LoadImageW]
mov dword [edi + 8], eax
jmp 0x40c7c2
mov ecx, dword [edi + 4]
cmp ecx, 0xffff
jae 0x40c666
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x40], ebx
cmp al, 3
jne 0x40c5a1
push ecx
mov eax, esp
movzx edx, cx
mov dword [esp + 0x1c], esp
push ecx
mov dword [eax], edx
mov eax, esp
lea esi, [esp + 0x18]
mov dword [esp + 0x20], esp
mov dword [eax], 0x4502fc
call fcn.0040c3d0
test al, al
je 0x40c5a1
mov eax, dword [0x45f220]
mov dword [esp + 0xc], ebx
cmp eax, ebx
je 0x40c54f
lea ecx, [esp + 0xc]
push ecx
push 0x1a
call eax
lea esi, [esp + 0x1c]
lea eax, [esp + 0xc]
call fcn.0040c410
mov byte [esp + 0x40], 2
mov edx, dword [esp + 0x14]
mov esi, dword [eax]
mov eax, dword [0x45e588]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov ecx, dword [esp + 0x10]
push ecx
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov edx, dword [esi]
push ebx
push eax
mov eax, dword [edx + 0xc]
push esi
call eax
lea ecx, [esp + 0x1c]
mov dword [edi + 8], eax
mov byte [esp + 0x40], 1
call fcn.00411b90
jmp 0x40c637
cmp byte [edi + 0x17], 2
jne 0x40c64e
mov eax, dword [edi + 4]
push ecx
movzx eax, ax
mov ecx, esp
mov dword [esp + 0x1c], esp
push ecx
mov dword [ecx], eax
mov eax, esp
lea esi, [esp + 0x18]
mov dword [esp + 0x20], esp
mov dword [eax], 0x450304
call fcn.0040c3d0
test al, al
je 0x40c64e
mov eax, dword [0x45f220]
mov dword [esp + 0xc], ebx
cmp eax, ebx
je 0x40c5ea
lea ecx, [esp + 0xc]
push ecx
push 0x1b
call eax
lea esi, [esp + 0x1c]
lea eax, [esp + 0xc]
call fcn.0040c410
mov byte [esp + 0x40], 4
mov edx, dword [esp + 0x14]
mov esi, dword [eax]
mov eax, dword [0x45e588]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov ecx, dword [esp + 0x10]
push ecx
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov edx, dword [esi]
push ebx
push eax
mov eax, dword [edx + 0xc]
push esi
call eax
lea ecx, [esp + 0x1c]
mov dword [edi + 8], eax
mov byte [esp + 0x40], 3
call fcn.00411b90
mov byte [esp + 0x40], 0
mov eax, dword [esp + 0xc]
test eax, eax
je 0x40c64c
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
xor ebx, ebx
mov eax, dword [esp + 0x10]
cmp eax, ebx
je 0x40c7c2
push eax
call dword [sym.imp.KERNEL32.dll_FreeResource]
jmp 0x40c7c2
push 0x45030c
push ecx
lea eax, [esp + 0x14]
push eax
mov dword [esp + 0x18], ebx
call fcn.00431004
add esp, 0xc
test eax, eax
jne 0x40c7c2
mov eax, dword [esp + 0xc]
cmp eax, ebx
je 0x40c7c2
push 2
push ebx
push eax
call fcn.00430cae
mov ecx, dword [esp + 0x18]
add esp, 0xc
push ecx
call fcn.00430ed0
mov edx, dword [esp + 0x10]
add esp, 4
xor esi, esi
push esi
push esi
push edx
mov ebx, eax
call fcn.00430cae
add esp, 0xc
push ebx
call fcn.00430759
add esp, 4
mov dword [esp + 0x18], eax
cmp eax, esi
je 0x40c7b3
mov ecx, dword [esp + 0xc]
push ecx
push ebx
push 1
push eax
call fcn.00430c07
mov al, byte [edi + 0x17]
add esp, 0x10
cmp al, 3
jne 0x40c73b
mov eax, dword [0x45f220]
mov dword [esp + 0x10], esi
cmp eax, esi
je 0x40c700
lea edx, [esp + 0x10]
push edx
push 0x1a
call eax
lea esi, [esp + 0x1c]
lea eax, [esp + 0x10]
mov dword [esp + 0x40], 5
call fcn.0040c410
mov edx, dword [esp + 0x18]
mov byte [esp + 0x40], 6
mov eax, dword [eax]
mov ecx, dword [eax]
push ebx
push edx
push eax
mov eax, dword [ecx + 0xc]
call eax
mov ecx, esi
mov dword [edi + 8], eax
mov byte [esp + 0x40], 5
call fcn.00411b90
jmp 0x40c78e
cmp al, 2
jne 0x40c7a6
mov eax, dword [0x45f220]
mov dword [esp + 0x10], esi
cmp eax, esi
je 0x40c755
lea ecx, [esp + 0x10]
push ecx
push 0x1b
call eax
lea esi, [esp + 0x1c]
lea eax, [esp + 0x10]
mov dword [esp + 0x40], 7
call fcn.0040c410
mov ecx, dword [esp + 0x18]
mov byte [esp + 0x40], 8
mov eax, dword [eax]
mov edx, dword [eax]
mov edx, dword [edx + 0xc]
push ebx
push ecx
push eax
call edx
mov ecx, esi
mov dword [edi + 8], eax
mov byte [esp + 0x40], 7
call fcn.00411b90
mov dword [esp + 0x40], 0xffffffff
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40c7a6
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov eax, dword [esp + 0x18]
push eax
call fcn.004308e1
add esp, 4
mov ecx, dword [esp + 0xc]
push ecx
call fcn.00430865
add esp, 4
xor ebx, ebx
mov eax, dword [edi + 8]
cmp eax, ebx
jne 0x40c7ea
xor edx, edx
mov word [edi + 0x14], dx
mov dword [edi + 0xc], ebx
mov dword [edi + 0x10], ebx
mov byte [edi + 0x16], dl
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea ecx, [esp + 0x1c]
push ecx
push 0x18
push eax
call dword [sym.imp.GDI32.dll_GetObjectW]
mov eax, dword [esp + 0x20]
movzx ecx, word [edi + 0x14]
cdq
idiv ecx
cmp word [esp + 0x2e], 0x20
mov edx, dword [esp + 0x24]
mov dword [edi + 0x10], edx
mov dword [edi + 0xc], eax
sete al
mov byte [edi + 0x16], al
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebx
mov esp, ebp
pop ebp
ret