Function at 0x646c44f0
Capabilities:
Get process heap flags

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x33c
mov dword [ebp - 0x310], eax
mov dword [ebp - 0x324], 0x1031
cmp edx, 2
je 0x646c4526
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 - 0x328], ecx
test edi, edi
jne 0x646c45ee
jmp 0x646c4990
mov eax, dword [sym.imp.kernel32.dll_HeapAlloc]
mov dword [ebp - 0x318], 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 - 0x318]
call eax
mov ecx, dword [ebp - 0x310]
sub esp, 0xc
mov dword [ecx + 0x20], eax
test eax, eax
je 0x646c49f4
xor edx, edx
lea esi, [ebp - 0x300]
mov word [eax], dx
lea eax, [ebp - 0x21a]
mov dword [esp + 0x14], esi
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 sym._DnsQueryConfig_24
sub esp, 0x18
test eax, eax
je 0x646c4758
mov eax, dword [ebp - 0x310]
mov eax, dword [eax + 8]
mov dword [ebp - 0x310], eax
test eax, eax
je 0x646c4990
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 - 0x328]
sub esp, 0x18
test esi, esi
jne 0x646c4548
mov ecx, dword fs:[0x18]
mov dword [ebp - 0x318], ecx
lea esi, [ebp - 0x300]
lea eax, [ebp - 0x2fa]
mov ebx, 5
mov dword [ebp - 0x314], esi
mov esi, eax
mov eax, dword [ebp - 0x314]
mov dword [esp + 0x10], esi
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 sym._DnsQueryConfig_24
mov dword [ebp - 0x30c], eax
sub esp, 0x18
cmp eax, 0xea
jne 0x646c47f0
lea eax, [ebp - 0x2fa]
cmp esi, eax
je 0x646c46d9
mov eax, dword [ebp - 0x318]
mov dword [esp + 8], esi
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 edi, dword fs:[0x18]
mov dword [esp + 8], eax
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
sub esp, 0xc
mov esi, eax
test eax, eax
je 0x646c49d2
dec ebx
jne 0x646c4661
mov dword [ebp - 0x31c], eax
mov edi, dword [ebp - 0x31c]
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov dword [esp + 8], edi
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 - 0x30c]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
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 - 0x318]
call eax
sub esp, 0xc
mov ebx, eax
test eax, eax
je 0x646c45d7
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x21a]
mov dword [esp + 0x14], esi
mov dword [esp + 0xc], 0
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], 7
call sym._DnsQueryConfig_24
sub esp, 0x18
test eax, eax
jne 0x646c47c7
cmp word [ebx], 0
jne 0x646c4948
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 0x646c45d7
mov ebx, dword [ebp - 0x30c]
mov dword [ebp - 0x31c], esi
test ebx, ebx
jne 0x646c49b2
mov eax, dword [ebp - 0x310]
mov ecx, dword [esi + 4]
add eax, 0x1c
mov dword [ebp - 0x314], eax
test ecx, ecx
je 0x646c48f1
mov eax, dword [ebp - 0x31c]
lea ebx, [eax + 0x20]
mov eax, dword [sym.imp.kernel32.dll_HeapAlloc]
mov dword [ebp - 0x318], eax
mov eax, dword fs:[0x18]
mov dword [ebp - 0x320], eax
jmp 0x646c4881
test esi, esi
je 0x646c4856
movzx ecx, byte [ebx]
mov byte [eax + 0x18], cl
test esi, 2
jne 0x646c4980
mov edi, dword [ebp - 0x314]
mov edx, dword [ebp - 0x31c]
add ebx, 0x40
inc dword [ebp - 0x30c]
mov dword [edi], eax
add eax, 8
mov dword [ebp - 0x314], eax
mov eax, dword [ebp - 0x30c]
cmp dword [edx + 4], eax
jbe 0x646c4900
mov esi, dword [ebx + 0x20]
mov eax, 0x20
mov dword [esp + 4], 8
cmp esi, 0x20
cmova esi, eax
lea eax, [esi + 0x18]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x320]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x318]
call eax
sub esp, 0xc
test eax, eax
je 0x646c49a8
lea edx, [eax + 0x18]
mov dword [eax], 0x18
mov dword [eax + 0xc], edx
mov dword [eax + 0x10], esi
cmp esi, 4
jb 0x646c4840
mov ecx, dword [ebx + esi - 4]
mov edi, edx
mov dword [edx + esi - 4], ecx
lea ecx, [esi - 1]
mov esi, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
jmp 0x646c4856
mov eax, dword [sym.imp.kernel32.dll_HeapAlloc]
mov dword [ebp - 0x318], eax
lea esi, [esi]
lea edi, [ebp - 0x2fa]
cmp dword [ebp - 0x31c], edi
je 0x646c4553
mov edi, dword [ebp - 0x31c]
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov dword [esp + 8], edi
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 0x646c4553
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_wcslen]
cmp eax, 0xff
ja 0x646c47c7
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 0x646c47c7
movzx ecx, word [ebx + esi - 2]
mov word [edx + esi - 2], cx
jmp 0x646c4856
mov dword [ebp - 0x30c], 0
mov eax, dword [ebp - 0x30c]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebp - 0x30c], 8
lea edi, [ebp - 0x2fa]
cmp dword [ebp - 0x31c], edi
jne 0x646c471b
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 [edi + 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 0x646c4745