Function at 0x646c4420
Capabilities:
Get process heap flags

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x34c
mov dword [ebp - 0x310], eax
mov dword [ebp - 0x324], 0x1031
cmp edx, 2
je 0x646c4456
xor eax, eax
cmp edx, 0x17
sete al
lea eax, [eax + eax + 0x1030]
mov dword [ebp - 0x324], eax
mov edi, dword [ebp - 0x310]
and ecx, 8
mov dword [ebp - 0x32c], ecx
test edi, edi
jne 0x646c451e
jmp 0x646c48d0
mov eax, dword [sym.imp.kernel32.dll_HeapAlloc]
mov dword [ebp - 0x314], eax
mov dword [esp + 8], 0x200
mov dword [esp + 4], 0
mov ebx, dword fs:[0x18]
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x314]
call eax
mov edx, dword [ebp - 0x310]
sub esp, 0xc
mov dword [edx + 0x20], eax
test eax, eax
je 0x646c495e
xor edx, edx
lea edi, [ebp - 0x300]
mov word [eax], dx
lea eax, [ebp - 0x21a]
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], 7
call sub.dnsapi.dll_DnsQueryConfig
sub esp, 0x18
test eax, eax
je 0x646c4670
mov eax, dword [ebp - 0x310]
mov eax, dword [eax + 8]
mov dword [ebp - 0x310], eax
test eax, eax
je 0x646c48d0
lea eax, [ebp - 0x21a]
mov dword [esp + 0x14], 0x101
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x310]
mov dword [esp + 0xc], 0xffffffff
mov eax, dword [eax + 0xc]
mov dword [esp + 4], 0
mov dword [esp], 0
mov dword [esp + 8], eax
call dword [sym.imp.kernel32.dll_MultiByteToWideChar]
mov esi, dword [ebp - 0x32c]
sub esp, 0x18
test esi, esi
jne 0x646c4478
mov edx, dword fs:[0x18]
mov dword [ebp - 0x318], edx
lea edi, [ebp - 0x300]
lea eax, [ebp - 0x2fa]
mov esi, 5
mov dword [ebp - 0x314], edi
mov edi, eax
mov eax, dword [ebp - 0x314]
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], 0
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x21a]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x324]
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.dnsapi.dll_DnsQueryConfig
mov dword [ebp - 0x30c], eax
sub esp, 0x18
cmp eax, 0xea
jne 0x646c4710
lea eax, [ebp - 0x2fa]
cmp edi, eax
je 0x646c4609
mov eax, dword [ebp - 0x318]
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 0xc
mov eax, dword [ebp - 0x300]
mov dword [esp + 4], 0
mov ebx, dword fs:[0x18]
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
sub esp, 0xc
mov edi, eax
test eax, eax
je 0x646c493c
sub esi, 1
jne 0x646c4591
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 0xc
jmp 0x646c48da
mov eax, dword [ebp - 0x300]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x314]
call eax
sub esp, 0xc
mov ebx, eax
test eax, eax
je 0x646c4507
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x21a]
mov dword [esp + 0x14], edi
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], 7
call sub.dnsapi.dll_DnsQueryConfig
sub esp, 0x18
test eax, eax
jne 0x646c46df
cmp word [ebx], 0
jne 0x646c4890
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 0xc
jmp 0x646c4507
mov ebx, dword [ebp - 0x30c]
mov dword [ebp - 0x320], edi
test ebx, ebx
jne 0x646c496d
mov eax, dword [ebp - 0x310]
mov ecx, dword [edi + 4]
add eax, 0x1c
mov dword [ebp - 0x318], eax
test ecx, ecx
je 0x646c48e8
mov eax, dword [ebp - 0x320]
lea esi, [eax + 0x20]
mov eax, dword [sym.imp.kernel32.dll_HeapAlloc]
mov dword [ebp - 0x314], eax
mov eax, dword fs:[0x18]
mov dword [ebp - 0x31c], eax
nop
mov ebx, dword [esi + 0x20]
mov eax, 0x20
mov dword [esp + 4], 8
cmp ebx, eax
cmova ebx, eax
lea eax, [ebx + 0x18]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x31c]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x314]
call eax
sub esp, 0xc
test eax, eax
je 0x646c4910
lea edi, [eax + 0x18]
mov dword [eax], 0x18
mov dword [eax + 0xc], edi
mov dword [eax + 0x10], ebx
cmp ebx, 4
jae 0x646c4840
test ebx, ebx
je 0x646c47c9
movzx edx, byte [esi]
mov byte [eax + 0x18], dl
test bl, 2
jne 0x646c48c0
mov ecx, dword [ebp - 0x318]
add dword [ebp - 0x30c], 1
add esi, 0x40
mov dword [ecx], eax
mov ecx, dword [ebp - 0x320]
add eax, 8
mov dword [ebp - 0x318], eax
mov eax, dword [ebp - 0x30c]
cmp dword [ecx + 4], eax
ja 0x646c4760
lea esi, [ebp - 0x2fa]
cmp dword [ebp - 0x320], esi
je 0x646c4483
mov esi, dword [ebp - 0x320]
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov dword [esp + 8], esi
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 0xc
jmp 0x646c4483
mov edx, dword [esi]
mov ecx, esi
mov dword [eax + 0x18], edx
mov edx, dword [esi + ebx - 4]
mov dword [edi + ebx - 4], edx
lea edx, [eax + 0x1c]
and edx, 0xfffffffc
sub edi, edx
add ebx, edi
sub ecx, edi
and ebx, 0xfffffffc
cmp ebx, 4
jb 0x646c47c9
mov dword [ebp - 0x328], eax
and ebx, 0xfffffffc
xor edi, edi
mov eax, dword [ecx + edi]
mov dword [edx + edi], eax
add edi, 4
cmp edi, ebx
jb 0x646c4872
mov eax, dword [ebp - 0x328]
jmp 0x646c47c9
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_wcslen]
cmp eax, 0xff
ja 0x646c46df
mov eax, dword [ebp - 0x310]
mov dword [esp + 4], ebx
mov eax, dword [eax + 0x20]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_wcscpy]
jmp 0x646c46df
movzx edx, word [esi + ebx - 2]
mov word [edi + ebx - 2], dx
jmp 0x646c47c9
mov dword [ebp - 0x30c], 0
mov eax, dword [ebp - 0x30c]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [sym.imp.kernel32.dll_HeapAlloc]
lea esi, [ebp - 0x2fa]
mov dword [ebp - 0x314], eax
cmp dword [ebp - 0x320], esi
je 0x646c4483
jmp 0x646c480b
mov dword [ebp - 0x30c], 8
mov edi, dword [ebp - 0x320]
lea eax, [ebp - 0x2fa]
cmp edi, eax
jne 0x646c4647
mov eax, dword [ebp - 0x30c]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 0xc
mov dword [ebp - 0x30c], 8
jmp 0x646c48da
mov edi, dword [ebp - 0x320]
jmp 0x646c4920