Function at 0x501280
Capabilities:
Check for peb beingdebugged flag

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x48
mov eax, dword [0x101ae6e4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push edi
mov edi, dword [ebp + 0xc]
mov ebx, edx
mov dword [ebp - 0x44], eax
xor eax, eax
mov dword [ebp - 0x1c], ecx
movzx ecx, word [ebp + 0x14]
and dword [edi + 8], eax
mov byte [edi], 0
mov dword [edi + 2], eax
call fcn.00500c99
mov dword [ebp - 0x48], eax
test eax, eax
jne 0x5012c7
mov eax, 0xc000000d
jmp 0x5014fc
push esi
movzx esi, word [eax]
movzx eax, word [ebx]
mov ecx, esi
cdq
idiv ecx
push 0x18
movzx ecx, ax
pop eax
cmp si, ax
jbe 0x5012e3
lea eax, [esi - 0x18]
jmp 0x5012e5
sub eax, esi
imul eax, ecx
movzx ecx, word [ebx + 2]
movzx edx, ax
lea eax, [ecx + edx]
movzx esi, ax
movzx eax, dx
add ecx, eax
mov eax, dword fs:[0x30]
push ecx
push 0
push dword [eax + 0x18]
call dword [0x101b2518]
xor ecx, ecx
mov word [ebp - 0x2e], si
mov word [ebp - 0x30], cx
mov dword [ebp - 0x2c], eax
test eax, eax
jne 0x501327
mov eax, 0xc0000017
jmp 0x5014fb
push ebx
lea eax, [ebp - 0x30]
push eax
call dword [0x101b2520]
mov ecx, dword [ebp - 0x48]
lea eax, [ebp - 0x30]
push eax
mov edx, 0x1000c690
call fcn.00500ea8
mov dword [ebp - 0x28], eax
test eax, eax
js 0x5014dc
mov eax, dword [ebp - 0x2c]
xor ebx, ebx
mov cx, word [ebp - 0x30]
inc ebx
mov dword [ebp - 0x18], eax
mov esi, ebx
xor eax, eax
shr cx, 1
and dword [ebp - 0x34], eax
mov word [ebp - 0x10], ax
mov byte [ebp - 0x11], al
mov eax, dword [ebp - 0x1c]
movzx edx, cx
mov dword [ebp - 0x24], edx
test eax, eax
je 0x501420
lea ecx, [ebp - 0x1d]
push ecx
lea ecx, [ebp - 0x40]
push ecx
push edx
mov edx, dword [ebp - 0x18]
mov ecx, eax
call fcn.005010dc
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x501413
mov dx, word [ebp - 0x40]
mov eax, dword [ebp - 0x18]
sub word [ebp - 0x24], dx
movzx ecx, dx
lea eax, [eax + ecx*2]
mov cx, word [ebp - 0x34]
mov dword [ebp - 0x18], eax
add cx, dx
mov eax, dword [ebp - 0x1c]
mov word [ebp - 0x34], cx
mov edx, dword [eax + 0x14]
test dl, 2
je 0x5013d0
movzx eax, si
mov word [ebp + eax*2 - 0x10], cx
mov word [ebp + eax*2 - 0xe], cx
jmp 0x5013ec
test dl, 4
je 0x5013f4
mov eax, dword [ebp - 0x34]
movzx ecx, si
add eax, 0xfffffff4
mov word [ebp + ecx*2 - 0x10], ax
mov ax, word [ebp - 0x34]
mov word [ebp + ecx*2 - 0xe], ax
push 2
pop eax
add esi, eax
mov eax, dword [ebp - 0x1c]
mov cl, dl
and cl, 1
mov byte [ebp - 0x11], cl
test dl, 8
je 0x501404
or dword [edi + 8], ebx
mov eax, dword [eax + 4]
test eax, eax
je 0x501419
mov edx, dword [ebp - 0x24]
jmp 0x50137d
cmp byte [ebp - 0x1d], 0
je 0x501420
or dword [edi + 8], 0x400
mov cx, word [ebp - 0x30]
movzx eax, si
shr cx, 1
inc esi
push 2
mov dword [ebp - 0x18], esi
mov word [ebp + eax*2 - 0x10], cx
pop eax
mov edx, eax
cmp ax, si
jae 0x50145f
movzx ecx, dx
mov ax, word [ebp + ecx*2 - 0x12]
cmp ax, word [ebp + ecx*2 - 0x10]
jne 0x501458
push 2
pop eax
add edx, eax
cmp dx, si
jb 0x50143d
jmp 0x50145f
or dword [edi + 8], 0xa00
movzx ecx, si
push 2
pop edx
mov dword [ebp - 0x1c], ecx
lea eax, [ecx - 2]
mov dword [ebp - 0x24], eax
cmp eax, edx
jle 0x50149c
mov esi, dword [ebp - 0x24]
push edx
pop eax
mov ecx, eax
mov ax, word [ebp + ecx*2 - 0x12]
cmp ax, word [ebp + ecx*2 - 0x10]
je 0x501487
mov byte [edi], bl
push 2
pop eax
add edx, eax
movzx ecx, dx
cmp ecx, esi
jl 0x501479
mov esi, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
cmp byte [ebp - 0x11], 0
push 2
je 0x5014b8
pop eax
cmp ax, si
jae 0x5014d3
mov ax, word [ebp + ecx*2 - 0x16]
cmp ax, word [ebp + ecx*2 - 0x14]
jne 0x5014d3
jmp 0x5014d1
pop edx
cmp dx, si
jae 0x5014d3
movzx eax, word [ebp + eax*2 - 0x10]
cmp word [ebp + ecx*2 - 0x16], ax
je 0x5014d3
cmp ax, word [ebp + ecx*2 - 0x12]
je 0x5014d3
mov byte [edi], bl
cmp byte [edi], 0
jne 0x501572
mov esi, dword [ebp - 0x28]
cmp dword [ebp - 0x2c], 0
je 0x5014f9
push dword [ebp - 0x2c]
mov eax, dword fs:[0x30]
push 0
push dword [eax + 0x18]
call dword [0x101b2528]
mov eax, esi
pop esi
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop ebx
call fcn.0055b880
mov esp, ebp
pop ebp
ret 0x10
movzx ecx, bx
movzx eax, word [ebp + ecx*2 - 0x10]
movzx edx, word [ebp + ecx*2 - 0x12]
mov dword [ebp - 0x28], eax
sub eax, edx
movzx eax, ax
mov dword [ebp - 0x18], eax
mov eax, ecx
sub eax, 1
je 0x501541
sub eax, 1
je 0x5015a3
sub eax, 1
je 0x501541
sub eax, 1
je 0x5015a3
sub eax, 1
jne 0x501559
mov eax, dword [ebp - 0x18]
mov ecx, edx
add eax, eax
mov word [ebp - 0x3c], ax
mov word [ebp - 0x3a], ax
mov eax, dword [ebp - 0x2c]
lea eax, [eax + ecx*2]
mov dword [ebp - 0x38], eax
lea eax, [ebp - 0x3c]
push eax
push dword [ebp - 0x44]
call dword [0x101b253c]
mov dword [ebp - 0x28], eax
test eax, eax
js 0x5014dc
inc ebx
cmp bx, si
jb 0x50150e
mov eax, dword [ebp - 0xe]
mov ecx, dword [ebp - 0x44]
push ecx
lea edx, [eax + eax]
mov word [edi + 2], dx
mov ax, word [ecx]
mov ecx, 0x1000c690
sub ax, dx
mov edx, dword [ebp - 0x48]
mov word [edi + 4], ax
call fcn.00500ea8
mov esi, eax
jmp 0x5014df
cmp byte [ebp - 0x11], 0
jne 0x5015b8
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x28]
cmp cx, word [ebp + eax*2 - 0x12]
jne 0x501571
jmp 0x501541
cmp ecx, dword [ebp - 0x24]
jne 0x501571
push 0x18
pop eax
mov word [ebp - 0x3c], ax
mov word [ebp - 0x3a], ax
mov dword [ebp - 0x38], 0x10021aa4
jmp 0x501559