Function at 0x516380
Capabilities:
Access peb ldr_data

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x593e78
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x40
push ebx
push esi
push edi
mov edi, dword [ebp + 0x10]
mov eax, dword [edi]
mov edx, dword [edi + 8]
mov dword [ebp - 0x10], esp
mov esi, ecx
mov ecx, dword [edi + 4]
xor ebx, ebx
push 0xffffffffffffffff
mov dword [ebp - 0x4c], eax
push ebx
lea eax, [edi + 0xc]
mov dword [ebp - 0x48], ecx
push eax
lea ecx, [ebp - 0x40]
mov dword [ebp - 0x14], esi
mov dword [ebp - 0x44], edx
mov dword [ebp - 0x28], 0xf
mov dword [ebp - 0x2c], ebx
mov byte [ebp - 0x3c], bl
call fcn.00403f50
mov ecx, dword [edi + 0x28]
mov edx, dword [edi + 0x2c]
mov eax, dword [edi + 0x30]
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x20], edx
mov dword [ebp - 0x1c], eax
mov dword [ebp - 4], ebx
mov ebx, dword [esi + 4]
test ebx, ebx
jne 0x5163f8
xor ecx, ecx
jmp 0x51640e
mov ecx, dword [esi + 0xc]
sub ecx, ebx
mov eax, 0x4ec4ec4f
imul ecx
sar edx, 4
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
mov edi, dword [ebp + 0xc]
test edi, edi
je 0x516684
test ebx, ebx
jne 0x516421
xor eax, eax
jmp 0x516437
mov edx, dword [esi + 8]
sub edx, ebx
mov eax, 0x4ec4ec4f
imul edx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
mov edx, 0x4ec4ec4
sub edx, eax
cmp edx, edi
jae 0x516449
mov ecx, esi
call fcn.004f4050
test ebx, ebx
jne 0x516451
xor eax, eax
jmp 0x516467
mov edx, dword [esi + 8]
sub edx, ebx
mov eax, 0x4ec4ec4f
imul edx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
add eax, edi
cmp ecx, eax
jae 0x516594
mov eax, ecx
shr eax, 1
mov edx, 0x4ec4ec4
sub edx, eax
cmp edx, ecx
jae 0x516484
xor ecx, ecx
jmp 0x516486
add ecx, eax
test ebx, ebx
jne 0x51648e
xor eax, eax
jmp 0x5164a4
mov edx, dword [esi + 8]
sub edx, ebx
mov eax, 0x4ec4ec4f
imul edx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
add eax, edi
cmp ecx, eax
jae 0x5164b5
mov ecx, esi
call fcn.004e2530
mov ecx, eax
add ecx, edi
imul ecx, ecx, 0x34
push ecx
mov dword [ebp + 0x10], ecx
call fcn.00479702
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 8]
push ecx
mov ebx, eax
mov eax, dword [esi + 4]
push esi
push ebx
push edx
push eax
mov dword [ebp - 0x18], ebx
mov dword [ebp + 0xc], ebx
mov byte [ebp - 4], 1
call fcn.00515270
mov ecx, dword [ebp + 8]
add esp, 0x18
push ecx
push esi
lea edx, [ebp - 0x4c]
push edx
push edi
push eax
mov dword [ebp + 0xc], eax
call fcn.005154d0
mov edx, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
mov eax, edi
imul eax, eax, 0x34
add esp, 0x14
push edx
add ecx, eax
mov eax, dword [esi + 8]
push esi
push ecx
push eax
mov eax, dword [ebp + 8]
push eax
mov dword [ebp + 0xc], ecx
call fcn.00515270
mov eax, dword [esi + 4]
add esp, 0x14
test eax, eax
je 0x516539
mov ecx, dword [esi + 8]
sub ecx, eax
mov eax, 0x4ec4ec4f
imul ecx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
add edi, eax
mov eax, dword [esi + 4]
test eax, eax
je 0x51655a
mov ecx, dword [esi + 8]
push ecx
push eax
mov ecx, esi
call fcn.004f4510
mov edx, dword [esi + 4]
push edx
call fcn.004796fd
add esp, 4
mov eax, dword [ebp + 0x10]
imul edi, edi, 0x34
add eax, ebx
add edi, ebx
mov dword [esi + 0xc], eax
mov dword [esi + 8], edi
mov dword [esi + 4], ebx
jmp 0x516684
mov ecx, dword [esi + 8]
mov ebx, dword [ebp + 8]
mov edx, ecx
sub edx, ebx
mov eax, 0x4ec4ec4f
imul edx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp eax, edi
mov dword [ebp + 0x10], ecx
jae 0x516648
mov edx, dword [ebp + 8]
mov eax, edi
imul eax, eax, 0x34
push edx
mov dword [ebp + 0x10], eax
push esi
add eax, ebx
push eax
push ecx
push ebx
call fcn.00515270
mov ecx, dword [esi + 8]
add esp, 0x14
lea eax, [ebp - 0x4c]
push eax
mov edx, ecx
sub edx, ebx
mov eax, 0x4ec4ec4f
imul edx
sar edx, 4
mov eax, edx
shr eax, 0x1f
add eax, edx
sub edi, eax
push edi
push ecx
mov ecx, esi
mov byte [ebp - 4], 3
call fcn.00515f10
mov edi, dword [esi + 8]
mov eax, dword [ebp + 0x10]
add edi, eax
mov dword [esi + 8], edi
lea ecx, [ebp - 0x4c]
mov esi, edi
push ecx
sub esi, eax
push esi
push ebx
mov dword [ebp - 4], 0
call fcn.00515210
add esp, 0xc
jmp 0x516684
imul edi, edi, 0x34
mov eax, ecx
sub eax, edi
mov dword [ebp + 8], eax
mov edx, dword [ebp + 8]
push edx
push esi
push ecx
push ecx
push eax
call fcn.00515270
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 8]
mov dword [esi + 8], eax
mov eax, dword [ebp + 8]
push eax
push ecx
push edx
push ebx
call fcn.005145b0
lea eax, [ebp - 0x4c]
push eax
add edi, ebx
push edi
push ebx
call fcn.00515210
add esp, 0x30
cmp dword [ebp - 0x28], 0x10
jb 0x516696
mov ecx, dword [ebp - 0x3c]
push ecx
call fcn.004796fd
add esp, 4
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret 0xc