Function at 0x512310
Capabilities:
Access peb ldr_data
Get kernel32 base address

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffb4
xor ecx, ecx
mov dword [ebp - 0x4c], ecx
mov dword [ebp - 0x48], ecx
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x34], ecx
mov dword [ebp - 0x40], ecx
mov dword [ebp - 0x30], ecx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x51255b
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 4]
mov eax, dword [eax + 4]
mov eax, dword [eax + 0x18]
mov ecx, dword [eax + 0xc]
lea eax, [ebp - 0xc]
mov edx, 0x512574
call fcn.004080a8
mov eax, dword [ebp - 8]
push eax
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x2c], eax
mov byte [ebp - 0x28], 0x11
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2c]
push eax
lea eax, [ebp - 0x30]
push eax
mov eax, dword [ebp - 4]
mov cx, word [eax + 0x30]
xor edx, edx
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x1c]
call fcn.0050fc70
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x24], eax
mov byte [ebp - 0x20], 0x11
lea edx, [ebp - 0x2c]
mov ecx, 1
mov eax, 0x512588
call fcn.004b0ec8
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0xc]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
je 0x5123bd
mov eax, dword [ebp - 0x10]
sub eax, 4
mov eax, dword [eax]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jle 0x51240d
lea eax, [ebp - 0x34]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2c]
push eax
lea eax, [ebp - 0x40]
push eax
mov eax, dword [ebp - 4]
mov cx, word [eax + 0x30]
xor edx, edx
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0xc]
call fcn.0050fc70
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x3c], eax
mov byte [ebp - 0x38], 0x11
lea edx, [ebp - 0x3c]
xor ecx, ecx
mov eax, 0x5125f0
call fcn.004b0ec8
mov edx, dword [ebp - 0x34]
mov eax, dword [ebp - 8]
call fcn.00408050
mov eax, dword [ebp - 8]
mov eax, dword [ebp - 8]
mov edx, 0x51261c
call fcn.00408050
mov eax, dword [ebp - 8]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x14]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x512437
mov eax, dword [ebp - 0x14]
sub eax, 4
mov eax, dword [eax]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jle 0x5124cd
lea eax, [ebp - 0x44]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x14]
mov dword [ebp - 0x3c], eax
mov byte [ebp - 0x38], 0x11
lea edx, [ebp - 0x3c]
xor ecx, ecx
mov eax, 0x512630
call fcn.004b0ec8
mov edx, dword [ebp - 0x44]
mov eax, dword [ebp - 8]
call fcn.00408050
mov eax, dword [ebp - 8]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x10]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x512489
mov eax, dword [ebp - 0x18]
sub eax, 4
mov eax, dword [eax]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jle 0x5124bd
lea eax, [ebp - 0x48]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x10]
mov dword [ebp - 0x3c], eax
mov byte [ebp - 0x38], 0x11
lea edx, [ebp - 0x3c]
xor ecx, ecx
mov eax, 0x512660
call fcn.004b0ec8
mov edx, dword [ebp - 0x48]
mov eax, dword [ebp - 8]
call fcn.00408050
mov eax, dword [ebp - 8]
mov eax, dword [ebp - 8]
mov edx, 0x51261c
call fcn.00408050
mov eax, dword [ebp - 8]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x18]
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
je 0x5124e7
mov eax, dword [ebp - 0x1c]
sub eax, 4
mov eax, dword [eax]
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jle 0x51251b
lea eax, [ebp - 0x4c]
push eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x18]
mov dword [ebp - 0x3c], eax
mov byte [ebp - 0x38], 0x11
lea edx, [ebp - 0x3c]
xor ecx, ecx
mov eax, 0x51268c
call fcn.004b0ec8
mov edx, dword [ebp - 0x4c]
mov eax, dword [ebp - 8]
call fcn.00408050
mov eax, dword [ebp - 8]
mov eax, dword [ebp - 8]
mov edx, 0x51261c
call fcn.00408050
mov eax, dword [ebp - 8]
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x512562
lea eax, [ebp - 0x4c]
mov edx, 4
call fcn.004071cc
lea eax, [ebp - 0x34]
mov edx, 2
call fcn.004071cc
lea eax, [ebp - 0xc]
call fcn.0040716c
ret