Function at 0x4a5f00
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
cmp dword [ebp + 0xc], 0
mov dword [ebp - 0x10], 0
jne 0x4a5f1c
mov eax, 1
mov esp, ebp
pop ebp
ret
push ebx
call fcn.004894b0
mov ebx, eax
test ebx, ebx
je 0x4a6220
push 0x4a6380
push 0x604f24
call fcn.004774a0
add esp, 8
neg eax
sbb eax, eax
test dword [0x604f2c], eax
je 0x4a6220
cmp dword [0x604f28], 0
push esi
je 0x4a5f8f
call sub.KERNEL32.dll_GetCurrentThreadId
push dword [0x604f20]
mov esi, eax
call fcn.00477530
push esi
push dword [0x604f00]
call fcn.004773e0
push dword [0x604f20]
mov esi, eax
mov dword [ebp - 4], esi
call fcn.00477510
add esp, 0x10
test esi, esi
jne 0x4a5fa4
jmp 0x4a5f96
mov dword [ebp - 4], 0
push dword [0x604f1c]
call fcn.00477530
add esp, 4
mov ecx, dword [0x604ad4]
mov eax, dword [0x604f04]
movups xmm0, xmmword [0x604eec]
push edi
mov dword [ebp - 0x18], eax
mov edi, ecx
mov eax, dword [0x604f08]
add ecx, dword [ebp + 0xc]
mov dword [ebp - 0x14], eax
mov eax, dword [0x604efc]
mov dword [ebp - 0x1c], eax
mov dword [0x604ad4], ecx
movups xmmword [ebp - 0x2c], xmm0
cmp ecx, 0x3ff
jb 0x4a600d
mov eax, 0x401005
mov dword [0x604ad0], 0x3ff
mul ecx
mov eax, ecx
sub eax, edx
shr eax, 1
add eax, edx
shr eax, 9
imul eax, eax, 0xfffffc01
add ecx, eax
mov dword [0x604ad4], ecx
jmp 0x4a6023
mov eax, dword [0x604ad0]
cmp eax, 0x3ff
jae 0x4a6023
cmp ecx, eax
cmova eax, ecx
mov dword [0x604ad0], eax
mov ecx, dword [ebp + 0xc]
mov eax, 0x66666667
imul ecx
sar edx, 3
mov esi, edx
shr esi, 0x1f
add esi, edx
lea eax, [esi + esi*4]
shl eax, 2
sub ecx, eax
xor eax, eax
test ecx, ecx
setg al
add eax, esi
mov esi, dword [ebp - 4]
add dword [0x604f08], eax
test esi, esi
jne 0x4a6063
push dword [0x604f1c]
call fcn.00477510
add esp, 4
mov eax, dword [ebp + 0xc]
mov dword [ebp - 8], 0
test eax, eax
jle 0x4a619f
mov dword [ebp - 0xc], eax
mov ecx, 0x14
nop dword [eax]
cmp eax, 0x14
mov esi, eax
push 0
cmovg esi, ecx
call fcn.00489820
push eax
push ebx
call fcn.00489110
add esp, 0xc
test eax, eax
je 0x4a621e
push 0x14
lea eax, [ebp - 0x2c]
push eax
push ebx
call fcn.004892c0
add esp, 0xc
test eax, eax
je 0x4a621e
lea ecx, [edi - 0x3ff]
add ecx, esi
test ecx, ecx
jle 0x4a60f1
mov eax, esi
sub eax, ecx
push eax
lea eax, [edi + 0x604ad8]
push eax
push ebx
call fcn.004892c0
add esp, 0xc
test eax, eax
je 0x4a621e
lea eax, [edi - 0x3ff]
add eax, esi
push eax
push 0x604ad8
jmp 0x4a60f9
push esi
lea eax, [edi + 0x604ad8]
push eax
push ebx
call fcn.004892c0
add esp, 0xc
test eax, eax
je 0x4a621e
push esi
push dword [ebp + 8]
push ebx
call fcn.004892c0
add esp, 0xc
test eax, eax
je 0x4a621e
push 8
lea eax, [ebp - 0x18]
push eax
push ebx
call fcn.004892c0
add esp, 0xc
test eax, eax
je 0x4a621e
push 0
lea eax, [ebp - 0x2c]
push eax
push ebx
call fcn.00489070
add esp, 0xc
test eax, eax
je 0x4a621e
inc dword [ebp - 0x14]
xor ecx, ecx
add dword [ebp + 8], esi
test esi, esi
jle 0x4a617c
nop dword [eax]
mov al, byte [ebp + ecx - 0x2c]
inc ecx
xor byte [edi + 0x604ad8], al
lea eax, [edi + 1]
xor edi, edi
cmp eax, 0x3ff
cmovl edi, eax
cmp ecx, esi
jl 0x4a6160
mov ecx, dword [ebp - 8]
mov eax, dword [ebp - 0xc]
add ecx, 0x14
sub eax, 0x14
mov dword [ebp - 8], ecx
cmp ecx, dword [ebp + 0xc]
mov ecx, 0x14
mov dword [ebp - 0xc], eax
jl 0x4a6080
mov esi, dword [ebp - 4]
test esi, esi
jne 0x4a61b1
push dword [0x604f1c]
call fcn.00477530
add esp, 4
movups xmm1, xmmword [0x604eec]
xor ecx, ecx
mov edx, 4
movups xmm0, xmmword [ebp - 0x2c]
pxor xmm1, xmm0
movups xmmword [0x604eec], xmm1
nop
mov al, byte [ebp + ecx - 0x1c]
lea ecx, [ecx + 1]
xor byte [ecx + 0x604efb], al
sub edx, 1
jne 0x4a61d0
movsd xmm0, qword [0x590c08]
movsd xmm1, qword [0x604f10]
comisd xmm0, xmm1
jbe 0x4a6205
addsd xmm1, qword [ebp + 0x10]
movsd qword [0x604f10], xmm1
test esi, esi
jne 0x4a6217
push dword [0x604f1c]
call fcn.00477510
add esp, 4
mov dword [ebp - 0x10], 1
pop edi
pop esi
push ebx
call fcn.00489490
mov eax, dword [ebp - 0x10]
add esp, 4
pop ebx
mov esp, ebp
pop ebp
ret