Function at 0x402f18
Capabilities:
Access peb ldr_data
Check for peb beingdebugged flag
Check for peb ntglobalflag flag

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov dword [ebp - 4], 0
mov dword [ebp - 8], 0
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 0
mov eax, dword fs:[0x30]
movzx eax, byte [eax + 2]
test eax, eax
jne 0x402f79
mov eax, dword fs:[0x30]
mov eax, dword [eax + 0x68]
and eax, 0x70
test eax, eax
jne 0x402f79
mov eax, dword fs:[0x30]
mov eax, dword [eax + 0x18]
cmp dword [eax + 0xc], 2
jne 0x402f79
cmp dword [eax + 0x10], 0
jne 0x402f79
xor eax, eax
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x4031a4
mov dword [ebp - 0x18], esp
mov eax, 0
call fcn.0040f71e
cmp dword [ebp - 0x18], esp
je 0x402fa5
push 6
call fcn.0040f718
add esp, 4
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x20], esp
push 0x100
push 0
push dword [ebp - 0x1c]
mov eax, 1
call fcn.0040f71e
cmp dword [ebp - 0x20], esp
je 0x402fd4
push 6
call fcn.0040f718
add esp, 4
mov dword [ebp - 8], eax
lea eax, [ebp - 0xc]
mov ebx, eax
mov ecx, 0
push ecx
push ebx
mov dword [ebx], ecx
cmp ecx, 0x100
jg 0x40312f
fild dword [ebp - 8]
fstp qword [ebp - 0x1c]
fld qword [ebp - 0x1c]
fild dword [ebp - 0xc]
fstp qword [ebp - 0x24]
fadd qword [ebp - 0x24]
fstp qword [ebp - 0x2c]
push 0x80000301
push 0
push 4
fld qword [ebp - 0x2c]
call fcn.00402e45
push 0x80000301
push 0
push eax
push 2
mov ebx, 0x411b00
call fcn.0040f724
add esp, 0x1c
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x30]
push eax
mov ebx, dword [ebp - 0x10]
test ebx, ebx
je 0x40304b
push ebx
call fcn.0040f70c
add esp, 4
pop eax
mov dword [ebp - 0x10], eax
mov eax, 0x49a367
xor ecx, ecx
test eax, eax
je 0x40305d
mov ecx, dword [eax + 4]
push ecx
add eax, 8
push eax
mov eax, dword [ebp - 0x10]
xor ebx, ebx
test eax, eax
je 0x40306e
mov ebx, dword [eax + 4]
add eax, 8
push eax
cmp ebx, ecx
mov eax, 1
jne 0x403085
dec eax
test ecx, ecx
je 0x403085
call fcn.00402e6c
add esp, 0xc
test eax, eax
jne 0x403098
inc dword [ebp - 0x14]
jmp 0x403125
mov eax, 0x49a373
xor ecx, ecx
test eax, eax
je 0x4030a6
mov ecx, dword [eax + 4]
push ecx
add eax, 8
push eax
mov eax, dword [ebp - 0x10]
xor ebx, ebx
test eax, eax
je 0x4030b7
mov ebx, dword [eax + 4]
add eax, 8
push eax
cmp ebx, ecx
mov eax, 1
jne 0x4030ce
dec eax
test ecx, ecx
je 0x4030ce
call fcn.00402e6c
add esp, 0xc
test eax, eax
jne 0x4030e1
inc dword [ebp - 0x14]
jmp 0x403125
mov eax, 0x49a37f
xor ecx, ecx
test eax, eax
je 0x4030ef
mov ecx, dword [eax + 4]
push ecx
add eax, 8
push eax
mov eax, dword [ebp - 0x10]
xor ebx, ebx
test eax, eax
je 0x403100
mov ebx, dword [eax + 4]
add eax, 8
push eax
cmp ebx, ecx
mov eax, 1
jne 0x403117
dec eax
test ecx, ecx
je 0x403117
call fcn.00402e6c
add esp, 0xc
test eax, eax
jne 0x403125
inc dword [ebp - 0x14]
pop ebx
pop ecx
add ecx, 4
jmp 0x402fe1
add esp, 8
mov dword [ebp - 0x18], esp
mov eax, 0
call fcn.0040f71e
cmp dword [ebp - 0x18], esp
je 0x403151
push 6
call fcn.0040f718
add esp, 4
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x20], esp
push dword [ebp - 8]
push 0
push dword [ebp - 0x1c]
mov eax, 2
call fcn.0040f71e
cmp dword [ebp - 0x20], esp
je 0x40317e
push 6
call fcn.0040f718
add esp, 4
cmp dword [ebp - 0x14], 0xa
mov eax, 0
setg al
test eax, eax
je 0x40319c
mov eax, 1
jmp 0x4031a1
mov eax, 0
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
jmp 0x4031ac
push eax
mov ebx, dword [ebp - 0x10]
test ebx, ebx
je 0x4031bd
push ebx
call fcn.0040f70c
add esp, 4
pop eax
mov esp, ebp
pop ebp
ret