Function at 0x646cd2c0
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 edi, dword [ecx + 4]
mov esi, dword [ecx + 0xc]
mov edx, dword [ecx + 0x28]
mov eax, dword [ecx]
mov dword [ebp - 0x24], edi
mov edi, dword [ecx + 8]
mov dword [ebp - 0x34], esi
mov esi, dword [ecx + 0x14]
mov dword [ebp - 0x2c], edi
mov edi, dword [ecx + 0x10]
mov dword [ebp - 0x4c], edx
mov edx, dword [ecx + 0x2c]
mov dword [ebp - 0x38], edi
mov edi, dword [ecx + 0x18]
mov ebx, dword [ecx + 0x1c]
mov dword [ebp - 0x44], edx
mov dword [ebp - 0x40], edi
mov edi, dword [ecx + 0x24]
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x3c], 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 0x646cd738
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x646cd738
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 0x646cd385
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 edx, dword fs:[0x18]
mov dword [esp + 8], eax
mov dword [ebp - 0x58], eax
mov eax, dword [edx + 0x30]
mov dword [ebp - 0x54], edx
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call edi
mov edx, dword [ebp - 0x54]
sub esp, 0xc
test eax, eax
mov ebx, eax
je 0x646cd7d2
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 0x646cd424
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 0x646cd718
test eax, eax
jne 0x646cd798
mov dword [ebx + 0x44], eax
mov eax, dword [ebp - 0x50]
mov esi, dword [ebp - 0x44]
add edx, dword [ebp - 0x28]
mov dword [ebx + 0x48], eax
mov dword [ebx + 0x4c], esi
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x40]
mov dword [esp], edx
mov dword [esp + 4], eax
call sym._memcpy
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x646cd650
mov esi, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x24]
test esi, esi
je 0x646cd580
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], sym._icmp_apc_routine_12
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 0x646cd5fd
test esi, esi
jne 0x646cd7b8
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 0x646cd780
mov eax, dword [ebp - 0x24]
test eax, eax
jne 0x646cd510
test ecx, ecx
je 0x646cd510
mov dword [esp], ecx
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
cmp esi, 0x103
jne 0x646cd510
mov edx, dword [ebp - 0x2c]
test edx, edx
jne 0x646cd5ff
lea esi, [esi]
nop
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 0x646cd628
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 0x646cd5f2
test eax, eax
je 0x646cd4c6
cmp esi, 0x103
jne 0x646cd807
mov ecx, dword [ebp - 0x2c]
test ecx, ecx
je 0x646cd807
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 0x646cd45f
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 0x646cd4be
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 0x646cd4dd
mov eax, dword [ebp - 0x20]
mov esi, dword [eax + 8]
jmp 0x646cd4be
mov ecx, dword [esi + eax - 4]
mov edi, edx
mov dword [edx + eax - 4], ecx
lea ecx, [eax - 1]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov dword [ebx + 0x44], eax
jmp 0x646cd424
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 0x646cd4dd
movzx ecx, byte [esi]
mov byte [ebx + 0x50], cl
test al, 2
je 0x646cd421
movzx ecx, word [esi + eax - 2]
mov word [edx + eax - 2], cx
jmp 0x646cd421
mov edi, dword [ebp - 0x24]
test edi, edi
jne 0x646cd5e6
xor edi, edi
test ecx, ecx
jne 0x646cd4e8
jmp 0x646cd5e6
mov eax, dword [ebp - 0x20]
mov dword [esp + 4], 0
xor edi, edi
mov dword [ebp - 0x1c], edx
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_HeapFree]
mov edx, dword [ebp - 0x1c]
sub esp, 0xc
mov dword [edx + 0x34], 0x2afe
jmp 0x646cd63f
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 0x646cd628