Function at 0x40a8c0
Capabilities:
Encode data using xor
Execute anti-debugging instructions

Disassembly:
sub esp, 0x1ac
mov eax, dword [0x42139c]
xor eax, esp
mov dword [esp + 0x1a8], eax
mov eax, dword [ebx]
xor edx, edx
cmp eax, edx
jg 0x40ab00
mov eax, dword [ebx + 4]
cmp eax, edx
mov dword [esp + 8], eax
jne 0x40a8f3
mov dword [esp + 8], 0x40
push ebp
push esi
push edi
mov ecx, 0x20
xor eax, eax
lea edi, [esp + 0x20]
rep stosd dword es:[edi], eax
mov esi, 0xff
mov dword [esp + 0x18], edx
xor edi, edi
rdtsc
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x10]
add eax, 0x3e8
mov dword [esp + 0xc], eax
mov ecx, dword [esp + 0xc]
dec ecx
mov dword [esp + 0xc], ecx
mov eax, dword [esp + 0xc]
cmp eax, dword [esp + 0x10]
jne 0x40a921
rdtsc
mov ecx, dword [esp + 0x10]
sub eax, ecx
mov dword [esp + 0x1c], eax
mov ecx, dword [esp + 0x1c]
rdtsc
dec ecx
jne 0x40a944
mov ecx, dword [esp + 0x18]
sub ecx, eax
mov ebp, ecx
imul ebp, ecx
mov byte [esp + esi + 0xb4], al
dec esi
cmp ebp, 1
mov dword [esp + 0xc], esi
je 0x40a969
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x18]
and eax, 0x1f
mov ebp, dword [esp + eax*4 + 0x20]
lea eax, [esp + eax*4 + 0x20]
add ebp, edx
or edx, 1
test esi, esi
mov dword [eax], ebp
jge 0x40a9b0
lea edx, [esp + 0xa0]
push edx
push 0x100
lea eax, [esp + 0xbc]
push eax
push 0
call fcn.00409920
mov dword [esp + 0x1c], 0xff
mov esi, dword [esp + 0x1c]
add esp, 0x10
xor edx, edx
mov eax, dword [esp + 0x14]
inc edi
cmp edi, eax
mov dword [esp + 0x10], edi
jb 0x40a940
xor ebp, ebp
xor esi, esi
test edi, edi
mov eax, edi
mov ecx, 6
je 0x40aa00
cmp edi, 0x40
jae 0x40a9d9
shl eax, 1
dec ecx
cmp eax, 0x40
jb 0x40a9d1
cmp eax, 0x80
jb 0x40a9ea
shr eax, 1
inc ecx
cmp eax, 0x80
jae 0x40a9e0
imul ecx, ecx, 0x3e8
and eax, 0x3f
movzx edi, word [eax*2 + 0x41a010]
add edi, ecx
lea ecx, [ecx]
mov edx, dword [esp + esi*4 + 0x20]
test edx, edx
mov eax, edx
mov ecx, 6
je 0x40aa40
cmp edx, 0x40
jae 0x40aa1c
shl eax, 1
dec ecx
cmp eax, 0x40
jb 0x40aa14
cmp eax, 0x80
jb 0x40aa2d
shr eax, 1
inc ecx
cmp eax, 0x80
jae 0x40aa23
imul ecx, ecx, 0x3e8
and eax, 0x3f
movzx eax, word [eax*2 + 0x41a010]
add eax, ecx
mov ecx, edi
sub ecx, eax
imul ecx, edx
add ebp, ecx
inc esi
cmp esi, 0x20
jl 0x40aa00
test ebp, ebp
mov ecx, dword [esp + 0x10]
je 0x40ab28
mov eax, ecx
imul eax, eax, 0x17700
xor edx, edx
div ebp
mov esi, eax
cmp esi, ecx
ja 0x40ab2c
lea edx, [esp + 0xa0]
push edx
push 0x100
lea eax, [esp + 0xbc]
push eax
push 0
call fcn.00409920
add esp, 0x10
pop edi
mov dword [ebx + 4], esi
pop esi
xor eax, eax
pop ebp
jmp 0x40aaa0
mov cl, byte [esp + eax + 0x94]
mov dl, byte [ebx + eax + 8]
xor dl, cl
mov cl, byte [ebx + eax + 9]
mov byte [ebx + eax + 8], dl
mov dl, byte [esp + eax + 0x95]
xor cl, dl
mov dl, byte [ebx + eax + 0xa]
mov byte [ebx + eax + 9], cl
mov cl, byte [esp + eax + 0x96]
xor dl, cl
mov cl, byte [ebx + eax + 0xb]
mov byte [ebx + eax + 0xa], dl
mov dl, byte [esp + eax + 0x97]
xor cl, dl
mov dl, byte [ebx + eax + 0xc]
mov byte [ebx + eax + 0xb], cl
mov cl, byte [esp + eax + 0x98]
xor dl, cl
mov byte [ebx + eax + 0xc], dl
add eax, 5
cmp eax, 0x14
jl 0x40aaa0
add dword [ebx], 8
mov eax, dword [ebx]
dec eax
xor edx, edx
mov ecx, 0x14
mov dword [ebx], eax
div ecx
mov ecx, dword [esp + 0x1a8]
xor ecx, esp
movzx eax, byte [edx + ebx + 8]
call fcn.0040d4a6
add esp, 0x1ac
ret
mov esi, dword [esp + 0x14]
cmp ebp, ecx
jbe 0x40ab46
mov edi, dword [esp + 0x10]
add esi, 3
mov dword [esp + 0x14], esi
mov esi, dword [esp + 0xc]
xor edx, edx
jmp 0x40a940
mov edi, dword [esp + 0x10]
mov esi, dword [esp + 0xc]
add ecx, 0x20
mov dword [esp + 0x14], ecx
xor edx, edx
jmp 0x40a940