Function at 0x4781a0
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x70
test byte [0x50088c], 1
push ebx
mov ebx, dword [0x4cf308]
push esi
mov esi, dword [0x4cf314]
jne 0x4781db
or dword [0x50088c], 1
push 0x4dfe90
push str.msimg32.dll
call ebx
push eax
call esi
mov dword [0x500888], eax
test byte [0x50088c], 2
jne 0x4781ff
or dword [0x50088c], 2
push str.GradientFill
push str.msimg32.dll
call ebx
push eax
call esi
mov dword [0x500884], eax
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x10]
mov edx, ecx
shr edx, 0x18
mov esi, eax
shr esi, 0x18
add edx, esi
shr edx, 1
test dl, dl
mov byte [esp + 9], dl
je 0x4784f2
mov esi, dword [edi + 0xc]
sub esi, dword [edi + 4]
mov ebx, dword [edi + 8]
sub ebx, dword [edi]
cmp dl, 0xff
mov dword [esp + 0x18], esi
mov esi, dword [edi]
mov dword [esp + 0x48], esi
mov esi, dword [edi + 4]
mov dword [esp + 0x4c], esi
mov esi, dword [edi + 8]
mov dword [esp + 0x50], esi
mov esi, dword [edi + 0xc]
mov dword [esp + 0x54], esi
mov esi, dword [ebp + 8]
mov dword [esp + 0x40], ebx
mov dword [esp + 0x28], esi
mov dword [esp + 0x30], 0
mov dword [esp + 0x2c], 0
jae 0x4782b4
xor eax, eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x18]
mov ecx, esi
push ecx
mov dword [esp + 0x54], ebx
mov dword [esp + 0x58], eax
call dword [0x4cf0ec]
mov edx, dword [esp + 0x18]
push edx
mov esi, eax
mov dword [esp + 0x2c], eax
mov eax, dword [ebp + 8]
push ebx
push eax
call dword [0x4cf0d0]
push eax
push esi
mov dword [esp + 0x38], eax
call dword [0x4cf0e8]
mov ecx, dword [ebp + 0xc]
mov dword [esp + 0x2c], eax
mov eax, dword [ebp + 0x10]
cmp dword [0x500884], 0
je 0x47835b
mov edx, dword [esp + 0x48]
mov dword [esp + 0x58], edx
mov edx, dword [esp + 0x4c]
mov dword [esp + 0x5c], edx
xor edx, edx
mov dh, cl
push 1
push 1
mov dword [esp + 0x48], 0
mov dword [esp + 0x4c], 1
mov word [esp + 0x68], dx
xor edx, edx
mov dh, ch
shr ecx, 0x10
mov word [esp + 0x6a], dx
xor edx, edx
mov dh, cl
mov ecx, 0xff00
mov word [esp + 0x6e], cx
mov word [esp + 0x7e], cx
lea ecx, [esp + 0x60]
mov word [esp + 0x6c], dx
mov edx, dword [esp + 0x58]
mov dword [esp + 0x70], edx
mov edx, dword [esp + 0x5c]
mov dword [esp + 0x74], edx
xor edx, edx
mov dh, al
mov word [esp + 0x78], dx
xor edx, edx
mov dh, ah
shr eax, 0x10
mov word [esp + 0x7a], dx
xor edx, edx
mov dh, al
lea eax, [esp + 0x48]
push eax
push 2
push ecx
push esi
mov word [esp + 0x8c], dx
call dword [0x500884]
jmp 0x478496
mov bx, ax
shr bx, 8
mov word [esp + 0xa], bx
mov bx, cx
shr bx, 8
mov word [esp + 0xc], bx
movzx ebx, al
mov edx, eax
movzx eax, cl
mov dword [esp + 0x10], ecx
shr dword [esp + 0x10], 0x10
xor esi, esi
shr edx, 0x10
mov ecx, ebx
neg ecx
mov dword [esp + 0x3c], eax
mov dword [esp + 0x38], ecx
mov eax, 2
lea ecx, [ebx + ebx]
mov dword [esp + 0x34], edx
mov dword [esp + 0x14], esi
mov dword [esp + 0x24], eax
mov dword [esp + 0x20], ecx
jmp 0x4783b4
mov edx, dword [esp + 0x34]
movzx ebx, byte [esp + 0x10]
movzx edx, dl
imul ebx, esi
imul edx, eax
add edx, ebx
sar edx, 1
xor ebx, ebx
mov bh, dl
movzx edx, byte [esp + 0xa]
imul edx, eax
movzx eax, byte [esp + 0xc]
imul eax, esi
add edx, eax
sar edx, 1
mov bl, dl
mov edx, dword [esp + 0x14]
add ecx, edx
sar ecx, 1
movzx eax, cl
shl ebx, 8
or ebx, eax
push ebx
call dword [0x4cf078]
mov edx, dword [esp + 0x4c]
mov ecx, dword [esp + 0x48]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x50]
mov dword [esp + 0x60], eax
mov eax, dword [edi + 0xc]
mov dword [esp + 0x5c], edx
mov edx, eax
sub edx, dword [edi + 4]
mov dword [esp + 0x58], ecx
mov ecx, dword [esp + 0x54]
mov ebx, edx
imul ebx, esi
mov dword [esp + 0x64], ecx
sar ebx, 1
mov ecx, eax
sub ecx, ebx
add esi, 1
mov ebx, esi
imul ebx, edx
sar ebx, 1
sub eax, ebx
mov dword [esp + 0x64], ecx
sub ecx, eax
test ecx, ecx
mov dword [esp + 0x5c], eax
jle 0x47845c
mov edx, dword [esp + 0x1c]
mov ecx, dword [ebp + 8]
push edx
lea eax, [esp + 0x5c]
push eax
push ecx
call dword [0x4cf510]
mov edx, dword [esp + 0x1c]
push edx
call dword [0x4cf0d8]
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
add ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x3c]
add dword [esp + 0x14], edx
sub eax, 1
test eax, eax
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], eax
jg 0x4783b0
mov ebx, dword [esp + 0x40]
mov esi, dword [esp + 0x28]
mov al, byte [esp + 9]
cmp al, 0xff
jae 0x4784f2
mov ecx, dword [edi + 4]
mov edx, dword [edi]
mov byte [esp + 0xe], al
mov byte [esp + 0xc], 0
mov byte [esp + 0xd], 0
mov byte [esp + 0xf], 1
mov eax, dword [esp + 0xc]
push eax
mov eax, dword [esp + 0x1c]
push eax
push ebx
push 0
push 0
push esi
push eax
mov eax, dword [ebp + 8]
push ebx
push ecx
push edx
push eax
call dword [0x500888]
mov ecx, dword [esp + 0x2c]
push ecx
push esi
call dword [0x4cf0e8]
mov edx, dword [esp + 0x30]
push edx
call dword [0x4cf0d8]
push esi
call dword [0x4cf0e4]
pop esi
pop ebx
mov esp, ebp
pop ebp
ret