Function at 0x4f0680
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x160
mov eax, dword [0x5d60c4]
xor eax, esp
mov dword [esp + 0x15c], eax
mov eax, dword [esp + 0x16c]
mov edx, 1
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x170]
mov dword [esp], eax
push esi
mov esi, dword [esp + 0x168]
push edi
mov edi, dword [esp + 0x170]
mov dword [esp + 0x50], edi
mov eax, dword [esi + 0x5c]
mov ecx, dword [esi + 4]
mov dword [esp + 0x48], eax
mov eax, dword [esi + 0x28]
mov dword [esp + 0x44], eax
lea eax, [esi + 0x2c]
mov dword [esp + 0x30], eax
mov eax, dword [esi + 0x24]
mov dword [esp + 0x54], eax
mov eax, edi
sub eax, ecx
mov dword [esp + 0x4c], ecx
mov ecx, dword [esi + 0xb8]
mov dword [esp + 0x58], eax
mov edi, dword [esp + 0x58]
shl edx, cl
mov ecx, dword [esi + 0x10]
sub edi, edx
sub eax, ecx
mov dword [esp + 0x5c], esi
cmp eax, edx
mov dword [esp + 0xc], 3
mov eax, edi
mov dword [esp + 0x14], 0xf
cmovbe eax, ecx
mov edi, dword [esp + 0x50]
cmp dword [esi + 0x18], 0
cmovne eax, ecx
mov ecx, 4
mov dword [esp + 0x2c], eax
mov eax, dword [esi + 0xc4]
cmp eax, ecx
cmovb ecx, eax
mov eax, dword [esi + 0x50]
mov dword [esp + 0x10], eax
mov eax, dword [esi + 0x54]
mov dword [esp + 0x38], eax
mov eax, 1
shl eax, cl
mov ecx, esi
mov dword [esp + 0x28], eax
cmp dword [ecx + 0xdc], 0
jne 0x4f097b
mov esi, dword [ecx + 0x1c]
mov eax, dword [esp + 0x58]
sub eax, esi
mov dword [esp + 0x60], esi
cmp eax, 0x180
jbe 0x4f0895
lea eax, [esi + 0x60]
mov dword [esp + 0x40], eax
cmp esi, eax
jae 0x4f0817
mov edi, dword [esp + 0x60]
mov esi, 0x18
sub esi, dword [esp + 0x54]
mov dword [esp + 0x1c], esi
nop word [eax + eax]
mov eax, dword [ecx + 0x54]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x4c]
imul edx, dword [eax + edi + 8], 0x9e3779b1
mov eax, edi
and eax, 7
xor edx, dword [ecx + 0x50]
mov ecx, esi
mov esi, dword [esp + 0x30]
shr edx, cl
mov ecx, dword [esi + eax*4]
mov dword [esi + eax*4], edx
mov esi, ecx
mov edx, dword [esp + 0x44]
mov eax, 0
shr esi, 4
and esi, 0xffffff0
mov dword [esp + 0x60], ecx
add edx, esi
movzx ecx, byte [edx]
dec ecx
and ecx, 0xf
cmove eax, dword [esp + 0x14]
add ecx, eax
mov eax, dword [esp + 0x60]
mov byte [edx], cl
mov byte [ecx + edx], al
lea eax, [ecx + esi]
mov ecx, dword [esp + 0x48]
mov esi, dword [esp + 0x1c]
mov dword [ecx + eax*4], edi
inc edi
mov ecx, dword [esp + 0x5c]
cmp edi, dword [esp + 0x40]
jb 0x4f07a0
mov edi, dword [esp + 0x50]
mov esi, dword [esp + 0x58]
lea edx, [edi + 1]
mov eax, dword [esp + 0x4c]
add esi, 0xffffffe0
add eax, esi
mov dword [esp + 0x60], esi
cmp eax, edx
jbe 0x4f0833
xor edx, edx
jmp 0x4f083a
sub edx, dword [esp + 0x4c]
sub edx, esi
inc edx
mov eax, 8
cmp edx, eax
cmova edx, eax
add edx, esi
mov dword [esp + 0x1c], edx
cmp esi, edx
jae 0x4f0895
mov eax, 0x18
mov edi, edx
sub eax, dword [ecx + 0x24]
mov dword [esp + 0x3c], eax
nop dword [eax]
mov eax, dword [ecx + 0x54]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x4c]
imul edx, dword [esi + eax], 0x9e3779b1
mov eax, esi
and eax, 7
inc esi
xor edx, dword [ecx + 0x50]
mov ecx, dword [esp + 0x3c]
shr edx, cl
mov ecx, dword [esp + 0x5c]
mov dword [ecx + eax*4 + 0x2c], edx
cmp esi, edi
jb 0x4f0860
mov edi, dword [esp + 0x50]
mov esi, dword [esp + 0x60]
mov eax, dword [ecx + 0x5c]
mov edx, dword [ecx + 4]
mov dword [esp + 0x40], eax
mov eax, dword [ecx + 0x28]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x58]
mov dword [esp + 0x38], edx
cmp esi, eax
jae 0x4f0949
mov edi, dword [esp + 0x60]
mov esi, 0x18
sub esi, dword [ecx + 0x24]
mov dword [esp + 0x20], esi
nop word [eax + eax]
imul edx, dword [edx + edi + 8], 0x9e3779b1
mov eax, dword [ecx + 0x54]
mov dword [esp + 0x1c], eax
mov eax, edi
and eax, 7
xor edx, dword [ecx + 0x50]
mov ecx, esi
mov esi, dword [esp + 0x30]
shr edx, cl
mov ecx, dword [esi + eax*4]
mov dword [esi + eax*4], edx
mov esi, ecx
mov edx, dword [esp + 0x3c]
mov eax, 0
shr esi, 4
and esi, 0xffffff0
mov dword [esp + 0x1c], ecx
add edx, esi
movzx ecx, byte [edx]
dec ecx
and ecx, 0xf
cmove eax, dword [esp + 0x14]
add ecx, eax
mov eax, dword [esp + 0x1c]
mov byte [edx], cl
mov byte [ecx + edx], al
lea eax, [ecx + esi]
mov ecx, dword [esp + 0x40]
mov esi, dword [esp + 0x20]
mov edx, dword [esp + 0x38]
mov dword [ecx + eax*4], edi
inc edi
mov eax, dword [esp + 0x58]
mov ecx, dword [esp + 0x5c]
cmp edi, eax
jb 0x4f08d0
mov edi, dword [esp + 0x50]
mov esi, dword [esp + 0x30]
mov dword [ecx + 0x1c], eax
mov ecx, 0x18
imul edx, dword [edi + 8], 0x9e3779b1
sub ecx, dword [esp + 0x54]
xor edx, dword [esp + 0x10]
shr edx, cl
and eax, 7
mov ecx, dword [esi + eax*4]
mov dword [esi + eax*4], edx
mov edx, ecx
mov eax, dword [esp + 0x5c]
mov dword [esp + 0x54], ecx
jmp 0x4f099d
imul edx, dword [edi], 0x9e3779b1
mov ecx, 0x18
sub ecx, dword [esp + 0x54]
mov eax, esi
xor edx, dword [esp + 0x10]
shr edx, cl
mov ecx, dword [esp + 0x58]
mov dword [esp + 0x54], edx
mov dword [eax + 0x1c], ecx
add dword [eax + 0x58], edx
mov eax, edx
mov ecx, dword [esp + 0x48]
shr eax, 4
and eax, 0xffffff0
mov dword [esp + 0x60], 0
lea ecx, [ecx + eax*4]
mov dword [esp + 0x48], ecx
mov ecx, dword [esp + 0x44]
add ecx, eax
mov dword [esp + 0x44], 0
mov dword [esp + 0x3c], ecx
movzx eax, byte [ecx]
mov esi, eax
mov dword [esp + 0x20], eax
movsx eax, dl
and esi, 0xf
mov dword [esp + 0x38], esi
movd xmm0, eax
punpcklbw xmm0, xmm0
punpcklwd xmm0, xmm0
pshufd xmm1, xmm0, 0
movups xmm0, xmmword [ecx]
mov ecx, esi
neg ecx
pcmpeqb xmm0, xmm1
and ecx, 0xf
pmovmskb edx, xmm0
mov ax, dx
shl ax, cl
mov cx, si
shr dx, cl
or ax, dx
movzx eax, ax
cdq
mov esi, eax
test edx, edx
jne 0x4f0a22
test esi, esi
je 0x4f0a7b
xor edi, edi
cmp dword [esp + 0x28], 0
je 0x4f0a77
test esi, esi
jne 0x4f0a37
bsf eax, edx
add eax, 0x20
jmp 0x4f0a3a
bsf eax, esi
add eax, dword [esp + 0x38]
and eax, 0xf
je 0x4f0a61
mov edi, dword [esp + 0x48]
mov eax, dword [edi + eax*4]
mov edi, dword [esp + 0x60]
cmp eax, dword [esp + 0x2c]
jb 0x4f0a77
mov dword [esp + edi*4 + 0x64], eax
inc edi
dec dword [esp + 0x28]
mov dword [esp + 0x60], edi
mov ecx, esi
mov eax, edx
add ecx, 0xffffffff
adc eax, 0xffffffff
and esi, ecx
and edx, eax
ja 0x4f0a24
jb 0x4f0a77
test esi, esi
jne 0x4f0a24
mov edi, dword [esp + 0x50]
mov ecx, dword [esp + 0x20]
mov edx, 0xf
mov esi, dword [esp + 0x48]
dec ecx
and ecx, 0xf
mov eax, 0
cmove eax, edx
mov edx, dword [esp + 0x3c]
add ecx, eax
mov eax, dword [esp + 0x54]
mov byte [edx], cl
mov byte [ecx + edx], al
mov edx, dword [esp + 0x5c]
mov eax, dword [edx + 0x1c]
mov dword [esi + ecx*4], eax
inc dword [edx + 0x1c]
cmp dword [esp + 0x60], 0
jbe 0x4f0ba3
mov ecx, dword [esp + 0x60]
xor eax, eax
lea esi, [eax + 3]
mov eax, dword [esp + eax*4 + 0x64]
mov edx, dword [esp + 0x4c]
add edx, eax
mov dword [esp + 0x38], eax
mov eax, dword [edx + esi - 3]
cmp eax, dword [esi + edi - 3]
jne 0x4f0b6d
mov esi, dword [esp + 0x24]
mov eax, edi
add esi, 0xfffffffd
cmp edi, esi
jae 0x4f0b19
mov eax, dword [edx]
xor eax, dword [edi]
je 0x4f0afb
bsf ecx, eax
shr ecx, 3
jmp 0x4f0b41
lea eax, [edi + 4]
add edx, 4
cmp eax, esi
jae 0x4f0b19
mov ecx, dword [eax]
xor ecx, dword [edx]
jne 0x4f0b97
add eax, 4
add edx, 4
cmp eax, esi
jb 0x4f0b05
mov esi, dword [esp + 0x24]
lea ecx, [esi - 1]
cmp eax, ecx
jae 0x4f0b32
mov cx, word [edx]
cmp cx, word [eax]
jne 0x4f0b32
add eax, 2
add edx, 2
cmp eax, esi
jae 0x4f0b3d
mov cl, byte [edx]
cmp cl, byte [eax]
jne 0x4f0b3d
inc eax
mov ecx, eax
sub ecx, edi
mov esi, dword [esp + 0xc]
cmp ecx, esi
jbe 0x4f0b69
mov eax, dword [esp + 0x58]
mov esi, ecx
sub eax, dword [esp + 0x38]
mov edx, dword [esp + 8]
add eax, 3
mov dword [esp + 0xc], esi
mov dword [edx], eax
lea eax, [ecx + edi]
cmp eax, dword [esp + 0x24]
je 0x4f0b7e
mov ecx, dword [esp + 0x60]
mov eax, dword [esp + 0x44]
inc eax
mov dword [esp + 0x44], eax
cmp eax, ecx
jb 0x4f0ac4
pop edi
mov eax, esi
pop esi
mov ecx, dword [esp + 0x15c]
xor ecx, esp
call fcn.0052b789
add esp, 0x160
ret
bsf ecx, ecx
shr ecx, 3
sub ecx, edi
add ecx, eax
jmp 0x4f0b41
mov ecx, dword [esp + 0x164]
mov eax, 3
pop edi
pop esi
xor ecx, esp
call fcn.0052b789
add esp, 0x160
ret