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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x52db38
mov eax, dword fs:[0]
push eax
sub esp, 0x40
push ebx
push esi
push edi
mov eax, dword [0x58c250]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov edi, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
push 0
push edi
push ebx
call fcn.004b4210
add esp, 0xc
push 0x58c214
mov eax, edi
shr eax, 1
push eax
push ebx
lea ecx, [ebp + 0xc]
call fcn.00401780
mov ebx, 1
mov dword [ebp - 4], ebx
lea ecx, [ebp + 0xc]
call fcn.0045ba20
mov ecx, dword [ebp + 0xc]
mov eax, dword [ecx - 0xc]
test eax, eax
jle 0x476f15
push 0x3b
push ecx
call fcn.004f4b06
add esp, 8
test eax, eax
je 0x476f15
mov ecx, dword [ebp + 0xc]
sub eax, ecx
sar eax, 1
mov dword [ebp - 0x10], eax
cmp eax, 0xffffffff
je 0x476f15
mov edx, dword [ecx - 0xc]
inc eax
mov dword [ebp - 0x34], eax
js 0x476f15
cmp eax, edx
jge 0x476f15
lea ecx, [ecx + eax*2]
push 0x3b
push ecx
call fcn.004f4b06
add esp, 8
test eax, eax
je 0x476f15
mov ecx, dword [ebp + 0xc]
sub eax, ecx
sar eax, 1
mov dword [ebp - 0x14], eax
cmp eax, 0xffffffff
je 0x476f15
mov edx, dword [ecx - 0xc]
inc eax
mov dword [ebp - 0x38], eax
js 0x476f15
cmp eax, edx
jge 0x476f15
lea edx, [ecx + eax*2]
push 0x3b
push edx
call fcn.004f4b06
add esp, 8
test eax, eax
je 0x476f15
mov ecx, dword [ebp + 0xc]
sub eax, ecx
sar eax, 1
mov dword [ebp - 0x18], eax
cmp eax, 0xffffffff
je 0x476f15
mov edx, dword [ecx - 0xc]
inc eax
mov dword [ebp - 0x3c], eax
js 0x476f15
cmp eax, edx
jg 0x476f15
lea eax, [ecx + eax*2]
push 0x53f73c
push eax
call fcn.004f09ab
add esp, 8
test eax, eax
je 0x476f15
sub eax, dword [ebp + 0xc]
sar eax, 1
mov dword [ebp - 0x1c], eax
cmp eax, 0xffffffff
je 0x476f15
inc eax
push eax
push 0x3b
lea ecx, [ebp + 0xc]
mov dword [ebp - 0x40], eax
call fcn.004592f0
mov dword [ebp - 0x20], eax
cmp eax, 0xffffffff
je 0x476f15
inc eax
push eax
push 0x3b
lea ecx, [ebp + 0xc]
mov dword [ebp - 0x44], eax
call fcn.004592f0
mov dword [ebp - 0x24], eax
cmp eax, 0xffffffff
je 0x476f15
inc eax
push eax
push 0x3b
lea ecx, [ebp + 0xc]
mov dword [ebp - 0x48], eax
call fcn.004592f0
mov dword [ebp - 0x28], eax
cmp eax, 0xffffffff
je 0x476f15
inc eax
push eax
push 0x53c26c
lea ecx, [ebp + 0xc]
mov dword [ebp - 0x4c], eax
call fcn.004019c0
mov dword [ebp - 0x2c], eax
cmp eax, 0xffffffff
jne 0x476f61
mov ecx, dword [ebp + 8]
push 0
push edi
push ecx
call fcn.004b4210
add esp, 0xc
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x476f4a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
or eax, 0xffffffff
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
lea ecx, [ebp + 0xc]
push ecx
mov ecx, esi
call fcn.00460300
mov edx, dword [ebp - 0x10]
push edx
lea eax, [ebp - 0x30]
push eax
lea ecx, [ebp + 0xc]
call fcn.00401b70
mov byte [ebp - 4], 2
lea ecx, [esi + 0x14]
push eax
call fcn.004022d0
mov byte [ebp - 4], bl
lea ecx, [ebp - 0x30]
call fcn.00401ac0
mov ecx, dword [ebp - 0x14]
sub ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x34]
sub ecx, ebx
push ecx
push edx
lea eax, [ebp - 0x34]
push eax
lea ecx, [ebp + 0xc]
call fcn.00401c40
mov byte [ebp - 4], 3
lea ecx, [esi + 0x10]
push eax
call fcn.004022d0
mov byte [ebp - 4], bl
lea ecx, [ebp - 0x34]
call fcn.00401ac0
mov ecx, dword [ebp - 0x18]
sub ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x38]
sub ecx, ebx
push ecx
push edx
lea eax, [ebp - 0x38]
push eax
lea ecx, [ebp + 0xc]
call fcn.00401c40
mov byte [ebp - 4], 4
lea ecx, [esi + 8]
push eax
call fcn.004022d0
mov byte [ebp - 4], bl
lea ecx, [ebp - 0x38]
call fcn.00401ac0
mov ecx, dword [ebp - 0x1c]
sub ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0x3c]
sub ecx, ebx
push ecx
push edx
lea eax, [ebp - 0x3c]
push eax
lea ecx, [ebp + 0xc]
call fcn.00401c40
mov byte [ebp - 4], 5
lea ecx, [esi + 0xc]
push eax
call fcn.004022d0
mov byte [ebp - 4], bl
lea ecx, [ebp - 0x3c]
call fcn.00401ac0
mov ecx, dword [ebp - 0x20]
sub ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x40]
sub ecx, ebx
push ecx
push edx
lea eax, [ebp - 0x40]
push eax
lea ecx, [ebp + 0xc]
call fcn.00401c40
mov byte [ebp - 4], 6
lea ecx, [esi + 0x2c]
push eax
call fcn.004022d0
mov byte [ebp - 4], bl
lea ecx, [ebp - 0x40]
call fcn.00401ac0
mov ecx, dword [ebp - 0x24]
sub ecx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x44]
sub ecx, ebx
push ecx
push edx
lea eax, [ebp - 0x44]
push eax
lea ecx, [ebp + 0xc]
call fcn.00401c40
mov byte [ebp - 4], 7
lea ecx, [esi + 0x30]
push eax
call fcn.004022d0
mov byte [ebp - 4], bl
lea ecx, [ebp - 0x44]
call fcn.00401ac0
mov ecx, dword [ebp - 0x28]
sub ecx, dword [ebp - 0x24]
mov edx, dword [ebp - 0x48]
sub ecx, ebx
push ecx
push edx
lea eax, [ebp - 0x48]
push eax
lea ecx, [ebp + 0xc]
call fcn.00401c40
mov byte [ebp - 4], 8
lea ecx, [esi + 0x34]
push eax
call fcn.004022d0
mov byte [ebp - 4], bl
lea ecx, [ebp - 0x48]
call fcn.00401ac0
mov ecx, dword [ebp - 0x2c]
sub ecx, dword [ebp - 0x28]
mov edx, dword [ebp - 0x4c]
sub ecx, ebx
push ecx
push edx
lea eax, [ebp - 0x4c]
push eax
lea ecx, [ebp + 0xc]
call fcn.00401c40
mov byte [ebp - 4], 9
mov ecx, eax
call fcn.0045bc00
mov ecx, eax
call fcn.0045ba20
lea ecx, [esi + 0x38]
push eax
call fcn.004022d0
mov byte [ebp - 4], bl
lea ecx, [ebp - 0x4c]
call fcn.00401ac0
mov ecx, dword [ebp - 0x2c]
add ecx, ecx
lea esi, [ecx + 2]
mov eax, 0xcccccccd
mul esi
shr edx, 2
lea edx, [edx + edx*4]
mov eax, ecx
sub eax, edx
add eax, 2
sub edi, ecx
push eax
sub edi, 2
push edi
mov eax, dword [ebp + 8]
lea ecx, [ecx + eax + 2]
push ecx
call fcn.004b4210
add esp, 0xc
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 0xc]
call fcn.00401ac0
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8