Function at 0x406390
Capabilities:
Get process heap flags

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0xc
mov edi, ecx
cmp dword [ecx], 0x40
mov dword [ebp - 0x10], ecx
je 0x4063df
mov eax, dword [edi + 4]
test eax, eax
je 0x406539
cmp eax, 0xffffff
ja 0x4066b1
mov edx, eax
shl edx, 7
lea ecx, [edx - 1]
bsr ecx, ecx
not ecx
neg cl
xor esi, esi
inc esi
shl esi, cl
sub esi, edx
xor ecx, ecx
cmp esi, 0x40
setae cl
lea esi, [ecx + eax*2]
jmp 0x40653c
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
push 0x40
push 0
push dword [eax + 0x18]
call sub.ntdll.dll_RtlAllocateHeap
mov dword [ebp - 0x14], eax
test eax, eax
je 0x4066b1
mov edx, dword [edi + 4]
test edx, edx
jle 0x406525
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax]
shl edx, 6
add edx, ecx
xor esi, esi
mov ebx, dword [ebp - 0x14]
mov dword [ebp - 0x18], edx
mov eax, dword [ecx + 0x10]
mov dword [ebx + 0x10], eax
movups xmm0, xmmword [ecx]
movups xmmword [ebx], xmm0
movsd xmm0, qword [ecx + 0x14]
movsd qword [ebx + 0x14], xmm0
mov dword [ecx + 0x14], esi
mov dword [ecx + 0x18], esi
movsd xmm0, qword [ecx + 0x1c]
movsd qword [ebx + 0x1c], xmm0
mov dword [ecx + 0x1c], esi
mov dword [ecx + 0x20], esi
mov eax, dword [ecx + 0x24]
mov dword [ebx + 0x24], eax
mov eax, dword [ecx + 0x2c]
mov dword [ebx + 0x2c], eax
mov eax, dword [ecx + 0x30]
mov dword [ebx + 0x30], eax
mov eax, dword [ecx + 0x28]
cmp eax, 4
je 0x406474
mov dword [ebx + 0x28], eax
mov dword [ecx + 0x28], 4
mov dword [ecx + 0x30], esi
mov dword [ecx + 0x2c], esi
jmp 0x40649b
mov dword [ebx + 0x28], 4
mov eax, dword [ecx + 0x2c]
test eax, eax
jle 0x40649b
mov esi, dword [ecx + 0x28]
lea edi, [esi + eax*4]
mov eax, 4
mov edx, dword [esi]
mov dword [eax], edx
add esi, 4
add eax, 4
cmp esi, edi
jb 0x40648d
mov al, byte [ecx + 0x38]
mov byte [ebx + 0x38], al
mov eax, dword [ecx + 0x34]
mov dword [ebx + 0x34], eax
add ecx, 0x40
add ebx, 0x40
mov edx, dword [ebp - 0x18]
cmp ecx, edx
mov esi, 0
jb 0x40641c
mov eax, dword [ebp - 0x10]
mov ebx, dword [eax + 4]
test ebx, ebx
jle 0x406525
mov eax, dword [ebp - 0x10]
mov edi, dword [eax]
shl ebx, 6
add ebx, edi
add edi, 0x14
xor esi, esi
mov eax, dword [edi + 0x14]
cmp eax, 4
je 0x4064f3
mov ecx, dword fs:[0x18]
mov ecx, dword [ecx + 0x30]
push eax
push 0
push dword [ecx + 0x18]
call sub.ntdll.dll_RtlFreeHeap
cmp dword [edi + 0xc], 0
je 0x406508
lea eax, [edi + 8]
push eax
call sub.ntdll.dll_RtlFreeUnicodeString
mov dword [edi + 8], esi
mov dword [edi + 0xc], esi
cmp dword [edi + 4], 0
je 0x406519
push edi
call sub.ntdll.dll_RtlFreeUnicodeString
mov dword [edi], esi
mov dword [edi + 4], esi
lea eax, [edi + 0x40]
add edi, 0x2c
cmp edi, ebx
mov edi, eax
jb 0x4064d6
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x14]
mov dword [eax], ecx
mov dword [eax + 8], 1
jmp 0x4066a7
xor esi, esi
inc esi
mov eax, esi
shl eax, 6
mov ecx, dword fs:[0x18]
mov ecx, dword [ecx + 0x30]
push eax
push 0
push dword [ecx + 0x18]
call sub.ntdll.dll_RtlAllocateHeap
test eax, eax
je 0x4066b1
mov ebx, eax
mov eax, dword [edi]
cmp dword [edi + 4], 0
jle 0x40668d
mov dword [ebp - 0x18], esi
xor ecx, ecx
mov dword [ebp - 0x14], ebx
mov edx, ebx
mov esi, dword [eax + 0x10]
mov dword [edx + 0x10], esi
movups xmm0, xmmword [eax]
movups xmmword [edx], xmm0
movsd xmm0, qword [eax + 0x14]
movsd qword [edx + 0x14], xmm0
mov dword [eax + 0x14], ecx
mov dword [eax + 0x18], ecx
movsd xmm0, qword [eax + 0x1c]
movsd qword [edx + 0x1c], xmm0
mov dword [eax + 0x1c], ecx
mov dword [eax + 0x20], ecx
mov esi, dword [eax + 0x24]
mov dword [edx + 0x24], esi
mov esi, dword [eax + 0x2c]
mov dword [edx + 0x2c], esi
mov esi, dword [eax + 0x30]
mov dword [edx + 0x30], esi
mov esi, dword [eax + 0x28]
cmp esi, 4
je 0x4065ce
mov dword [edx + 0x28], esi
mov dword [eax + 0x28], 4
mov dword [eax + 0x30], ecx
mov dword [eax + 0x2c], ecx
jmp 0x4065f5
mov dword [edx + 0x28], 4
mov edi, dword [eax + 0x2c]
test edi, edi
jle 0x4065f5
mov esi, dword [eax + 0x28]
lea edi, [esi + edi*4]
mov ebx, 4
mov ecx, dword [esi]
mov dword [ebx], ecx
add esi, 4
add ebx, 4
cmp esi, edi
jb 0x4065e7
mov cl, byte [eax + 0x38]
mov byte [edx + 0x38], cl
mov ecx, dword [eax + 0x34]
mov dword [edx + 0x34], ecx
add edx, 0x40
add eax, 0x40
mov ecx, dword [ebp - 0x10]
mov ebx, dword [ecx]
mov esi, dword [ecx + 4]
mov edi, esi
shl edi, 6
add edi, ebx
cmp eax, edi
mov ecx, 0
jb 0x406576
test esi, esi
jle 0x406682
add ebx, 0x14
xor esi, esi
mov eax, dword [ebx + 0x14]
cmp eax, 4
je 0x406649
mov ecx, dword fs:[0x18]
mov ecx, dword [ecx + 0x30]
push eax
push 0
push dword [ecx + 0x18]
call sub.ntdll.dll_RtlFreeHeap
cmp dword [ebx + 0xc], 0
je 0x40665e
lea eax, [ebx + 8]
push eax
call sub.ntdll.dll_RtlFreeUnicodeString
mov dword [ebx + 8], esi
mov dword [ebx + 0xc], esi
cmp dword [ebx + 4], 0
je 0x40666f
push ebx
call sub.ntdll.dll_RtlFreeUnicodeString
mov dword [ebx], esi
mov dword [ebx + 4], esi
lea eax, [ebx + 0x40]
add ebx, 0x2c
cmp ebx, edi
mov ebx, eax
jb 0x40662c
mov edi, dword [ebp - 0x10]
mov eax, dword [edi]
jmp 0x406687
mov eax, ebx
mov edi, dword [ebp - 0x10]
mov esi, dword [ebp - 0x18]
mov ebx, dword [ebp - 0x14]
mov ecx, dword fs:[0x18]
mov ecx, dword [ecx + 0x30]
push eax
push 0
push dword [ecx + 0x18]
call sub.ntdll.dll_RtlFreeHeap
mov dword [edi], ebx
mov dword [edi + 8], esi
mov al, 1
add esp, 0xc
pop esi
pop edi
pop ebx
pop ebp
ret
xor eax, eax
jmp 0x4066a9