Function at 0x4a8530
Capabilities:
Check for peb beingdebugged flag

Disassembly:
push 0xffffffffffffffff
push 0x547a88
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x20
push ebx
push ebp
push esi
mov esi, dword [esp + 0x44]
push edi
mov edi, dword [ecx + 0x1c]
movsx ecx, word [esi + 2]
mov eax, dword [edi + 8]
push eax
movsx eax, word [esi + 6]
movsx edx, word [esi]
sub eax, ecx
lea ecx, [esp + 0x1c]
inc eax
push eax
movsx eax, word [esi + 4]
sub eax, edx
inc eax
push eax
call fcn.004bb710
xor ebp, ebp
mov ecx, edi
mov dword [esp + 0x38], ebp
call fcn.004bb8c0
test eax, eax
je 0x4a8591
lea ecx, [esp + 0x18]
call fcn.004bb8b0
mov eax, dword [edi + 8]
mov dword [esp + 0x48], ebp
cmp eax, 8
jle 0x4a8622
lea ecx, [esp + 0x10]
push ebp
push ecx
mov ecx, edi
call fcn.004bc360
mov ecx, eax
movsx eax, word [ecx + 6]
movsx edx, word [ecx + 2]
add eax, edx
cdq
sub eax, edx
mov ebp, eax
movsx eax, word [ecx + 4]
movsx ecx, word [ecx]
add eax, ecx
mov ecx, edi
cdq
sub eax, edx
sar ebp, 1
sar eax, 1
movsx edx, bp
movsx ebx, ax
push edx
lea eax, [esp + 0x14]
push ebx
push eax
call fcn.004bb8d0
cmp dword [eax], 0
je 0x4a8620
movsx eax, word [esi + 6]
movsx ecx, word [esi + 2]
add eax, ecx
mov ecx, edi
cdq
sub eax, edx
sar eax, 1
movsx edx, ax
push edx
lea eax, [esp + 0x14]
push ebx
push eax
call fcn.004bb8d0
cmp dword [eax], 0
je 0x4a8620
lea ecx, [esp + 0x18]
call fcn.004bb8b0
mov ecx, dword [0x67a8e4]
mov dword [esp + 0x48], ecx
xor ebp, ebp
mov edx, dword [esp + 0x48]
mov eax, dword [0x67a8e4]
test edx, eax
je 0x4a86a9
mov eax, dword [esp + 0x50]
mov ecx, dword [0x67a95c]
test eax, ecx
jne 0x4a86b2
mov al, byte [0x943a3d]
test al, 1
jne 0x4a866c
mov dl, al
push fcn.00458ab0
or dl, 1
mov word [0x9660fc], bp
mov byte [0x943a3d], dl
mov word [0x9660fe], bp
call fcn.0053228e
add esp, 4
movsx ecx, word [esi + 2]
movsx edx, word [esi + 6]
movsx eax, word [esi]
mov word [esp + 0x12], cx
sub edx, ecx
movsx ecx, word [esi + 4]
sub ecx, eax
push ebp
inc edx
push ebp
inc ecx
push edx
mov word [esp + 0x1c], ax
push ecx
lea edx, [esp + 0x20]
push 0x9660fc
lea eax, [esp + 0x2c]
push edx
push eax
push edi
call fcn.0047d2c0
add esp, 0x20
jmp 0x4a86b2
lea ecx, [esp + 0x18]
call fcn.004bc200
mov al, byte [0x943a3d]
test al, 1
jne 0x4a86e1
mov dl, al
push fcn.00458ab0
or dl, 1
mov word [0x9660fc], bp
mov byte [0x943a3d], dl
mov word [0x9660fe], bp
call fcn.0053228e
add esp, 4
mov ecx, dword [0x9660fc]
mov edx, dword [esp + 0x54]
mov eax, dword [esp + 0x4c]
mov ebx, dword [esp + 0x44]
push ecx
mov ecx, dword [esp + 0x44]
push edx
push eax
push ecx
lea edx, [esp + 0x28]
push ebx
lea eax, [esp + 0x24]
push edx
push eax
call fcn.004d2e70
mov ecx, eax
call fcn.004d3280
mov eax, dword [eax]
xor ecx, ecx
movsx ebp, word [esi]
mov dword [esp + 0x10], eax
mov edx, eax
movsx eax, word [esi + 4]
and edx, 0xffff
sub eax, edx
mov dword [esp + 0x54], edx
mov dl, byte [ebx + 7]
sub eax, ebp
inc eax
cmp dl, 3
jne 0x4a8743
cdq
sub eax, edx
mov ecx, eax
sar ecx, 1
jmp 0x4a874f
cmp dl, 1
je 0x4a874d
cmp dl, 2
jne 0x4a874f
mov ecx, eax
mov eax, ecx
mov edx, 0
neg eax
sets dl
dec edx
and eax, edx
xor edx, edx
test ecx, ecx
setl dl
dec edx
and ecx, edx
mov edx, dword [0x67a8e4]
lea ebx, [ecx + ebp]
mov ecx, dword [esp + 0x48]
test ecx, edx
je 0x4a8838
mov edx, dword [esp + 0x50]
mov ecx, dword [0x67a95c]
test edx, ecx
je 0x4a8838
mov al, byte [0x943a3d]
test al, 1
jne 0x4a87c2
mov dl, al
xor ebp, ebp
or dl, 1
push fcn.00458ab0
mov byte [0x943a3d], dl
mov word [0x9660fc], bp
mov word [0x9660fe], bp
call fcn.0053228e
add esp, 4
jmp 0x4a87c4
xor ebp, ebp
movsx ecx, word [esi + 2]
movsx edx, word [esi + 6]
movsx eax, word [esi]
mov word [esp + 0x52], cx
sub edx, ecx
movsx ecx, word [esi + 4]
sub ecx, eax
push ebp
inc edx
push ebp
inc ecx
push edx
mov word [esp + 0x5c], ax
push ecx
lea edx, [esp + 0x60]
push 0x9660fc
lea eax, [esp + 0x2c]
push edx
push eax
push edi
call fcn.0047d2c0
mov edx, dword [esp + 0x6c]
mov eax, dword [esp + 0x60]
add esp, 0x20
mov word [esp + 0x50], bx
mov word [esp + 0x52], bp
mov ecx, dword [esp + 0x50]
push ecx
mov ecx, dword [esp + 0x48]
push ebp
push edx
push eax
lea edx, [esp + 0x28]
push ecx
lea eax, [esp + 0x64]
push edx
push eax
call fcn.004d2e70
mov ecx, eax
call fcn.004d3280
mov eax, ebx
jmp 0x4a883a
xor ebp, ebp
movsx ecx, word [esi + 2]
mov edx, dword [esp + 0x54]
mov word [esp + 0x52], cx
mov ecx, dword [esp + 0x12]
push ebp
and ecx, 0xffff
mov word [esp + 0x50], ax
push 1
push ecx
lea eax, [esp + 0x5c]
push edx
lea ecx, [esp + 0x5c]
push eax
push ecx
lea edx, [esp + 0x30]
push edi
push edx
mov word [esp + 0x70], bx
mov word [esp + 0x6e], bp
call fcn.0047d2c0
add esp, 0x20
lea ecx, [esp + 0x18]
mov dword [esp + 0x38], 0xffffffff
call fcn.004bc350
mov ecx, dword [esp + 0x30]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x2c
ret 0x18