Function at 0x401ff0
Capabilities:
Access peb ldr_data
Check for peb beingdebugged flag
Get kernel32 base address
Get process heap flags
Get process heap force flags

Disassembly:
push ebp
mov ebp, esp
push edi
mov edi, edx
push esi
mov esi, eax
push ebx
sub esp, 0x4c
mov dword [ebp - 0x2c], ecx
mov eax, dword [0x418258]
cmp dword [0x41825c], eax
je 0x402248
mov dword [esp + 8], 0xc
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_HeapAlloc]
mov dword [ebp - 0x30], eax
call eax
sub esp, 0xc
mov ebx, eax
test eax, eax
je 0x402237
mov ecx, dword [ebp - 0x2c]
mov eax, esi
mov edx, edi
call fcn.00401d90
mov esi, eax
mov dword [ebx], eax
test eax, eax
je 0x4021f0
lea eax, [ebp - 0x20]
mov dword [esp + 0xc], 0x4160ec
mov dword [esp + 0x10], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov dword [esp], 0x415c1c
call fcn.0040f31c
sub esp, 0x14
test eax, eax
js 0x4021ee
mov eax, dword [ebp - 0x20]
lea ecx, [ebp - 0x1c]
mov edx, dword [eax]
mov dword [esp + 8], ecx
mov dword [esp + 4], 0x41728c
mov dword [esp], eax
call dword [edx]
sub esp, 0xc
test eax, eax
js 0x4021e0
mov eax, dword [ebp - 0x1c]
mov edx, dword [eax]
mov dword [esp + 4], esi
mov dword [esp + 8], 0
mov dword [esp], eax
call dword [edx + 0x14]
mov esi, eax
mov eax, dword [ebp - 0x1c]
sub esp, 0xc
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
test esi, esi
js 0x4021e0
mov esi, dword [ebp - 0x20]
test esi, esi
je 0x4021ee
mov eax, esi
call fcn.00401ea0
mov dword [ebx + 4], eax
mov eax, dword [ebp - 0x2c]
cmp eax, 0xffffffff
je 0x4022d0
lea eax, [eax + eax - 2]
add eax, edi
jae 0x402127
jmp 0x402134
sub eax, 2
cmp eax, edi
jb 0x402134
cmp word [eax], 0x2e
jne 0x402120
sub eax, edi
sar eax, 1
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x2c]
lea eax, [eax + eax + 2]
mov ecx, eax
mov dword [ebp - 0x2c], ecx
mov eax, dword fs:[0x18]
mov dword [esp + 8], ecx
mov dword [esp + 4], 0
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov edx, dword [ebp - 0x30]
call edx
sub esp, 0xc
mov edx, eax
test eax, eax
je 0x40218f
mov eax, dword [ebp - 0x2c]
mov dword [esp], edx
mov dword [esp + 4], edi
sub eax, 2
mov dword [esp + 8], eax
mov dword [ebp - 0x30], edx
call sub.ucrtbase.dll_memcpy
mov eax, dword [ebp - 0x2c]
xor ecx, ecx
mov edx, dword [ebp - 0x30]
mov word [edx + eax - 2], cx
mov dword [ebx + 8], edx
mov eax, dword [esi]
mov dword [esp], esi
call dword [eax + 8]
mov eax, dword [ebx + 4]
sub esp, 4
test eax, eax
mov eax, dword [ebx + 8]
je 0x402290
test eax, eax
je 0x402290
mov eax, dword [0x41825c]
lea edx, [eax + 1]
mov dword [0x41825c], edx
mov edx, dword [0x418260]
mov dword [edx + eax*4], ebx
lea esp, [ebp - 0xc]
mov eax, 1
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp - 0x20]
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
sub esp, 4
mov esi, dword [ebx]
mov edi, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov edx, dword fs:[0x18]
mov eax, dword [edx + 0x30]
mov dword [ebp - 0x2c], edx
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call edi
sub esp, 0xc
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov edx, dword [ebp - 0x2c]
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call edi
sub esp, 0xc
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
lea ebx, [eax + eax]
shl eax, 3
mov dword [esp + 0xc], eax
mov eax, dword [0x418260]
mov edx, dword fs:[0x18]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapReAlloc]
sub esp, 0x10
test eax, eax
je 0x402237
mov dword [0x418260], eax
mov dword [0x418258], ebx
jmp 0x402011
mov dword [esp + 8], eax
mov edi, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [esp + 4], 0
mov edx, dword fs:[0x18]
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call edi
mov eax, dword [ebx + 4]
sub esp, 0xc
mov dword [esp], eax
call sub.user32.dll_DestroyIcon
mov esi, dword [ebx]
sub esp, 4
jmp 0x4021f6
cmp word [edi], 0
je 0x4022fa
mov eax, edi
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x4022e0
sub eax, edi
mov ecx, eax
sub eax, 2
sar ecx, 1
mov dword [ebp - 0x2c], ecx
jmp 0x402110
mov eax, 0xfffffffe
mov dword [ebp - 0x2c], 0
jmp 0x402110