Function at 0x402210
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
push esi
mov esi, eax
push ebx
mov ebx, edx
sub esp, 0x4c
mov dword [ebp - 0x2c], ecx
mov eax, dword [0x41c258]
cmp dword [0x41c25c], eax
je 0x402468
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 edi, eax
test eax, eax
je 0x402457
mov ecx, dword [ebp - 0x2c]
mov eax, esi
mov edx, ebx
call sym._append_path
mov dword [edi], eax
mov esi, eax
test eax, eax
je 0x402410
lea eax, [ebp - 0x20]
mov dword [esp + 0xc], 0x4172fc
mov dword [esp + 0x10], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov dword [esp], 0x416e2c
call dword [0x41d554]
sub esp, 0x14
test eax, eax
js 0x40240e
mov eax, dword [ebp - 0x20]
lea ecx, [ebp - 0x1c]
mov edx, dword [eax]
mov dword [esp + 8], ecx
mov dword [esp + 4], 0x41850c
mov dword [esp], eax
call dword [edx]
sub esp, 0xc
test eax, eax
js 0x402400
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 0x402400
mov esi, dword [ebp - 0x20]
test esi, esi
je 0x40240e
mov eax, esi
call sym._extract_icon
mov dword [edi + 4], eax
mov eax, dword [ebp - 0x2c]
cmp eax, 0xffffffff
je 0x4024f0
lea ecx, [eax + eax - 2]
add ecx, ebx
jae 0x402347
jmp 0x402354
sub ecx, 2
cmp ebx, ecx
ja 0x402354
cmp word [ecx], 0x2e
jne 0x402340
sub ecx, ebx
sar ecx, 1
mov dword [ebp - 0x2c], ecx
mov eax, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x30]
mov dword [esp + 4], 0
lea eax, [eax + eax + 2]
mov edx, eax
mov dword [esp + 8], edx
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov dword [ebp - 0x2c], edx
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ecx
sub esp, 0xc
mov edx, eax
test eax, eax
je 0x4023af
mov eax, dword [ebp - 0x2c]
mov dword [esp], edx
mov dword [esp + 4], ebx
sub eax, 2
mov dword [ebp - 0x30], edx
mov dword [esp + 8], eax
call sym._memcpy
mov eax, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x30]
xor ecx, ecx
mov word [edx + eax - 2], cx
mov dword [edi + 8], edx
mov eax, dword [esi]
mov dword [esp], esi
call dword [eax + 8]
mov eax, dword [edi + 4]
sub esp, 4
test eax, eax
mov eax, dword [edi + 8]
je 0x4024b0
test eax, eax
je 0x4024b0
mov eax, dword [0x41c25c]
lea edx, [eax + 1]
mov dword [0x41c25c], edx
mov edx, dword [0x41c260]
mov dword [edx + eax*4], edi
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 [edi]
mov ebx, dword [sym.imp.kernel32.dll_HeapFree]
mov edx, dword fs:[0x18]
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov eax, dword [edx + 0x30]
mov dword [ebp - 0x2c], edx
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
mov edx, dword [ebp - 0x2c]
sub esp, 0xc
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
sub esp, 0xc
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
lea edi, [eax + eax]
shl eax, 3
mov dword [esp + 4], 0
mov dword [esp + 0xc], eax
mov eax, dword [0x41c260]
mov edx, dword fs:[0x18]
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 0x402457
mov dword [0x41c260], eax
mov dword [0x41c258], edi
jmp 0x402231
mov dword [esp + 8], eax
mov ebx, 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 ebx
mov eax, dword [edi + 4]
sub esp, 0xc
mov dword [esp], eax
call dword [sym.imp.user32.dll_DestroyIcon]
mov esi, dword [edi]
sub esp, 4
jmp 0x402416
cmp word [ebx], 0
je 0x40251a
mov ecx, ebx
lea esi, [esi]
nop
add ecx, 2
cmp word [ecx], 0
jne 0x402500
sub ecx, ebx
mov eax, ecx
sub ecx, 2
sar eax, 1
mov dword [ebp - 0x2c], eax
jmp 0x402331
mov dword [ebp - 0x2c], 0
mov ecx, 0xfffffffe
jmp 0x402331