Function at 0x40c790
Capabilities:
Access peb ldr_data
Get ntdll base address

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x53ae1d
mov eax, dword fs:[0]
push eax
sub esp, 0x30
mov eax, dword [0x58213c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0x38], edi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x3c], edi
mov dword [edi], 0x582008
mov dword [edi + 0x10], 0
mov dword [edi + 0x14], 0
movzx eax, word [esi + 0xa]
mov ecx, eax
mov dword [ebp - 4], 0
movzx eax, al
and ecx, 0xff00
or cx, ax
mov dword [ebp - 0x14], 0xffffffff
setne al
mov byte [edi + 0x30], al
movzx eax, word [esi + 0xe]
mov ecx, eax
movzx eax, al
and ecx, 0xff00
or ecx, eax
movzx eax, word [esi + 0xc]
mov edx, eax
movzx eax, al
and edx, 0xff00
or edx, eax
mov eax, ecx
shr eax, 9
add eax, 0x50
mov dword [ebp - 0x20], eax
mov eax, ecx
shr eax, 5
and ecx, 0x1f
and eax, 0xf
mov dword [ebp - 0x28], ecx
dec eax
mov dword [ebp - 0x24], eax
mov eax, edx
shr eax, 0xb
mov dword [ebp - 0x2c], eax
mov eax, edx
shr eax, 5
and edx, 0x1f
and eax, 0x3f
add edx, edx
mov dword [ebp - 0x30], eax
lea eax, [ebp - 0x34]
push eax
mov dword [ebp - 0x34], edx
call fcn.00519e21
add esp, 4
push 0
push 0x3e8
push edx
push eax
call fcn.005122e0
mov dword [edi + 0x10], eax
mov dword [edi + 0x14], edx
mov edx, dword [esi + 0x14]
mov eax, edx
shr eax, 0x10
movzx ecx, al
mov eax, edx
shr eax, 8
movzx eax, al
shl ecx, 8
or ecx, eax
mov dword [edi + 0x2c], 0
shl ecx, 8
mov eax, edx
and eax, 0xff000000
or ecx, eax
movzx eax, dl
or ecx, eax
mov dword [edi + 0x28], ecx
mov edx, dword [esi + 0x18]
mov eax, edx
shr eax, 0x10
movzx ecx, al
mov eax, edx
shl ecx, 8
shr eax, 8
movzx eax, al
or ecx, eax
mov dword [edi + 0xc], 0
shl ecx, 8
mov eax, edx
and eax, 0xff000000
or ecx, eax
movzx eax, dl
or ecx, eax
mov dword [edi + 8], ecx
mov edx, dword [esi + 0x2a]
mov eax, edx
shr eax, 0x10
movzx ecx, al
mov eax, edx
shr eax, 8
movzx eax, al
shl ecx, 8
or ecx, eax
mov dword [edi + 0x24], 0
mov eax, edx
shl ecx, 8
and eax, 0xff000000
or ecx, eax
movzx eax, dl
or ecx, eax
mov dword [edi + 0x20], ecx
mov ecx, dword [esi + 0x26]
mov eax, ecx
shr eax, 0x10
movzx edx, al
mov eax, ecx
shr eax, 8
shl edx, 8
movzx eax, al
or edx, eax
mov eax, ecx
shl edx, 8
and eax, 0xff000000
or edx, eax
movzx eax, cl
or edx, eax
mov dword [edi + 0x1c], edx
and edx, 0xf0000000
cmp edx, 0xa0000000
sete al
mov byte [edi + 0x18], al
add esi, 0x2e
je 0x40c981
mov eax, dword [ebp + 0xc]
test eax, eax
jns 0x40c96e
lea eax, [ebp - 0x38]
push esi
push eax
call fcn.00408d80
mov ecx, dword [ebp - 0x38]
add esp, 8
jmp 0x40c986
jle 0x40c981
add eax, esi
lea ecx, [ebp - 0x38]
push eax
push esi
call fcn.0040c040
mov ecx, dword [ebp - 0x38]
jmp 0x40c986
mov ecx, 0x582008
mov eax, dword [edi]
add eax, 0xfffffff8
mov dword [edi], ecx
cmp eax, section..data
je 0x40c9aa
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
cmp ecx, 0xffffffff
jne 0x40c9aa
push eax
call fcn.00511f41
add esp, 4
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00511b56
mov esp, ebp
pop ebp
ret 8