Function at 0x51871a
Capabilities:
Check for peb beingdebugged flag

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x62cb28
mov eax, dword fs:[0]
push eax
sub esp, 0x20
push ebx
push esi
push edi
mov eax, dword [0x652018]
xor eax, esp
push eax
lea eax, [esp + 0x30]
mov dword fs:[0], eax
mov ebx, ecx
mov esi, dword [ebp + 8]
test byte [esi + 2], 1
je 0x518768
xor eax, eax
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebp + 0xc]
mov byte [eax], 0
mov ecx, dword [ebx + 0x210]
mov eax, dword [ecx]
push dword [eax + 0x10]
lea eax, [ecx + 0x284]
push eax
lea ecx, [esp + 0x20]
call fcn.00402cea
cmp dword [esp + 0x18], 1
jne 0x5187ca
mov ecx, dword [esp + 0x1c]
call 0x3da5aa
cmp eax, 6
jne 0x5187ca
mov ecx, dword [ebx + 0x210]
mov eax, dword [ecx]
push dword [eax + 0x10]
lea eax, [ecx + 0x284]
push eax
lea ecx, [esp + 0x20]
call fcn.00402cea
mov edi, dword [esp + 0x18]
dec edi
neg edi
sbb edi, edi
not edi
and edi, dword [esp + 0x1c]
jmp 0x5187cc
xor edi, edi
mov ecx, dword [ebx + 0x210]
mov eax, dword [ecx]
push dword [eax + 0x10]
lea eax, [ecx + 0x20c]
push eax
lea ecx, [esp + 0x20]
call fcn.00402cea
mov eax, dword [esp + 0x18]
dec eax
neg eax
sbb eax, eax
not eax
and eax, dword [esp + 0x1c]
mov dword [esp + 0x18], eax
xor eax, eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x38], eax
mov ecx, dword [ebp + 0x10]
push ecx
push esi
push dword [esi + 0x1c]
mov ecx, ebx
call fcn.0051720a
test al, al
je 0x51882a
mov eax, dword [ebp + 0xc]
mov byte [eax], 1
jmp 0x51894c
test edi, edi
je 0x51888f
mov ecx, dword [esi + 0x1c]
lea eax, [esp + 0x20]
push 0
push 0
push 0
push dword [ebx + 0x10]
mov edx, edi
push eax
push 0
lea eax, [ebx + 0x6c]
push eax
call fcn.0048255a
test al, al
je 0x51888f
cmp dword [ebp + 0x10], 0
mov eax, dword [esp + 0x28]
mov edi, dword [eax]
mov eax, dword [ebp + 0xc]
mov byte [eax], 1
je 0x518871
mov ecx, dword [edi + 0x54]
mov ecx, dword [ecx]
call 0x3dc92a
mov ecx, dword [ebp + 0x10]
mov dword [ecx], eax
lea ecx, [esp + 0x20]
call fcn.00482a5a
test al, al
jne 0x5188e9
push dword [esi + 0x1c]
lea eax, [esi + 4]
push eax
push 0x7d60
jmp 0x518943
mov edi, dword [esp + 0x18]
test edi, edi
je 0x5188b6
mov ecx, dword [esi + 0x1c]
lea eax, [ebx + 0x6c]
push 0
push 0
push 0
push dword [ebx + 0x10]
mov edx, edi
push 0
push 0
push eax
call fcn.0048255a
test al, al
jne 0x5188cb
mov ecx, dword [esi + 0x1c]
call 0x3e942a
test al, al
je 0x518937
cmp byte [ebx + 0x105], 0
jne 0x518937
cmp dword [ebp + 0x10], 0
mov eax, dword [ebp + 0xc]
mov byte [eax], 1
je 0x5188e9
mov ecx, dword [ebx + 0x210]
push 7
call fcn.0040301a
mov ecx, dword [ebp + 0x10]
mov dword [ecx], eax
test edi, edi
je 0x51894c
push 0
push 0
lea eax, [esp + 0x1d]
mov byte [esp + 0x1f], 0
push eax
lea eax, [esp + 0x24]
mov byte [esp + 0x22], 0
push eax
push 0
lea eax, [esp + 0x2a]
mov dword [esp + 0x2c], 0
push eax
lea eax, [esp + 0x2f]
mov byte [esp + 0x2d], 0
push eax
push 0
push 0
push 0
push edi
push esi
mov ecx, ebx
call fcn.0046d6da
mov esi, eax
test byte [esi + 2], 1
jne 0x51894a
jmp 0x51894c
push dword [esi + 0x1c]
lea eax, [esi + 4]
push eax
push 0x7d17
mov ecx, ebx
call fcn.0042202a
xor esi, esi
mov dword [esp + 0x38], 0xffffffff
mov eax, dword [esp + 0x28]
test eax, eax
je 0x51896b
push eax
push 0
push dword [0x65e8d0]
call dword [0x66016c]
mov eax, esi
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc