Function at 0x40a8f0
Capabilities:
Access peb ldr_data
Get kernel32 base address
Get process heap flags

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x49a968
mov eax, dword fs:[0]
push eax
sub esp, 0x28
push ebx
push esi
push edi
mov eax, dword [0x4ba700]
xor eax, esp
push eax
lea eax, [esp + 0x38]
mov dword fs:[0], eax
mov dword [esp + 0x14], ecx
lea eax, [ecx + 0x14]
mov eax, dword [eax]
add ecx, 4
push 4
mov dword [esp + 0x28], ecx
mov ecx, dword [ecx]
push ecx
push eax
push eax
call dword [sym.imp.GDI32.dll_CombineRgn]
mov edi, dword [ebp + 8]
mov esi, dword [edi + 0x28]
cmp dword [edi + 0x24], esi
lea ebx, [edi + 0x18]
jbe 0x40a94c
call fcn.0047d091
mov ecx, dword [ebx + 0xc]
mov edx, dword [ebx]
mov dword [esp + 0x2c], edx
mov dword [esp + 0x1c], ecx
cmp ecx, dword [ebx + 0x10]
jbe 0x40a967
call fcn.0047d091
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x2c]
mov eax, dword [ebx]
push esi
push edx
push ecx
push eax
lea eax, [esp + 0x3c]
push eax
call fcn.00409bf0
mov esi, dword [edi + 0x48]
cmp dword [edi + 0x44], esi
lea ebx, [edi + 0x38]
jbe 0x40a98b
call fcn.0047d091
mov ecx, dword [ebx]
mov dword [esp + 0x2c], ecx
mov ecx, dword [ebx + 0xc]
mov dword [esp + 0x1c], ecx
cmp ecx, dword [ebx + 0x10]
jbe 0x40a9a6
call fcn.0047d091
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x2c]
mov eax, dword [ebx]
push esi
push edx
push ecx
push eax
lea eax, [esp + 0x3c]
push eax
call fcn.00409bf0
mov ebx, dword [edi + 0x10]
cmp dword [edi + 0xc], ebx
jbe 0x40a9c7
call fcn.0047d091
mov esi, dword [edi + 0xc]
mov ecx, dword [edi]
mov dword [esp + 0x2c], ecx
cmp esi, dword [edi + 0x10]
jbe 0x40a9da
call fcn.0047d091
mov edx, dword [esp + 0x2c]
mov eax, dword [edi]
push ebx
push edx
push esi
push eax
lea eax, [esp + 0x3c]
push eax
mov ebx, edi
call fcn.00409bf0
mov ebx, dword [ebp + 0xc]
mov ecx, dword [esp + 0x24]
push ebx
push ecx
lea esi, [esp + 0x24]
call fcn.00409630
mov dword [esp + 0x40], 0
mov edx, dword [esp + 0x1c]
mov esi, dword [esp + 0x14]
mov eax, dword [esi + 4]
push 4
push edx
push eax
push eax
call dword [sym.imp.GDI32.dll_CombineRgn]
push ebx
lea ebx, [esi + 0x14]
push ebx
lea esi, [esp + 0x2c]
call fcn.00409630
mov eax, dword [esp + 0x24]
mov ebx, dword [ebx]
push 4
push eax
push ebx
push ebx
call dword [sym.imp.GDI32.dll_CombineRgn]
mov ebx, dword [esp + 0x14]
mov ecx, dword [ebp + 0xc]
lea eax, [ebx + 0xc]
push ecx
push eax
lea esi, [esp + 0x1c]
call fcn.00409630
mov byte [esp + 0x40], 2
mov eax, dword [ebx + 0xc]
mov esi, dword [esp + 0x14]
push 4
push esi
push eax
push eax
call dword [sym.imp.GDI32.dll_CombineRgn]
push 1
push 1
lea eax, [edi + 0x38]
push eax
lea eax, [esp + 0x28]
call fcn.00409740
push 1
push 1
push edi
lea eax, [esp + 0x20]
call fcn.00409740
cmp dword [ebx + 0x20], 0
setle dl
cmp dword [ebx + 0x1c], 0
movzx eax, dl
setle cl
push eax
movzx edx, cl
push edx
lea eax, [edi + 0x18]
push eax
lea eax, [esp + 0x30]
call fcn.00409740
mov eax, dword [ebx + 0x1c]
mov dword [edi + 0x30], eax
mov ecx, dword [ebx + 0x20]
push esi
mov esi, dword [sym.imp.GDI32.dll_DeleteObject]
mov dword [edi + 0x34], ecx
call esi
mov edx, dword [esp + 0x18]
push edx
call fcn.0047d643
mov eax, dword [esp + 0x28]
add esp, 4
push eax
call esi
mov ecx, dword [esp + 0x28]
push ecx
call fcn.0047d643
mov edx, dword [esp + 0x20]
add esp, 4
push edx
call esi
mov eax, dword [esp + 0x20]
push eax
call fcn.0047d643
add esp, 4
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8