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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffe84
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x38], ebx
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 4], ebx
mov dword [ebp - 8], ebx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x10], ebx
test dl, dl
je 0x51f89f
add esp, 0xfffffff0
call fcn.0040406c
mov esi, ecx
mov ebx, edx
mov edi, eax
mov eax, dword [ebp + 0x20]
call fcn.00404fac
mov eax, dword [ebp + 0x1c]
call fcn.00404fac
mov eax, dword [ebp + 0x18]
call fcn.00404fac
xor eax, eax
push ebp
push 0x51fadd
push dword fs:[eax]
mov dword fs:[eax], esp
call fcn.004f6f24
mov dword [edi + 0xc], eax
lea eax, [edi + 0x10]
mov edx, dword [ebp + 0x20]
call fcn.00404b50
lea eax, [edi + 0x14]
mov edx, dword [ebp + 0x1c]
call fcn.00404b50
lea eax, [edi + 0x18]
mov edx, dword [ebp + 0x18]
call fcn.00404b50
mov eax, dword [edi + 0x1c]
mov dword [edi + 0x1c], eax
lea eax, [edi + 0x34]
mov edx, 0x10
call fcn.004f6a54
lea eax, [edi + 0x30]
mov edx, esi
call fcn.00404b50
mov eax, esi
call fcn.00404dbc
test eax, eax
jle 0x51f955
lea eax, [ebp - 8]
push eax
mov dword [ebp - 0x18], esi
mov byte [ebp - 0x14], 0xb
lea edx, [ebp - 0x18]
xor ecx, ecx
mov eax, 0x51fb0c
call fcn.004f9394
lea eax, [ebp - 0x1c]
push eax
mov edx, dword [ebp + 0xc]
mov ecx, dword [ebp + 8]
mov eax, dword [ebp - 8]
call fcn.004f9394
mov edx, dword [ebp - 0x1c]
lea eax, [ebp - 8]
call fcn.00404b94
jmp 0x51f95d
lea eax, [ebp - 8]
call fcn.00404afc
mov eax, dword [ebp + 0x20]
call fcn.00404dbc
test eax, eax
jne 0x51f976
lea eax, [ebp + 0x20]
mov edx, 0x51fb28
call fcn.00404b94
mov eax, dword [ebp + 0x1c]
call fcn.00404dbc
test eax, eax
jne 0x51f98f
lea eax, [ebp + 0x1c]
mov edx, 0x51fb3c
call fcn.00404b94
mov eax, dword [ebp + 0x18]
call fcn.00404dbc
test eax, eax
jne 0x51f9a8
lea eax, [ebp + 0x18]
mov edx, 0x51fb50
call fcn.00404b94
cmp byte [ebp + 0x10], 0
je 0x51fa00
lea eax, [ebp - 0xc]
push eax
mov esi, dword [edi + 0xc]
mov dword [ebp - 0x34], esi
mov byte [ebp - 0x30], 0
mov eax, esi
xor edx, edx
push edx
push eax
lea edx, [ebp - 0x38]
mov eax, 1
call fcn.0040b22c
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x2c], eax
mov byte [ebp - 0x28], 0xb
lea ecx, [ebp - 0x3c]
mov edx, dword [edi + 0xc]
mov eax, dword [edi]
call dword [eax + 0x10]
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x24], eax
mov byte [ebp - 0x20], 0xb
lea edx, [ebp - 0x34]
mov ecx, 2
mov eax, 0x51fb64
call fcn.004f9394
lea eax, [ebp - 4]
mov edx, 0x51fbac
call fcn.00404b94
lea eax, [ebp - 0x10]
call fcn.00404afc
lea eax, [ebp - 4]
push eax
lea edx, [ebp - 0x17c]
mov eax, dword [edi]
call fcn.00403c30
lea eax, [ebp - 0x17c]
mov dword [ebp - 0x7c], eax
mov byte [ebp - 0x78], 4
mov eax, dword [ebp + 0x20]
mov dword [ebp - 0x74], eax
mov byte [ebp - 0x70], 0xb
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0x6c], eax
mov byte [ebp - 0x68], 0xb
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x64], eax
mov byte [ebp - 0x60], 0xb
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x5c], eax
mov byte [ebp - 0x58], 0
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x54], eax
mov byte [ebp - 0x50], 0xb
mov eax, dword [ebp - 8]
mov dword [ebp - 0x4c], eax
mov byte [ebp - 0x48], 0xb
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x44], eax
mov byte [ebp - 0x40], 0xb
lea edx, [ebp - 0x7c]
mov eax, 0x51fbac
mov ecx, 7
call fcn.004f9394
mov ecx, dword [ebp - 4]
xor edx, edx
mov eax, edi
call fcn.0040f13c
mov dl, 4
mov eax, edi
call fcn.0051f294
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x51fae4
lea eax, [ebp - 0x3c]
mov edx, 2
call fcn.00404b20
lea eax, [ebp - 0x1c]
call fcn.00404afc
lea eax, [ebp - 0x10]
mov edx, 4
call fcn.00404b20
lea eax, [ebp + 0x18]
mov edx, 3
call fcn.00404b20
ret