Function at 0x4170a0
Capabilities:
Check for peb beingdebugged flag

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5ea310
mov eax, dword fs:[0]
push eax
sub esp, 0xc
push ebx
push esi
push edi
mov eax, dword [0x677010]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
test byte [edi + 0x3c], 2
je 0x4170f0
mov dword [ebp - 4], 0xffffffff
mov eax, 0xffff
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov bx, word [ebp + 8]
mov edx, 0xffff
mov dword [ebp - 4], 0xffffffff
cmp dx, bx
jne 0x417122
mov dword [ebp - 4], 0xffffffff
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
test byte [edi + 0x3c], 8
je 0x417150
mov esi, dword [edi + 0x20]
mov ecx, dword [esi]
test ecx, ecx
je 0x417150
mov edx, dword [edi + 0x38]
cmp ecx, edx
jae 0x41714b
mov eax, dword [edi + 0x30]
mov eax, dword [eax]
mov dword [esi], edx
lea ecx, [ecx + eax*2]
mov eax, dword [edi + 0x30]
sub ecx, edx
sar ecx, 1
mov dword [eax], ecx
mov edx, 0xffff
mov eax, dword [edi + 0x20]
mov ecx, dword [eax]
test ecx, ecx
je 0x41719e
mov eax, dword [edi + 0x30]
mov eax, dword [eax]
lea esi, [ecx + eax*2]
cmp ecx, esi
jae 0x417195
mov dword [ebp - 4], 0xffffffff
mov ax, bx
mov ecx, dword [edi + 0x30]
dec dword [ecx]
mov edx, dword [edi + 0x20]
mov esi, dword [edx]
lea ecx, [esi + 2]
mov dword [edx], ecx
mov word [esi], bx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov eax, dword [edi + 0xc]
sub esi, dword [eax]
sar esi, 1
jmp 0x4171a0
xor esi, esi
mov ecx, esi
mov dword [ebp - 0x14], esi
shr ecx, 1
cmp ecx, 0x20
jae 0x4171b3
mov ecx, 0x20
jmp 0x4171b7
test ecx, ecx
je 0x4171ca
mov eax, SysReAllocString
sub eax, ecx
cmp eax, esi
jae 0x4171c6
shr ecx, 1
jne 0x4171b7
test ecx, ecx
jne 0x4171e8
mov dword [ebp - 4], 0xffffffff
mov ax, dx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
lea eax, [ecx + esi]
mov dword [ebp - 0x18], eax
test eax, eax
jne 0x41724e
xor ebx, ebx
mov eax, dword [edi + 0xc]
mov ecx, dword [eax]
mov dword [ebp - 0x10], ecx
test esi, esi
je 0x417219
lea eax, [esi + esi]
push eax
push ecx
push ebx
call fcn.005c0bc0
mov ecx, dword [ebp - 0x10]
add esp, 0xc
test esi, esi
jne 0x4172b7
mov eax, dword [edi + 0x10]
mov ecx, dword [ebp - 0x18]
mov dword [edi + 0x38], ebx
mov dword [eax], ebx
mov eax, dword [edi + 0x20]
mov dword [eax], ebx
mov eax, dword [edi + 0x30]
mov dword [eax], ecx
mov eax, dword [edi + 0xc]
test byte [edi + 0x3c], 4
mov dword [eax], ebx
mov eax, dword [edi + 0x1c]
je 0x4172a7
mov dword [eax], 0
mov eax, dword [edi + 0x2c]
sar ebx, 1
mov dword [eax], ebx
jmp 0x41733d
cmp eax, 0x7fffffff
jbe 0x41725a
call fcn.005bdc77
add eax, eax
cmp eax, 0x1000
jb 0x41728f
lea ecx, [eax + 0x23]
cmp ecx, eax
ja 0x41726f
call fcn.005bdc77
push ecx
call fcn.00476eaa
add esp, 4
test eax, eax
jne 0x417281
call fcn.005c3f14
lea ebx, [eax + 0x23]
and ebx, 0xffffffe0
mov dword [ebx - 4], eax
jmp 0x4171f4
push eax
call fcn.00476eaa
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x4171f4
call fcn.005c3f14
mov dword [eax], ebx
mov eax, dword [edi + 0x2c]
mov dword [eax], 1
jmp 0x41733d
mov eax, dword [edi + 0x38]
mov edx, dword [edi + 0x10]
sub eax, ecx
sar eax, 1
lea eax, [ebx + eax*2]
mov dword [edi + 0x38], eax
mov eax, dword [edi + 0x20]
mov ecx, dword [edx]
sub ecx, dword [ebp - 0x10]
sar ecx, 1
mov eax, dword [eax]
sub eax, dword [ebp - 0x10]
sar eax, 1
lea esi, [ebx + eax*2]
lea eax, [ebx + ecx*2]
mov ecx, dword [ebp - 0x18]
mov dword [edx], eax
add ecx, ecx
mov eax, dword [edi + 0x20]
sub ecx, esi
add ecx, ebx
sar ecx, 1
mov dword [eax], esi
mov eax, dword [edi + 0x30]
mov esi, dword [ebp - 0x14]
mov dword [eax], ecx
test byte [edi + 0x3c], 4
je 0x417315
mov eax, dword [edi + 0xc]
mov dword [eax], ebx
mov eax, dword [edi + 0x1c]
sar ebx, 1
mov dword [eax], 0
mov eax, dword [edi + 0x2c]
mov dword [eax], ebx
jmp 0x41733d
mov eax, dword [edi + 0x20]
mov edx, dword [eax]
mov eax, dword [edi + 0x1c]
mov eax, dword [eax]
sub eax, dword [ebp - 0x10]
sar eax, 1
lea ecx, [ebx + eax*2]
mov eax, dword [edi + 0xc]
sub edx, ecx
add edx, 2
sar edx, 1
mov dword [eax], ebx
mov eax, dword [edi + 0x1c]
mov dword [eax], ecx
mov eax, dword [edi + 0x2c]
mov dword [eax], edx
test byte [edi + 0x3c], 1
je 0x417395
mov dword [ebp - 4], 0xffffffff
cmp esi, 0x7fffffff
ja 0x41727c
lea eax, [esi + esi]
cmp eax, 0x1000
mov eax, dword [ebp - 0x10]
jb 0x41738c
test al, 0x1f
jne 0x41727c
mov ecx, dword [eax - 4]
cmp ecx, eax
jae 0x41727c
sub eax, ecx
cmp eax, 4
jb 0x41727c
cmp eax, 0x23
ja 0x41727c
mov eax, ecx
push eax
call fcn.00476ee1
add esp, 4
or dword [edi + 0x3c], 1
mov dword [ebp - 4], 0xffffffff
mov eax, dword [edi + 0x30]
dec dword [eax]
mov ecx, dword [edi + 0x20]
mov edx, dword [ecx]
lea eax, [edx + 2]
mov dword [ecx], eax
mov ax, word [ebp + 8]
mov word [edx], ax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4