Function at 0x4c7940
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [0x582904]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
xor edi, edi
push 0x38
push edi
push esi
mov dword [ebp - 8], edi
call fcn.0050ea20
mov edx, dword [ebp + 0xc]
add esp, 0xc
xor ecx, ecx
mov ebx, dword [edx + 4]
test ebx, ebx
jle 0x4c7a37
cmp ebx, 8
jb 0x4c7a17
mov edi, dword [edx + 8]
mov eax, ebx
and eax, 0x80000007
jns 0x4c7991
dec eax
or eax, 0xfffffff8
inc eax
movaps xmm5, xmmword [0x54d460]
xorps xmm3, xmm3
mov dword [ebp - 8], ebx
xorps xmm4, xmm4
sub dword [ebp - 8], eax
xorps xmm2, xmm2
mov eax, dword [ebp - 8]
nop word [eax + eax]
movups xmm1, xmmword [edi + ecx*4]
movaps xmm0, xmm5
paddd xmm0, xmm3
pcmpgtd xmm1, xmm4
pand xmm0, xmm1
pandn xmm1, xmm3
por xmm0, xmm1
movups xmm1, xmmword [edi + ecx*4 + 0x10]
add ecx, 8
movaps xmm3, xmm0
movaps xmm0, xmm5
paddd xmm0, xmm2
pcmpgtd xmm1, xmm4
pand xmm0, xmm1
pandn xmm1, xmm2
por xmm0, xmm1
movaps xmm2, xmm0
cmp ecx, eax
jl 0x4c79b0
paddd xmm2, xmm3
movaps xmm0, xmm2
psrldq xmm0, 8
paddd xmm2, xmm0
movups xmm0, xmm2
psrldq xmm0, 4
paddd xmm2, xmm0
movd edi, xmm2
mov dword [ebp - 8], edi
cmp ecx, ebx
jge 0x4c7a37
mov esi, dword [edx + 8]
nop
cmp dword [esi + ecx*4], 0
lea eax, [edi + 1]
cmovle eax, edi
inc ecx
mov edi, eax
cmp ecx, ebx
jl 0x4c7a20
mov esi, dword [ebp + 8]
mov dword [ebp - 8], edi
mov dword [esi + 4], ebx
mov dword [esi + 8], edi
mov eax, dword [edx]
mov dword [esi], eax
test edi, edi
jle 0x4c7f2f
push edi
push dword [edx + 4]
push dword [edx + 8]
call fcn.004c76a0
mov ebx, eax
add esp, 0xc
lea eax, [edi*4]
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x20], eax
call fcn.0050c700
mov eax, esp
mov dword [ebp - 0xc], eax
test ebx, ebx
jne 0x4c7ae9
mov eax, dword [esi + 0x10]
test eax, eax
je 0x4c7a85
push eax
call fcn.0051267d
add esp, 4
mov eax, dword [esi + 0x14]
test eax, eax
je 0x4c7a95
push eax
call fcn.0051267d
add esp, 4
mov eax, dword [esi + 0x18]
test eax, eax
je 0x4c7aa5
push eax
call fcn.0051267d
add esp, 4
mov eax, dword [esi + 0x1c]
test eax, eax
je 0x4c7ab5
push eax
call fcn.0051267d
add esp, 4
mov eax, dword [esi + 0x20]
test eax, eax
je 0x4c7ac5
push eax
call fcn.0051267d
add esp, 4
push 0x38
push 0
push esi
call fcn.0050ea20
add esp, 0xc
or eax, 0xffffffff
lea esp, [ebp - 0x30]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0050b540
mov esp, ebp
pop ebp
ret
test edi, edi
jle 0x4c7b7a
sub eax, dword [ebp - 0x1c]
mov dword [ebp - 0x18], eax
mov esi, eax
mov dword [ebp - 0x14], edi
nop dword [eax]
mov ecx, dword [ebx]
rol ecx, 0x10
mov edx, ecx
mov eax, ecx
shr edx, 8
shl eax, 8
xor edx, eax
shl ecx, 8
and edx, 0xff00ff
xor edx, ecx
mov ecx, edx
mov eax, edx
shr ecx, 4
shl eax, 4
xor ecx, eax
shl edx, 4
and ecx, 0xf0f0f0f
xor ecx, edx
mov edx, ecx
shr edx, 2
lea eax, [ecx*4]
xor edx, eax
lea eax, [ecx*4]
and edx, 0x33333333
xor edx, eax
mov ecx, edx
shr ecx, 1
lea eax, [edx + edx]
xor ecx, eax
lea eax, [edx + edx]
and ecx, 0x55555555
xor ecx, eax
mov dword [ebx], ecx
mov dword [esi + ebx], ebx
add ebx, 4
sub edi, 1
jne 0x4c7b00
mov esi, dword [ebp + 8]
mov edi, dword [ebp - 8]
mov eax, dword [ebp - 0xc]
push 0x4c78a0
push 4
push edi
push eax
call fcn.0051f360
add esp, 0x10
lea eax, [edi*4]
call fcn.0050c700
lea eax, [edi*4]
mov ebx, esp
push eax
mov dword [ebp - 0x10], ebx
call fcn.0051269a
add esp, 4
mov dword [esi + 0x14], eax
xor ecx, ecx
test edi, edi
jle 0x4c7bfd
mov edx, dword [ebp - 0x1c]
mov esi, dword [ebp - 0xc]
nop dword [eax + eax]
mov eax, dword [esi + ecx*4]
sub eax, edx
sar eax, 2
mov dword [ebx + eax*4], ecx
inc ecx
cmp ecx, edi
jl 0x4c7bc0
mov esi, dword [ebp + 8]
mov eax, edx
sub eax, dword [ebp - 0x10]
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x18], edi
nop
mov edx, dword [ebx]
lea ebx, [ebx + 4]
mov ecx, dword [esi + 0x14]
mov eax, dword [eax + ebx - 4]
mov dword [ecx + edx*4], eax
mov eax, dword [ebp - 0x14]
sub edi, 1
jne 0x4c7be0
mov edi, dword [ebp - 8]
mov ebx, dword [ebp - 0x10]
push dword [ebp - 0x1c]
call fcn.0051267d
push ebx
push edi
mov edi, dword [ebp + 0xc]
push edi
call fcn.004c73c0
push dword [ebp - 0x20]
mov dword [esi + 0x10], eax
call fcn.0051269a
xor ecx, ecx
mov dword [esi + 0x18], eax
add esp, 0x14
mov dword [ebp - 0xc], ecx
xor edx, edx
cmp dword [edi + 4], ecx
jle 0x4c7c4f
nop dword [eax]
mov eax, dword [edi + 8]
cmp dword [eax + edx*4], 0
jle 0x4c7c49
mov ecx, dword [ebx + ecx*4]
mov eax, dword [esi + 0x18]
mov dword [eax + ecx*4], edx
mov ecx, dword [ebp - 0xc]
inc ecx
mov dword [ebp - 0xc], ecx
inc edx
cmp edx, dword [edi + 4]
jl 0x4c7c30
push ecx
call fcn.0051269a
xor ebx, ebx
mov dword [esi + 0x1c], eax
xor edx, edx
mov dword [ebp - 0x1c], ebx
add esp, 4
cmp dword [edi + 4], edx
jle 0x4c7c90
mov eax, dword [edi + 8]
mov eax, dword [eax + edx*4]
mov dword [ebp - 0x18], eax
test eax, eax
jle 0x4c7c8a
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + ebx*4]
mov eax, dword [esi + 0x1c]
mov ebx, dword [ebp - 0x18]
mov byte [ecx + eax], bl
mov ebx, dword [ebp - 0x1c]
inc ebx
mov dword [ebp - 0x1c], ebx
inc edx
cmp edx, dword [edi + 4]
jl 0x4c7c67
mov eax, dword [esi + 8]
xor ecx, ecx
test eax, eax
je 0x4c7ca5
nop dword [eax]
inc ecx
shr eax, 1
jne 0x4c7ca0
add ecx, 0xfffffffc
mov dword [esi + 0x24], ecx
cmp ecx, 5
jge 0x4c7cbc
mov dword [esi + 0x24], 5
mov ecx, 5
cmp ecx, 8
jle 0x4c7ccd
mov dword [esi + 0x24], 8
mov ecx, 8
mov eax, 1
shl eax, cl
push 4
push eax
mov dword [ebp - 0x18], eax
call fcn.0051d276
xor edi, edi
mov dword [esi + 0x20], eax
add esp, 8
mov dword [esi + 0x28], 0
mov dword [ebp - 0xc], edi
test ebx, ebx
jle 0x4c7e07
mov eax, dword [esi + 0x1c]
mov dword [ebp - 8], eax
nop
mov cl, byte [eax + edi]
movsx edx, cl
cmp dword [esi + 0x28], edx
jge 0x4c7d11
mov dword [esi + 0x28], edx
mov cl, byte [eax + edi]
movsx ecx, cl
mov dword [ebp - 0x20], ecx
mov ecx, dword [esi + 0x24]
mov edx, ecx
cmp dword [ebp - 0x20], ecx
jg 0x4c7df6
mov eax, dword [esi + 0x14]
mov ecx, dword [eax + edi*4]
rol ecx, 0x10
mov edx, ecx
mov eax, ecx
shr edx, 8
shl eax, 8
xor edx, eax
shl ecx, 8
and edx, 0xff00ff
xor edx, ecx
mov ecx, edx
mov eax, edx
shr ecx, 4
shl eax, 4
xor ecx, eax
shl edx, 4
and ecx, 0xf0f0f0f
xor ecx, edx
mov edx, ecx
shr edx, 2
lea eax, [ecx*4]
xor edx, eax
lea eax, [ecx*4]
and edx, 0x33333333
xor edx, eax
mov ecx, edx
shr ecx, 1
lea eax, [edx + edx]
xor ecx, eax
lea eax, [edx + edx]
and ecx, 0x55555555
xor edx, edx
xor ecx, eax
mov dword [ebp - 0x14], edx
mov eax, dword [ebp - 8]
mov dword [ebp - 0x24], ecx
mov ecx, dword [esi + 0x24]
mov dword [ebp - 8], eax
mov eax, 1
mov dword [ebp - 0x10], ecx
sub ecx, dword [ebp - 0x20]
shl eax, cl
test eax, eax
jle 0x4c7df0
mov ebx, dword [ebp - 0xc]
mov eax, dword [esi + 0x1c]
lea edi, [ebx + 1]
mov cl, byte [ebx + eax]
mov eax, dword [esi + 0x20]
shl edx, cl
or edx, dword [ebp - 0x24]
mov dword [eax + edx*4], edi
mov eax, dword [esi + 0x1c]
mov ecx, dword [esi + 0x24]
mov edx, dword [ebp - 0x14]
mov dword [ebp - 8], eax
inc edx
movsx eax, byte [eax + ebx]
mov dword [ebp - 0x10], ecx
sub ecx, eax
mov eax, 1
mov dword [ebp - 0x14], edx
shl eax, cl
cmp edx, eax
jl 0x4c7db2
mov ebx, dword [ebp - 0x1c]
mov edi, dword [ebp - 0xc]
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 8]
inc edi
mov dword [ebp - 8], eax
mov dword [ebp - 0xc], edi
cmp edi, ebx
jl 0x4c7d00
jmp 0x4c7e0a
mov edx, dword [esi + 0x24]
mov ecx, 0x1f
mov dword [ebp - 0x14], 0
sub ecx, edx
mov eax, 0xfffffffe
shl eax, cl
xor edi, edi
mov dword [ebp - 0x24], eax
xor eax, eax
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0x18], eax
jle 0x4c7f2f
mov ecx, 0x20
sub ecx, dword [esi + 0x24]
shl eax, cl
mov ecx, eax
mov dword [ebp - 0x20], eax
rol ecx, 0x10
mov edx, ecx
mov eax, ecx
shr edx, 8
shl eax, 8
xor edx, eax
shl ecx, 8
and edx, 0xff00ff
xor edx, ecx
mov ecx, edx
mov eax, edx
shr ecx, 4
shl eax, 4
xor ecx, eax
shl edx, 4
and ecx, 0xf0f0f0f
xor ecx, edx
mov edx, ecx
shr edx, 2
lea eax, [ecx*4]
xor edx, eax
lea eax, [ecx*4]
and edx, 0x33333333
xor edx, eax
mov ecx, edx
shr ecx, 1
lea eax, [edx + edx]
xor ecx, eax
lea eax, [edx + edx]
and ecx, 0x55555555
xor ecx, eax
mov eax, dword [esi + 0x20]
cmp dword [eax + ecx*4], 0
lea eax, [eax + ecx*4]
mov dword [ebp - 0x10], eax
jne 0x4c7f1f
mov edx, dword [ebp - 0x14]
lea ecx, [edx + 1]
cmp ecx, ebx
jge 0x4c7edb
mov eax, dword [esi + 0x14]
mov esi, dword [ebp - 0x20]
lea eax, [eax + edx*4]
add eax, 4
cmp dword [eax], esi
ja 0x4c7ed5
inc ecx
inc edx
add eax, 4
cmp ecx, ebx
jl 0x4c7ec8
mov esi, dword [ebp + 8]
mov dword [ebp - 0x14], edx
cmp edi, ebx
jge 0x4c7ef7
mov eax, dword [esi + 0x14]
lea ecx, [eax + edi*4]
mov eax, dword [ecx]
and eax, dword [ebp - 0x24]
cmp dword [ebp - 0x20], eax
jb 0x4c7ef7
inc edi
add ecx, 4
cmp edi, ebx
jl 0x4c7ee5
mov ecx, ebx
mov eax, edx
sub ecx, edi
cmp edx, 0x7fff
mov edx, 0x7fff
cmova eax, edx
cmp ecx, edx
cmova ecx, edx
or eax, 0xffff0000
shl eax, 0xf
or eax, ecx
mov ecx, dword [ebp - 0x10]
mov dword [ecx], eax
mov eax, dword [ebp - 0xc]
inc eax
mov dword [ebp - 0xc], eax
cmp eax, dword [ebp - 0x18]
jl 0x4c7e32
xor eax, eax
lea esp, [ebp - 0x30]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0050b540
mov esp, ebp
pop ebp
ret