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

Disassembly:
push 0xffffffffffffffff
push 0x465dc1
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 8
push ebx
push ebp
push esi
push edi
mov ebp, ecx
mov eax, dword [ebp + 8]
mov ebx, dword [esp + 0x28]
xor edi, edi
cmp ebx, eax
mov dword [esp + 0x20], edi
jl 0x40f4d1
inc ebx
cmp ebx, edi
jne 0x40f381
mov esi, dword [ebp + 4]
cmp esi, edi
je 0x40f376
mov ecx, eax
dec eax
test ecx, ecx
je 0x40f367
lea ebx, [eax + 1]
push edi
mov ecx, esi
call fcn.0040f660
add esi, 0x6c
dec ebx
jne 0x40f359
mov eax, dword [ebp + 4]
push eax
call fcn.0045b503
add esp, 4
mov dword [ebp + 4], edi
mov dword [ebp + 0xc], edi
mov dword [ebp + 8], edi
jmp 0x40f4d1
mov ecx, dword [ebp + 4]
cmp ecx, edi
jne 0x40f3e7
lea eax, [ebx + ebx*2]
lea edi, [eax + eax*8]
shl edi, 2
push edi
call fcn.0045b4da
mov ecx, edi
mov esi, eax
mov edx, ecx
xor eax, eax
mov edi, esi
mov dword [ebp + 4], esi
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
add esp, 4
and ecx, 3
mov dword [esp + 0x10], esi
rep stosb byte es:[edi], al
lea edi, [ebx]
mov dword [esp + 0x14], esi
test esi, esi
mov byte [esp + 0x20], 1
je 0x40f3cd
mov ecx, esi
call fcn.0040f590
add esi, 0x6c
dec edi
mov byte [esp + 0x20], 0
mov dword [esp + 0x10], esi
jne 0x40f3b9
mov dword [ebp + 0xc], ebx
mov dword [ebp + 8], ebx
jmp 0x40f4d1
mov esi, dword [ebp + 0xc]
cmp ebx, esi
jg 0x40f42a
cmp eax, ebx
jge 0x40f40e
mov edx, ebx
sub edx, eax
lea eax, [eax + eax*2]
push edx
lea eax, [eax + eax*8]
lea ecx, [ecx + eax*4]
push ecx
call fcn.0040f5e0
mov dword [ebp + 8], ebx
jmp 0x40f4d1
jle 0x40f422
sub eax, ebx
push eax
lea eax, [ebx + ebx*2]
lea edx, [eax + eax*8]
lea eax, [ecx + edx*4]
push eax
call fcn.0040f5b0
mov dword [ebp + 8], ebx
jmp 0x40f4d1
mov ecx, dword [ebp + 0x10]
cmp ecx, edi
jne 0x40f455
cdq
and edx, 7
add eax, edx
mov ecx, eax
sar ecx, 3
cmp ecx, 4
jge 0x40f448
mov ecx, 4
jmp 0x40f455
cmp ecx, 0x400
jle 0x40f455
mov ecx, 0x400
lea eax, [esi + ecx]
cmp ebx, eax
jge 0x40f462
mov dword [esp + 0x10], eax
jmp 0x40f468
mov dword [esp + 0x10], ebx
mov eax, ebx
lea eax, [eax + eax*2]
lea ecx, [eax + eax*8]
shl ecx, 2
push ecx
call fcn.0045b4da
mov ecx, dword [ebp + 8]
mov esi, dword [ebp + 4]
mov edi, eax
add esp, 4
lea ecx, [ecx + ecx*2]
mov dword [esp + 0x14], eax
lea ecx, [ecx + ecx*8]
shl ecx, 2
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp + 8]
sub edx, ecx
lea ecx, [ecx + ecx*2]
push edx
lea ecx, [ecx + ecx*8]
lea edx, [eax + ecx*4]
push edx
call fcn.0040f5e0
mov eax, dword [ebp + 4]
push eax
call fcn.0045b503
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
add esp, 4
mov dword [ebp + 4], eax
mov dword [ebp + 8], ebx
mov dword [ebp + 0xc], ecx
mov eax, dword [esp + 0x28]
lea ecx, [esp + 0x2c]
push ecx
lea eax, [eax + eax*2]
lea edx, [eax + eax*8]
mov eax, dword [ebp + 4]
lea ebx, [eax + edx*4]
mov ecx, ebx
call fcn.0045b0af
mov edx, dword [esp + 0x30]
mov dword [ebx + 4], edx
mov eax, dword [esp + 0x34]
mov dword [ebx + 8], eax
mov ecx, dword [esp + 0x38]
mov dword [ebx + 0xc], ecx
mov edx, dword [esp + 0x3c]
mov dword [ebx + 0x10], edx
mov eax, dword [esp + 0x40]
mov dword [ebx + 0x14], eax
mov ecx, dword [esp + 0x44]
mov dword [ebx + 0x18], ecx
mov edx, dword [esp + 0x48]
mov dword [ebx + 0x1c], edx
mov eax, dword [esp + 0x4c]
mov dword [ebx + 0x20], eax
mov ecx, dword [esp + 0x50]
lea edx, [esp + 0x54]
mov dword [ebx + 0x24], ecx
push edx
lea ecx, [ebx + 0x28]
call fcn.0045b0af
lea edi, [ebx + 0x2c]
mov ecx, 0xf
lea esi, [esp + 0x58]
rep movsd dword es:[edi], dword [esi]
mov eax, dword [esp + 0x94]
mov dword [ebx + 0x68], eax
lea ecx, [esp + 0x54]
mov dword [esp + 0x20], 2
call fcn.0045af76
lea ecx, [esp + 0x2c]
mov dword [esp + 0x20], 0xffffffff
call fcn.0045af76
mov ecx, dword [esp + 0x18]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x14
ret 0x70