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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x8c
mov eax, dword [0x588790]
xor eax, esp
mov dword [esp + 0x88], eax
test byte [0x58fed4], 1
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov dword [esp + 0x20], eax
jne 0x4a03c7
or dword [0x58fed4], 1
push str.AlphaBlend
push str.msimg32.dll
call edi
push eax
call esi
mov dword [0x58fed0], eax
cmp dword [0x58fed0], 0
jne 0x4a03da
mov dword [0x58fed0], 0x49caa0
test byte [0x58fed4], 2
jne 0x4a03fe
or dword [0x58fed4], 2
push str.GradientFill
push str.msimg32.dll
call edi
push eax
call esi
mov dword [0x58fecc], eax
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp + 0x14]
mov ecx, edx
shr eax, 0x18
shr ecx, 0x18
add eax, ecx
shr eax, 1
mov byte [esp + 0x13], al
test al, al
je 0x4a07e1
mov ecx, dword [ebx]
mov eax, dword [ebx + 4]
mov esi, dword [ebx + 8]
mov edi, dword [ebx + 0xc]
sub esi, dword [ebx]
sub edi, dword [ebx + 4]
mov dword [esp + 0x34], ecx
mov ecx, dword [ebx + 8]
mov dword [esp + 0x38], eax
mov eax, dword [ebx + 0xc]
mov dword [esp + 0x3c], ecx
xor ecx, ecx
cmp byte [esp + 0x13], 0xff
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x20]
mov dword [esp + 0x5c], esi
mov dword [esp + 0x50], edi
mov dword [esp + 0x1c], eax
mov dword [esp + 0x58], ecx
mov dword [esp + 0x54], ecx
jae 0x4a04a2
push eax
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x38], ecx
mov dword [esp + 0x40], esi
mov dword [esp + 0x44], edi
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
mov ecx, dword [esp + 0x20]
push edi
push esi
push ecx
mov dword [esp + 0x28], eax
call dword [sym.imp.GDI32.dll_CreateCompatibleBitmap]
mov edx, dword [esp + 0x1c]
push eax
push edx
mov dword [esp + 0x60], eax
call dword [sym.imp.GDI32.dll_SelectObject]
mov edx, dword [ebp + 0x10]
mov dword [esp + 0x54], eax
mov ecx, dword [0x58fecc]
test ecx, ecx
je 0x4a0591
mov eax, dword [esp + 0x34]
mov dword [esp + 0x74], eax
mov eax, dword [esp + 0x38]
mov dword [esp + 0x78], eax
mov eax, edx
shr eax, 0x10
movzx eax, al
shl ax, 8
mov word [esp + 0x7c], ax
mov eax, edx
shr eax, 8
movzx eax, al
movzx edx, dl
shl ax, 8
shl dx, 8
mov word [esp + 0x7e], ax
mov word [esp + 0x80], dx
mov edx, dword [esp + 0x3c]
mov dword [esp + 0x84], edx
mov eax, 0xff00
mov word [esp + 0x82], ax
mov eax, dword [esp + 0x40]
mov dword [esp + 0x88], eax
mov eax, dword [ebp + 0x14]
mov edx, eax
shr edx, 0x10
movzx edx, dl
shl dx, 8
mov word [esp + 0x8c], dx
mov edx, eax
shr edx, 8
movzx eax, al
shl ax, 8
movzx edx, dl
shl dx, 8
mov word [esp + 0x90], ax
xor eax, eax
cmp byte [ebp + 0x18], al
mov word [esp + 0x8e], dx
setne al
mov edx, 0xff00
mov word [esp + 0x92], dx
lea edx, [esp + 0x60]
mov dword [esp + 0x60], 0
mov dword [esp + 0x64], 1
push eax
push 1
push edx
mov edx, dword [esp + 0x28]
push 2
lea eax, [esp + 0x84]
push eax
push edx
call ecx
jmp 0x4a0783
mov eax, dword [ebp + 0x1c]
mov edi, 1
cmp eax, 0x40
jl 0x4a05a5
mov edi, 6
jmp 0x4a05d3
cmp eax, 0x20
jl 0x4a05b1
mov edi, 5
jmp 0x4a05d3
cmp eax, 0x10
jl 0x4a05bd
mov edi, 4
jmp 0x4a05d3
cmp eax, 8
jl 0x4a05c9
mov edi, 3
jmp 0x4a05d3
cmp eax, 4
jl 0x4a05d3
mov edi, 2
mov eax, 1
mov ecx, edi
shl eax, cl
xor esi, esi
mov dword [esp + 0x4c], eax
test eax, eax
jle 0x4a077b
mov ecx, dword [ebp + 0x14]
mov ax, cx
shr ax, 8
mov word [esp + 0x2e], ax
mov ax, dx
shr ax, 8
mov word [esp + 0x2c], ax
movzx eax, cl
shr ecx, 0x10
mov dword [esp + 0x6c], ecx
mov ecx, edx
shr ecx, 0x10
mov dword [esp + 0x70], ecx
movzx ecx, dl
mov edx, dword [esp + 0x4c]
mov dword [esp + 0x68], ecx
mov ecx, eax
neg ecx
imul eax, edx
mov dword [esp + 0x44], esi
mov dword [esp + 0x14], edx
mov dword [esp + 0x60], ecx
mov dword [esp + 0x30], eax
movzx edx, byte [esp + 0x2e]
imul edx, dword [esp + 0x14]
movzx eax, byte [esp + 0x2c]
imul eax, esi
add edx, eax
mov eax, dword [esp + 0x44]
add eax, dword [esp + 0x30]
mov ecx, edi
sar eax, cl
sar edx, cl
movzx ecx, al
movzx eax, byte [esp + 0x6c]
imul eax, dword [esp + 0x14]
movzx edx, dl
shl ecx, 8
or edx, ecx
movzx ecx, byte [esp + 0x70]
imul ecx, esi
add eax, ecx
mov ecx, edi
sar eax, cl
shl edx, 8
movzx eax, al
or edx, eax
push edx
call dword [sym.imp.GDI32.dll_CreateSolidBrush]
cmp byte [ebp + 0x18], 0
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x38]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x74], ecx
mov ecx, dword [esp + 0x40]
mov dword [esp + 0x78], edx
mov dword [esp + 0x7c], eax
mov dword [esp + 0x80], ecx
je 0x4a06ff
mov eax, dword [ebx + 0xc]
mov ecx, eax
sub ecx, dword [ebx + 4]
mov dword [esp + 0x24], ecx
imul ecx, esi
mov edx, ecx
mov ecx, edi
sar edx, cl
inc esi
mov dword [esp + 0x18], edx
mov edx, eax
sub edx, dword [esp + 0x18]
mov dword [esp + 0x18], esi
imul esi, dword [esp + 0x24]
sar esi, cl
mov dword [esp + 0x80], edx
sub eax, esi
sub edx, eax
mov dword [esp + 0x78], eax
test edx, edx
jle 0x4a074e
mov ecx, dword [esp + 0x20]
jmp 0x4a073d
mov edx, dword [ebx + 8]
sub edx, dword [ebx]
lea eax, [esi + 1]
mov ecx, edx
imul edx, esi
imul ecx, eax
mov dword [esp + 0x18], eax
mov eax, ecx
mov ecx, edi
sar eax, cl
sar edx, cl
mov ecx, dword [ebx + 8]
mov dword [esp + 0x48], eax
mov eax, dword [ebx + 8]
sub eax, dword [esp + 0x48]
sub ecx, edx
mov dword [esp + 0x7c], ecx
sub ecx, eax
mov dword [esp + 0x74], eax
test ecx, ecx
jle 0x4a074e
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x28]
push edx
lea eax, [esp + 0x78]
push eax
push ecx
call dword [sym.imp.USER32.dll_FillRect]
mov edx, dword [esp + 0x28]
push edx
call dword [sym.imp.GDI32.dll_DeleteObject]
mov eax, dword [esp + 0x68]
mov ecx, dword [esp + 0x60]
mov esi, dword [esp + 0x18]
add dword [esp + 0x44], eax
add dword [esp + 0x30], ecx
dec dword [esp + 0x14]
cmp esi, dword [esp + 0x4c]
jl 0x4a063a
mov esi, dword [esp + 0x5c]
mov edi, dword [esp + 0x50]
mov al, byte [esp + 0x13]
cmp al, 0xff
jae 0x4a07e1
mov ecx, dword [ebx + 4]
mov byte [esp + 0x16], al
mov eax, dword [esp + 0x1c]
mov word [esp + 0x14], 0
mov byte [esp + 0x17], 1
mov edx, dword [esp + 0x14]
push edx
mov edx, dword [ebx]
push edi
push esi
push 0
push 0
push eax
mov eax, dword [esp + 0x38]
push edi
push esi
push ecx
push edx
push eax
call dword [0x58fed0]
mov ecx, dword [esp + 0x54]
mov esi, dword [esp + 0x1c]
push ecx
push esi
call dword [sym.imp.GDI32.dll_SelectObject]
mov edx, dword [esp + 0x58]
push edx
call dword [sym.imp.GDI32.dll_DeleteObject]
push esi
call dword [sym.imp.GDI32.dll_DeleteDC]
mov ecx, dword [esp + 0x94]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00503edf
mov esp, ebp
pop ebp
ret