Function at 0x646cd730
Capabilities:
Access peb ldr_data
Get kernel32 base address
Get process heap flags
Get process heap force flags

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
sub esp, 0x78
mov edx, dword [ecx + 8]
mov esi, dword [ecx + 4]
mov edi, dword [ecx + 0x14]
mov eax, dword [ecx]
mov dword [ebp - 0x2c], edx
mov edx, dword [ecx + 0x10]
mov dword [ebp - 0x24], esi
mov esi, dword [ecx + 0xc]
mov dword [ebp - 0x38], edx
mov edx, dword [ecx + 0x28]
mov dword [ebp - 0x34], esi
mov esi, dword [ecx + 0x18]
mov dword [ebp - 0x3c], edi
mov edi, dword [ecx + 0x24]
mov dword [ebp - 0x4c], edx
mov edx, dword [ecx + 0x2c]
mov ebx, dword [ecx + 0x1c]
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x44], edx
mov dword [ebp - 0x40], esi
mov esi, dword [ecx + 0x20]
mov dword [ebp - 0x1c], edi
mov dword [esp + 8], 0x10
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov edi, dword [sym.imp.kernel32.dll_HeapAlloc]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call edi
mov edx, eax
sub esp, 0xc
mov dword [ebp - 0x20], eax
add edx, 8
cmp dword [ebp - 0x30], 0xffffffff
mov dword [ebp - 0x48], edx
je 0x646cdbb0
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x646cdbb0
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp - 0x2c]
mov dword [ebp - 0x28], 0
mov dword [eax + 4], edx
mov edx, dword [ebp - 0x34]
mov dword [eax], edx
test esi, esi
je 0x646cd7f5
movzx eax, byte [esi + 3]
add eax, 3
and eax, 0xfffffffc
mov dword [ebp - 0x28], eax
movzx eax, bx
mov ebx, dword [ebp - 0x28]
mov dword [esp + 4], 8
mov dword [ebp - 0x50], eax
lea eax, [eax + ebx + 0x50]
mov ecx, dword fs:[0x18]
mov dword [esp + 8], eax
mov dword [ebp - 0x58], eax
mov eax, dword [ecx + 0x30]
mov dword [ebp - 0x54], ecx
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call edi
mov ecx, dword [ebp - 0x54]
sub esp, 0xc
test eax, eax
mov ebx, eax
je 0x646cdc4a
mov eax, dword [ebp - 0x1c]
mov dword [ebx + 0x3c], 0
lea edx, [ebx + 0x50]
mov byte [ebx + 0x40], 0x20
mov dword [ebx + 0x38], eax
mov eax, 2
mov word [ebx], ax
mov eax, dword [ebp - 0x38]
mov dword [ebx + 4], eax
mov eax, 2
mov word [ebx + 0x1c], ax
mov eax, dword [ebp - 0x3c]
mov dword [ebx + 0x20], eax
test esi, esi
je 0x646cd894
movzx eax, byte [esi]
mov byte [ebx + 0x41], al
movzx eax, word [esi + 1]
mov word [ebx + 0x42], ax
movzx eax, byte [esi + 3]
mov esi, dword [esi + 4]
cmp eax, 4
jae 0x646cdb88
test eax, eax
jne 0x646cdc10
mov dword [ebx + 0x44], eax
mov eax, dword [ebp - 0x44]
mov edi, dword [ebp - 0x50]
mov dword [ebx + 0x4c], eax
mov eax, dword [ebp - 0x28]
mov dword [ebx + 0x48], edi
mov dword [esp + 8], edi
mov edi, dword [ebp - 0x40]
add eax, edx
mov dword [esp], eax
mov dword [esp + 4], edi
call sub.ucrtbase.dll_memcpy
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x646cdac0
mov esi, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x24]
test esi, esi
je 0x646cd9f0
mov eax, dword [ebp - 0x4c]
mov dword [esp + 4], ecx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x24], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0x14], 0x12100c
mov dword [esp + 0x20], eax
mov eax, dword [ebp - 0x58]
mov dword [esp + 8], 0x646c4350
mov dword [esp + 0x1c], eax
mov eax, dword [ebp - 0x48]
mov dword [ebp - 0x28], ecx
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x20]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x30]
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.ntdll.dll_NtDeviceIoControlFile]
mov ecx, dword [ebp - 0x28]
sub esp, 0x28
cmp eax, 0x103
mov esi, eax
je 0x646cda6d
test esi, esi
jne 0x646cdc30
mov eax, dword [ebp - 0x1c]
xor edx, edx
xor esi, esi
movzx edi, word [eax + 0xe]
mov word [eax + 0xe], dx
test edi, edi
je 0x646cdbf8
mov eax, dword [ebp - 0x24]
test eax, eax
jne 0x646cd980
test ecx, ecx
je 0x646cd980
mov dword [esp], ecx
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
cmp esi, 0x103
jne 0x646cd980
mov edx, dword [ebp - 0x2c]
test edx, edx
jne 0x646cda6f
lea esi, [esi]
mov eax, dword [ebp - 0x20]
mov dword [esp + 4], 0
mov edx, dword fs:[0x18]
mov dword [esp + 8], eax
mov eax, dword [edx + 0x30]
mov ecx, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [ebp - 0x20], edx
mov eax, dword [eax + 0x18]
mov dword [ebp - 0x1c], ecx
mov dword [esp], eax
call ecx
mov edx, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x1c]
sub esp, 0xc
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ecx
sub esp, 0xc
test esi, esi
jne 0x646cda98
lea esp, [ebp - 0x10]
mov eax, edi
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret 0x30
mov eax, dword [ebp - 0x4c]
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], 0x12100c
mov dword [esp + 0x24], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp + 8], 0
mov dword [esp + 0x20], eax
mov eax, dword [ebp - 0x58]
mov dword [ebp - 0x28], ecx
mov dword [esp + 0x1c], eax
mov eax, dword [ebp - 0x48]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x34]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x24]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x30]
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.ntdll.dll_NtDeviceIoControlFile]
mov ecx, dword [ebp - 0x28]
sub esp, 0x28
cmp eax, 0x103
mov esi, eax
je 0x646cda62
test eax, eax
je 0x646cd938
cmp esi, 0x103
jne 0x646cdc7f
mov ecx, dword [ebp - 0x2c]
test ecx, ecx
je 0x646cdc7f
xor edi, edi
mov dword [esp + 8], ebx
mov esi, 0x103
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
mov dword [esp], esi
call dword [sym.imp.ntdll.dll_RtlNtStatusToDosError]
mov edx, eax
sub esp, 4
mov eax, dword fs:[0x18]
mov dword [eax + 0x34], edx
lea esp, [ebp - 0x10]
mov eax, edi
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret 0x30
mov edi, dword [ebp - 0x2c]
xor ecx, ecx
test edi, edi
jne 0x646cd8d1
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_CreateEventW]
mov ecx, eax
mov eax, dword [ebp - 0x4c]
sub esp, 0x10
mov dword [esp + 4], ecx
mov dword [esp + 0x24], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0x18], ebx
mov dword [esp + 0x20], eax
mov eax, dword [ebp - 0x58]
mov dword [esp + 0x14], 0x12100c
mov dword [esp + 0x1c], eax
mov eax, dword [ebp - 0x48]
mov dword [esp + 8], 0
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x34]
mov dword [ebp - 0x28], ecx
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x30]
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.ntdll.dll_NtDeviceIoControlFile]
mov ecx, dword [ebp - 0x28]
sub esp, 0x28
cmp eax, 0x103
mov esi, eax
jne 0x646cd930
mov dword [esp], ecx
xor edi, edi
mov dword [ebp - 0x28], ecx
mov dword [esp + 4], 0xffffffff
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
mov ecx, dword [ebp - 0x28]
sub esp, 8
test eax, eax
jne 0x646cd94f
mov eax, dword [ebp - 0x20]
mov esi, dword [eax + 8]
jmp 0x646cd930
mov ecx, dword [esi]
lea edi, [ebx + 0x54]
and edi, 0xfffffffc
mov dword [ebx + 0x50], ecx
mov ecx, dword [esi + eax - 4]
mov dword [edx + eax - 4], ecx
mov ecx, edx
sub ecx, edi
sub esi, ecx
add ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov dword [ebx + 0x44], eax
jmp 0x646cd894
mov eax, dword [ebp - 0x20]
mov dword [esp + 4], 0
xor edi, edi
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_HeapFree]
mov dword [ebx + 0x34], 0x57
mov eax, edi
sub esp, 0xc
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret 0x30
mov edx, dword [eax + 4]
mov eax, dword fs:[0x18]
mov dword [eax + 0x34], edx
jmp 0x646cd94f
movzx ecx, byte [esi]
mov byte [ebx + 0x50], cl
test al, 2
je 0x646cd891
movzx ecx, word [esi + eax - 2]
mov word [edx + eax - 2], cx
jmp 0x646cd891
mov edi, dword [ebp - 0x24]
test edi, edi
jne 0x646cda56
xor edi, edi
test ecx, ecx
jne 0x646cd95a
jmp 0x646cda56
mov eax, dword [ebp - 0x20]
mov dword [esp + 4], 0
xor edi, edi
mov dword [ebp - 0x1c], ecx
mov dword [esp + 8], eax
mov eax, dword [ecx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
mov ecx, dword [ebp - 0x1c]
sub esp, 0xc
mov dword [ecx + 0x34], 0x2afe
jmp 0x646cdaaf
mov eax, dword [ebp - 0x20]
mov dword [esp + 4], 0
mov edx, dword fs:[0x18]
mov dword [esp + 8], eax
mov eax, dword [edx + 0x30]
mov edi, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [ebp - 0x1c], edx
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call edi
mov edx, dword [ebp - 0x1c]
sub esp, 0xc
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call edi
xor edi, edi
sub esp, 0xc
jmp 0x646cda98