Function at 0x499c80
Capabilities:
Check for peb beingdebugged flag

Disassembly:
push 0xffffffffffffffff
push 0x531778
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x20
push ebx
push ebp
mov ebp, dword [ecx + 0x1c]
push esi
mov esi, dword [esp + 0x44]
push edi
mov eax, dword [ebp + 8]
movsx ecx, word [esi + 2]
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.004a8200
xor ebx, ebx
mov ecx, ebp
mov dword [esp + 0x38], ebx
call fcn.004a83b0
test eax, eax
je 0x499ce1
lea ecx, [esp + 0x18]
call fcn.004a83a0
mov eax, dword [ebp + 8]
mov dword [esp + 0x48], ebx
cmp eax, 8
jle 0x499d46
lea ecx, [esp + 0x10]
push ebx
push ecx
mov ecx, ebp
call fcn.004a8cf0
mov ecx, eax
movsx eax, word [ecx + 6]
movsx edx, word [ecx + 2]
add eax, edx
cdq
sub eax, edx
mov edi, eax
movsx eax, word [ecx + 4]
movsx ecx, word [ecx]
add eax, ecx
lea ecx, [esp + 0x10]
cdq
sub eax, edx
sar edi, 1
sar eax, 1
movsx edx, di
movsx eax, ax
push edx
push eax
push ecx
mov ecx, ebp
call fcn.004a83c0
cmp dword [eax], ebx
je 0x499d46
lea ecx, [esp + 0x18]
call fcn.004a83a0
mov edx, dword [0x659a34]
mov dword [esp + 0x48], edx
mov eax, dword [esp + 0x48]
mov ecx, dword [0x659a34]
test eax, ecx
je 0x499dcd
mov ecx, dword [esp + 0x50]
mov eax, dword [0x659aac]
test ecx, eax
jne 0x499dd6
mov al, byte [0x8d8105]
test al, 1
jne 0x499d90
mov dl, al
push fcn.00402b00
or dl, 1
mov word [0x8fa7d8], bx
mov byte [0x8d8105], dl
mov word [0x8fa7da], bx
call fcn.0051c6ca
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 ebx
inc edx
push ebx
inc ecx
push edx
mov word [esp + 0x1c], ax
push ecx
lea edx, [esp + 0x20]
push 0x8fa7d8
lea eax, [esp + 0x2c]
push edx
push eax
push ebp
call fcn.00474b30
add esp, 0x20
jmp 0x499dd6
lea ecx, [esp + 0x18]
call fcn.004a8b90
mov al, byte [0x8d8105]
test al, 1
jne 0x499e05
mov dl, al
push fcn.00402b00
or dl, 1
mov word [0x8fa7d8], bx
mov byte [0x8d8105], dl
mov word [0x8fa7da], bx
call fcn.0051c6ca
add esp, 4
mov ecx, dword [0x8fa7d8]
mov edx, dword [esp + 0x54]
mov eax, dword [esp + 0x4c]
push ecx
mov ecx, dword [esp + 0x44]
push edx
mov edx, dword [esp + 0x4c]
push eax
push ecx
lea eax, [esp + 0x28]
push edx
lea ecx, [esp + 0x24]
push eax
push ecx
call fcn.004bdc00
mov ecx, eax
call fcn.004be000
mov eax, dword [eax]
mov edx, dword [esp + 0x44]
movsx edi, word [esi]
mov dword [esp + 0x10], eax
mov ebx, eax
movsx eax, word [esi + 4]
mov dl, byte [edx + 7]
and ebx, 0xffff
sub eax, ebx
xor ecx, ecx
sub eax, edi
inc eax
cmp dl, 3
jne 0x499e67
cdq
sub eax, edx
mov ecx, eax
sar ecx, 1
jmp 0x499e73
cmp dl, 1
je 0x499e71
cmp dl, 2
jne 0x499e73
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 [0x659a34]
add edi, ecx
mov ecx, dword [esp + 0x48]
test ecx, edx
je 0x499f58
mov edx, dword [esp + 0x50]
mov ecx, dword [0x659aac]
test edx, ecx
je 0x499f58
mov al, byte [0x8d8105]
test al, 1
jne 0x499ee1
mov dl, al
xor eax, eax
or dl, 1
push fcn.00402b00
mov byte [0x8d8105], dl
mov word [0x8fa7d8], ax
mov word [0x8fa7da], ax
call fcn.0051c6ca
add esp, 4
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 0
inc edx
push 0
inc ecx
push edx
mov word [esp + 0x5c], ax
push ecx
lea edx, [esp + 0x60]
push 0x8fa7d8
lea eax, [esp + 0x2c]
push edx
push eax
push ebp
call fcn.00474b30
mov edx, dword [esp + 0x6c]
mov eax, dword [esp + 0x60]
add esp, 0x20
mov word [esp + 0x50], di
mov word [esp + 0x52], 0
mov ecx, dword [esp + 0x50]
push ecx
mov ecx, dword [esp + 0x48]
push 0
push edx
push eax
lea edx, [esp + 0x28]
push ecx
lea eax, [esp + 0x58]
push edx
push eax
call fcn.004bdc00
mov ecx, eax
call fcn.004be000
mov eax, edi
movsx ecx, word [esi + 2]
mov word [esp + 0x46], cx
mov ecx, dword [esp + 0x12]
push 0
and ecx, 0xffff
push 1
mov word [esp + 0x58], ax
push ecx
lea edx, [esp + 0x50]
push ebx
lea eax, [esp + 0x60]
push edx
push eax
lea ecx, [esp + 0x30]
push ebp
push ecx
mov word [esp + 0x64], di
mov word [esp + 0x72], 0
call fcn.00474b30
add esp, 0x20
lea ecx, [esp + 0x18]
mov dword [esp + 0x38], 0xffffffff
call fcn.004a8ce0
mov ecx, dword [esp + 0x30]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x2c
ret 0x18