Function at 0x10051720
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x264
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, edx
cmp esi, 0x80
jbe 0x10051743
pop edi
mov eax, 0xffffff9c
pop esi
mov esp, ebp
pop ebp
ret
lea eax, [ecx - 1]
cmp eax, 2
ja 0x1005197d
mov eax, dword [ebp + 0x14]
push ebx
push 0xa0
push 0
mov dword [eax + 0x1d4], ecx
and ecx, 3
mov dword [eax + 0x1d0], esi
mov eax, ecx
shl eax, 4
mov dword [ebp - 0x24], eax
mov dword [ebp + 8], ecx
lea ebx, [eax + 0x12]
lea eax, [ebp - 0x124]
push eax
call fcn.1007cff0
lea eax, [ebp - 0x124]
mov edx, esi
push eax
mov ecx, edi
call fcn.1004d030
mov edx, dword [ebp + 8]
lea esi, [ebp - 0x124]
mov ecx, 0x28
lea edi, [ebp - 0x264]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebp + 0xc]
lea eax, [ebp - 0x264]
push eax
lea edx, [edx*4 + 4]
call fcn.1004d0e0
mov eax, 0xcccccccd
add esp, 0x14
mul ebx
mov eax, edx
shr eax, 4
add eax, 1
mov dword [ebp - 0x3c], eax
je 0x10051907
mov edx, 1
mov dword [ebp - 0x1c], 0
lea eax, [ebp - 0x14]
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x20], eax
nop
xor eax, eax
mov dword [ebp - 0x40], edx
mov dword [ebp - 0x14], eax
lea esi, [ebp - 0x264]
mov dword [ebp - 0x10], eax
lea edi, [ebp - 0x1c4]
mov dword [ebp - 0xc], eax
mov ecx, 0x28
mov dword [ebp - 8], eax
mov ebx, 0x3e8
mov dword [ebp - 4], eax
mov eax, edx
shr eax, 0x18
mov byte [ebp - 0x38], al
mov eax, edx
shr eax, 0x10
mov byte [ebp - 0x37], al
mov eax, edx
shr eax, 8
mov byte [ebp - 0x36], al
mov eax, 4
rep movsd dword es:[edi], dword [esi]
mov byte [ebp - 0x35], dl
lea esp, [esp]
lea ecx, [ebp - 0x1c4]
mov edx, eax
push ecx
lea ecx, [ebp - 0x38]
call fcn.1004d0e0
lea eax, [ebp - 0x1c4]
mov edx, 0x14
push eax
lea ecx, [ebp - 0x38]
call fcn.1004d1c0
add esp, 8
xor eax, eax
lea ebx, [ebx]
movzx ecx, byte [ebp + eax - 0x38]
xor byte [ebp + eax - 0x14], cl
movzx ecx, byte [ebp + eax - 0x37]
xor byte [ebp + eax - 0x13], cl
movzx ecx, byte [ebp + eax - 0x36]
xor byte [ebp + eax - 0x12], cl
movzx ecx, byte [ebp + eax - 0x35]
xor byte [ebp + eax - 0x11], cl
movzx ecx, byte [ebp + eax - 0x34]
xor byte [ebp + eax - 0x10], cl
add eax, 5
cmp eax, 0x14
jb 0x10051870
lea esi, [ebp - 0x124]
mov ecx, 0x28
lea edi, [ebp - 0x1c4]
rep movsd dword es:[edi], dword [esi]
sub ebx, 1
jne 0x10051840
mov esi, dword [ebp - 0x1c]
xor edx, edx
mov ebx, dword [ebp - 0x20]
mov ecx, esi
mov edi, dword [ebp - 0x24]
lea ebx, [ebx]
lea eax, [edi + 0x12]
cmp ecx, eax
jae 0x100518e8
mov al, byte [ebx + ecx]
inc edx
mov byte [ebp + ecx - 0x84], al
inc ecx
cmp edx, 0x14
jb 0x100518d0
mov edx, dword [ebp - 0x18]
add esi, 0x14
mov eax, dword [ebp - 0x3c]
inc edx
sub ebx, 0x14
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x20], ebx
cmp dword [ebp - 0x40], eax
jb 0x100517f0
mov ebx, dword [ebp + 0x14]
lea ecx, [ebp - 0x84]
push dword [ebp + 0x18]
xor eax, eax
mov dword [ebx + 0x1cc], 0x10
mov dword [ebx], eax
mov dword [ebx + 4], eax
mov dword [ebx + 8], eax
mov dword [ebx + 0xc], eax
mov eax, dword [ebp + 8]
lea edi, [eax*8 + 8]
lea eax, [ebx + 0x20]
mov edx, edi
push eax
call fcn.10057d90
push 0xa0
lea esi, [ebx + 0x12c]
push 0
push esi
call fcn.1007cff0
mov eax, dword [ebp + 8]
lea ecx, [ebp - 0x7c]
push esi
mov edx, edi
lea ecx, [ecx + eax*8]
call fcn.1004d030
mov eax, dword [ebp - 0x24]
add esp, 0x18
mov cx, word [ebp + eax - 0x74]
mov eax, dword [ebp + 0x10]
pop ebx
pop edi
pop esi
mov word [eax], cx
xor eax, eax
mov esp, ebp
pop ebp
ret
pop edi
mov eax, 0xffffff9b
pop esi
mov esp, ebp
pop ebp
ret