Function at 0x499660
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x30
push esi
mov esi, ecx
mov edx, 4
xor ecx, ecx
push edi
mov eax, dword [esi + 0xc]
imul eax, dword [esi + 0x14]
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00507864
mov ecx, dword [esi + 0xc]
mov edi, eax
imul ecx, dword [esi + 0x14]
mov dword [esp + 0x10], edi
shl ecx, 2
push ecx
push 0
push edi
call fcn.00520500
xor ecx, ecx
add esp, 0x10
xor edx, edx
cmp dword [esi + 0x14], ecx
jbe 0x4996dd
lea esp, [esp]
mov eax, dword [esi + 0x18]
cmp byte [eax + ecx], 0
je 0x4996c7
lea esp, [esp]
inc ecx
cmp byte [eax + ecx], 0
jne 0x4996c0
mov eax, dword [esi + 0xc]
imul eax, edx
inc edx
add eax, ecx
inc ecx
mov dword [edi + eax*4], 1
cmp edx, dword [esi + 0x14]
jb 0x4996b0
xor ecx, ecx
push ebx
xor ebx, ebx
mov dword [esp + 0xc], ecx
mov dword [esp + 0x14], ebx
cmp dword [esi + 0xc], ecx
jbe 0x4998e2
push ebp
mov eax, dword [esi + 0x18]
cmp byte [ebx + eax], 0
je 0x49973b
mov ecx, dword [esi + 0x14]
cmp ebx, dword [esi + 0xc]
jae 0x499733
xor edx, edx
test ecx, ecx
je 0x499729
jmp 0x499710
mov ecx, dword [esi + 0xc]
mov eax, dword [esi + 0x1c]
imul ecx, edx
inc edx
add ecx, ebx
mov eax, dword [eax + ecx*4]
xor dword [edi + ecx*4], eax
mov ecx, dword [esi + 0x14]
cmp edx, ecx
jb 0x499710
mov eax, dword [esi + 0x18]
inc ebx
cmp byte [ebx + eax], 0
jne 0x499700
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x18], ebx
mov edx, dword [esi + 0xc]
cmp ebx, edx
je 0x4998e1
mov eax, edx
lea ebp, [ebx*4]
imul eax, ecx
mov ecx, dword [esi + 0x1c]
mov dword [esp + 0x2c], ebp
shl eax, 2
add ecx, eax
add eax, edi
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], eax
mov ebp, dword [ecx + ebp]
test ebp, ebp
jne 0x499775
mov dword [esp + 0x1c], ebp
jmp 0x499791
mov eax, dword [esi + 4]
mov ecx, 0xffff
sub ecx, dword [eax + ebp*4]
mov eax, dword [esi]
mov eax, dword [eax + ecx*4]
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x24]
mov dword [esp + 0x28], 0
test edx, edx
je 0x4997f3
mov edi, dword [esp + 0x28]
mov ebx, ecx
mov ebp, eax
sub ebx, eax
jmp 0x4997b0
mov ecx, dword [esi + 4]
lea ebp, [ebp + 4]
mov eax, dword [ebx + ebp - 4]
inc edi
mov edx, dword [ecx + eax*4]
mov eax, dword [esp + 0x1c]
add edx, dword [ecx + eax*4]
mov eax, dword [esi]
mov eax, dword [eax + edx*4]
mov dword [ebx + ebp - 4], eax
mov eax, dword [ebp - 4]
mov ecx, dword [esi + 4]
mov edx, dword [ecx + eax*4]
mov eax, dword [esp + 0x1c]
add edx, dword [ecx + eax*4]
mov eax, dword [esi]
mov eax, dword [eax + edx*4]
mov dword [ebp - 4], eax
cmp edi, dword [esi + 0xc]
jb 0x4997b0
mov ebx, dword [esp + 0x18]
mov edi, dword [esp + 0x14]
xor ebp, ebp
mov dword [esp + 0x28], ebp
cmp dword [esi + 0x14], ebp
jbe 0x4998ca
mov ebx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
lea ebx, [ebx]
cmp ebp, eax
je 0x4998b4
mov ecx, dword [esi + 0xc]
mov eax, ecx
mov edi, dword [esi + 0x1c]
imul eax, ebp
mov dword [esp + 0x34], 0
shl eax, 2
add edi, eax
add eax, ebx
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x2c]
mov eax, dword [eax + edi]
mov dword [esp + 0x1c], eax
test ecx, ecx
je 0x4998b0
mov edx, dword [esp + 0x20]
mov eax, edi
mov ebp, dword [esp + 0x30]
neg eax
mov ebx, dword [esp + 0x34]
add edx, eax
add eax, dword [esp + 0x24]
sub ebp, edi
mov dword [esp + 0x3c], edx
mov dword [esp + 0x38], eax
mov eax, dword [edx + edi]
lea edi, [edi + 4]
mov ecx, dword [esi + 4]
inc ebx
mov edx, dword [ecx + eax*4]
mov eax, dword [esp + 0x1c]
add edx, dword [ecx + eax*4]
mov eax, dword [esi]
mov eax, dword [eax + edx*4]
xor dword [edi - 4], eax
mov eax, dword [esp + 0x38]
mov edx, dword [esi + 4]
mov eax, dword [eax + edi - 4]
mov ecx, dword [edx + eax*4]
mov eax, dword [esp + 0x1c]
add ecx, dword [edx + eax*4]
mov eax, dword [esi]
mov edx, dword [esp + 0x3c]
mov eax, dword [eax + ecx*4]
xor dword [edi + ebp - 4], eax
cmp ebx, dword [esi + 0xc]
jb 0x499865
mov ebp, dword [esp + 0x28]
mov ebx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
inc ebp
mov dword [esp + 0x28], ebp
cmp ebp, dword [esi + 0x14]
jb 0x499810
mov ebx, dword [esp + 0x18]
mov edi, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
inc ebx
inc ecx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x10], ecx
cmp ebx, dword [esi + 0xc]
jb 0x4996f4
pop ebp
mov eax, dword [esi + 0xc]
xor edx, edx
imul eax, dword [esi + 0x14]
pop ebx
test eax, eax
je 0x499905
mov ecx, dword [esi + 0x1c]
mov eax, dword [edi + edx*4]
mov dword [ecx + edx*4], eax
inc edx
mov eax, dword [esi + 0xc]
imul eax, dword [esi + 0x14]
cmp edx, eax
jb 0x4998f0
push edi
call fcn.0050786d
add esp, 4
pop edi
pop esi
add esp, 0x30
ret