Function at 0x512220
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x14
push ebx
push ebp
push esi
push edi
mov esi, ecx
call dword [sym.imp.MSVCRT.dll_clock]
mov ecx, dword [esi + 0x290]
mov dword [esp + 0x18], eax
mov eax, 0x280
mov ebx, 4
sub eax, ecx
lea ebp, [esp + 0x18]
cmp eax, ebx
jae 0x51228e
test eax, eax
mov edi, ebp
lea ecx, [ecx + esi + 0xc]
je 0x51226e
lea edx, [eax]
mov dword [esp + 0x10], edx
mov dl, byte [edi]
xor byte [ecx], dl
mov edx, dword [esp + 0x10]
inc edi
inc ecx
dec edx
mov dword [esp + 0x10], edx
jne 0x51225d
mov ecx, esi
add ebp, eax
sub ebx, eax
call fcn.00512520
mov ecx, dword [esi + 0x290]
mov eax, 0x280
sub eax, ecx
cmp ebx, eax
ja 0x51224d
test ebx, ebx
je 0x5122c4
mov eax, dword [esi + 0x290]
test ebx, ebx
lea eax, [esi + eax + 0xc]
je 0x5122ac
lea edi, [ebx]
mov cl, byte [ebp]
mov dl, byte [eax]
xor dl, cl
inc ebp
mov byte [eax], dl
inc eax
dec edi
jne 0x51229e
mov eax, dword [esi + 0x290]
mov dword [esi + 0x28c], 0x280
add eax, ebx
mov dword [esi + 0x290], eax
push 0
call dword [sym.imp.MSVCRT.dll_time]
mov ecx, dword [esi + 0x290]
mov dword [esp + 0x1c], eax
mov eax, 0x280
mov ebx, 4
sub eax, ecx
add esp, 4
cmp eax, ebx
lea ebp, [esp + 0x18]
jae 0x51232e
test eax, eax
mov edi, ebp
lea ecx, [ecx + esi + 0xc]
je 0x51230e
lea edx, [eax]
mov dword [esp + 0x10], edx
mov dl, byte [edi]
xor byte [ecx], dl
mov edx, dword [esp + 0x10]
inc edi
inc ecx
dec edx
mov dword [esp + 0x10], edx
jne 0x5122fd
mov ecx, esi
add ebp, eax
sub ebx, eax
call fcn.00512520
mov ecx, dword [esi + 0x290]
mov eax, 0x280
sub eax, ecx
cmp ebx, eax
ja 0x5122ed
test ebx, ebx
je 0x512364
mov eax, dword [esi + 0x290]
test ebx, ebx
lea eax, [esi + eax + 0xc]
je 0x51234c
lea edi, [ebx]
mov cl, byte [ebp]
mov dl, byte [eax]
xor dl, cl
inc ebp
mov byte [eax], dl
inc eax
dec edi
jne 0x51233e
mov eax, dword [esi + 0x290]
mov dword [esi + 0x28c], 0x280
add eax, ebx
mov dword [esi + 0x290], eax
lea edx, [esp + 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esi + 0x290]
mov dword [esp + 0x10], eax
mov eax, 0x280
mov ebx, 4
sub eax, ecx
cmp eax, ebx
lea ebp, [esp + 0x10]
jae 0x5123d2
test eax, eax
mov edi, ebp
lea ecx, [ecx + esi + 0xc]
je 0x5123b2
lea edx, [eax]
mov dword [esp + 0x14], edx
mov dl, byte [edi]
xor byte [ecx], dl
mov edx, dword [esp + 0x14]
inc edi
inc ecx
dec edx
mov dword [esp + 0x14], edx
jne 0x5123a1
mov ecx, esi
add ebp, eax
sub ebx, eax
call fcn.00512520
mov ecx, dword [esi + 0x290]
mov eax, 0x280
sub eax, ecx
cmp ebx, eax
ja 0x512391
test ebx, ebx
je 0x512408
mov eax, dword [esi + 0x290]
test ebx, ebx
lea eax, [esi + eax + 0xc]
je 0x5123f0
lea edi, [ebx]
mov cl, byte [ebp]
mov dl, byte [eax]
xor dl, cl
inc ebp
mov byte [eax], dl
inc eax
dec edi
jne 0x5123e2
mov eax, dword [esi + 0x290]
mov dword [esi + 0x28c], 0x280
add eax, ebx
mov dword [esi + 0x290], eax
mov eax, dword [esp + 0x10]
mov ebx, dword [0x5a10e4]
mov edx, dword [esp + 0x10]
mov dword [0x5a10e4], eax
mov ecx, dword [esi + 0x290]
mov eax, 0x280
sub edx, ebx
mov ebx, 4
sub eax, ecx
mov dword [esp + 0x18], edx
cmp eax, ebx
mov dword [esp + 0x10], edx
lea ebp, [esp + 0x28]
jae 0x512484
test eax, eax
mov edi, ebp
lea ecx, [ecx + esi + 0xc]
je 0x512460
lea edx, [eax]
mov dword [esp + 0x14], edx
mov dl, byte [edi]
xor byte [ecx], dl
mov edx, dword [esp + 0x14]
inc edi
inc ecx
dec edx
mov dword [esp + 0x14], edx
jne 0x51244f
mov ecx, esi
add ebp, eax
sub ebx, eax
call fcn.00512520
mov ecx, dword [esi + 0x290]
mov eax, 0x280
sub eax, ecx
cmp ebx, eax
ja 0x51243f
mov edx, dword [esp + 0x18]
test ebx, ebx
je 0x5124b8
mov eax, dword [esi + 0x290]
mov edi, ebp
test ebx, ebx
lea ebp, [esi + eax + 0xc]
je 0x5124a0
lea eax, [ebx]
mov cl, byte [edi]
xor byte [ebp], cl
inc edi
inc ebp
dec eax
jne 0x512496
mov eax, dword [esi + 0x290]
mov dword [esi + 0x28c], 0x280
add eax, ebx
mov dword [esi + 0x290], eax
mov eax, dword [esp + 0x28]
mov ecx, dword [0x5a10e8]
cmp eax, ecx
jne 0x5124d2
cmp eax, dword [0x5a10ec]
jne 0x5124d2
xor eax, eax
jmp 0x5124fc
mov dword [0x5a10e8], eax
xor eax, eax
test edx, edx
mov dword [0x5a10ec], ecx
je 0x5124fc
mov ecx, dword [esp + 0x10]
shr ecx, 1
inc eax
mov dword [esp + 0x10], ecx
test ecx, ecx
jne 0x5124e3
cmp eax, 8
jbe 0x5124fc
mov eax, 8
mov edi, dword [esi + 8]
add edi, eax
mov ecx, edi
mov dword [esi + 8], edi
cmp ecx, 0x1400
jbe 0x512515
mov dword [esi + 8], 0x1400
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret 4