Function at 0x4d1ed0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x170
mov eax, dword [0x5a6008]
xor eax, esp
mov dword [esp + 0x16c], eax
mov eax, dword [ebp + 8]
mov dword [esp + 0x30], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x64], eax
push esi
mov esi, ecx
mov dword [esp + 0xc], edx
push edi
mov dword [esp + 0x20], esi
mov dword [esp + 0x3c], 3
mov eax, dword [esi + 0x5c]
mov ecx, dword [esi + 4]
mov edx, dword [esi + 8]
mov dword [esp + 0x2c], eax
mov eax, dword [esi + 0x28]
mov dword [esp + 0x30], eax
mov eax, dword [esi + 0x24]
mov dword [esp + 0x18], eax
mov eax, dword [esi + 0xc]
mov dword [esp + 0x5c], eax
mov dword [esp + 0x24], ecx
mov dword [esp + 0x60], edx
mov edx, 1
lea edi, [eax + ecx]
mov dword [esp + 0x64], 0xf
mov eax, dword [esp + 0x10]
sub eax, ecx
mov dword [esp + 0x68], edi
mov ecx, dword [esi + 0xb8]
mov dword [esp + 0x14], eax
mov edi, dword [esp + 0x14]
shl edx, cl
mov ecx, dword [esi + 0x10]
sub edi, edx
sub eax, ecx
cmp eax, edx
mov eax, edi
mov edi, dword [esp + 0x10]
cmovbe eax, ecx
cmp dword [esi + 0x18], 0
cmovne eax, ecx
mov ecx, 4
mov dword [esp + 0x54], eax
mov eax, dword [esi + 0xc4]
cmp eax, ecx
cmovb ecx, eax
mov eax, dword [esi + 0x50]
mov dword [esp + 0x28], eax
mov eax, 1
shl eax, cl
cmp dword [esi + 0xdc], 0
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x14]
jne 0x4d21aa
mov edi, dword [esi + 0x1c]
sub eax, edi
mov edx, dword [esp + 0x18]
mov ecx, edx
cmp eax, 0x180
jbe 0x4d20e5
lea eax, [edi + 0x60]
mov dword [esp + 0x40], edx
mov dword [esp + 0xc], eax
cmp edi, eax
jae 0x4d205f
mov ecx, 0x18
sub ecx, edx
mov dword [esp + 0x1c], ecx
nop dword [eax]
nop dword [eax + eax]
mov eax, dword [esp + 0x24]
imul edx, dword [eax + edi + 8], 0x9e3779b1
mov eax, edi
and eax, 7
xor edx, dword [esi + 0x50]
shr edx, cl
mov ecx, dword [esi + eax*4 + 0x2c]
mov dword [esi + eax*4 + 0x2c], edx
mov esi, ecx
mov edx, dword [esp + 0x30]
mov eax, 0
shr esi, 4
and esi, 0xffffff0
mov dword [esp + 0x40], ecx
add edx, esi
movzx ecx, byte [edx]
dec ecx
and ecx, 0xf
cmove eax, dword [esp + 0x64]
add ecx, eax
mov eax, dword [esp + 0x40]
mov byte [edx], cl
mov byte [ecx + edx], al
lea eax, [ecx + esi]
mov ecx, dword [esp + 0x2c]
mov esi, dword [esp + 0x20]
mov dword [ecx + eax*4], edi
inc edi
mov ecx, dword [esp + 0x1c]
cmp edi, dword [esp + 0xc]
jb 0x4d1ff0
mov eax, dword [esi + 0x24]
mov dword [esp + 0x40], eax
mov edi, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
add edi, 0xffffffe0
mov eax, dword [esp + 0x24]
inc ecx
add eax, edi
mov dword [esp + 0x34], edi
mov edx, edi
mov dword [esp + 0xc], edx
cmp eax, ecx
jbe 0x4d2083
xor ecx, ecx
jmp 0x4d208a
sub ecx, dword [esp + 0x24]
sub ecx, edi
inc ecx
mov eax, 8
cmp ecx, eax
cmova ecx, eax
add ecx, edi
mov dword [esp + 0x1c], ecx
cmp edi, ecx
jae 0x4d20e1
mov edi, dword [esp + 0x1c]
mov ecx, 0x18
sub ecx, dword [esp + 0x40]
nop dword [eax + eax]
mov eax, dword [esp + 0x24]
imul edx, dword [edx + eax], 0x9e3779b1
mov eax, dword [esp + 0xc]
and eax, 7
xor edx, dword [esi + 0x50]
shr edx, cl
mov dword [esi + eax*4 + 0x2c], edx
mov edx, dword [esp + 0xc]
inc edx
mov dword [esp + 0xc], edx
cmp edx, edi
jb 0x4d20b0
mov ecx, dword [esi + 0x24]
mov edi, dword [esp + 0x34]
jmp 0x4d20e5
mov ecx, dword [esp + 0x40]
mov eax, dword [esi + 0x5c]
mov edx, dword [esi + 4]
mov dword [esp + 0xc], eax
mov eax, dword [esi + 0x28]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x48], edx
cmp edi, eax
jae 0x4d217a
mov eax, 0x18
sub eax, ecx
mov dword [esp + 0x34], eax
nop dword [eax]
imul edx, dword [edx + edi + 8], 0x9e3779b1
mov eax, edi
mov ecx, dword [esp + 0x34]
and eax, 7
xor edx, dword [esi + 0x50]
shr edx, cl
mov ecx, dword [esi + eax*4 + 0x2c]
mov dword [esi + eax*4 + 0x2c], edx
mov esi, ecx
mov edx, dword [esp + 0x1c]
mov eax, 0
shr esi, 4
and esi, 0xffffff0
mov dword [esp + 0x40], ecx
add edx, esi
movzx ecx, byte [edx]
dec ecx
and ecx, 0xf
cmove eax, dword [esp + 0x64]
add ecx, eax
mov eax, dword [esp + 0x40]
mov byte [edx], cl
mov byte [ecx + edx], al
lea eax, [ecx + esi]
mov ecx, dword [esp + 0xc]
mov esi, dword [esp + 0x20]
mov edx, dword [esp + 0x48]
mov dword [ecx + eax*4], edi
inc edi
mov eax, dword [esp + 0x14]
cmp edi, eax
jb 0x4d2110
mov edi, dword [esp + 0x10]
mov ecx, 0x18
sub ecx, dword [esp + 0x18]
mov dword [esi + 0x1c], eax
imul edx, dword [edi + 8], 0x9e3779b1
xor edx, dword [esp + 0x28]
shr edx, cl
and eax, 7
mov ecx, dword [esi + eax*4 + 0x2c]
mov dword [esi + eax*4 + 0x2c], edx
mov edx, ecx
mov dword [esp + 0x18], ecx
jmp 0x4d21c6
imul edx, dword [edi], 0x9e3779b1
mov ecx, 0x18
sub ecx, dword [esp + 0x18]
mov dword [esi + 0x1c], eax
xor edx, dword [esp + 0x28]
shr edx, cl
mov dword [esp + 0x18], edx
mov ecx, dword [esp + 0x2c]
mov eax, edx
add dword [esi + 0x58], edx
shr eax, 4
and eax, 0xffffff0
mov dword [esp + 0xc], 0
mov dword [esp + 0x28], 0
lea ecx, [ecx + eax*4]
mov dword [esp + 0x2c], ecx
mov ecx, dword [esp + 0x30]
add ecx, eax
movsx eax, dl
mov dword [esp + 0x1c], ecx
movzx esi, byte [ecx]
movd xmm0, eax
and esi, 0xf
punpcklbw xmm0, xmm0
punpcklwd xmm0, xmm0
pshufd xmm1, xmm0, 0
movups xmm0, xmmword [ecx]
mov ecx, esi
mov dword [esp + 0x34], 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 dword [esp + 0x48], edx
mov esi, eax
test edx, edx
jne 0x4d2249
test esi, esi
je 0x4d22a2
mov edi, dword [esp + 0x48]
nop dword [eax]
cmp dword [esp + 0x58], 0
jbe 0x4d229e
push edi
push esi
call fcn.004ce160
add eax, dword [esp + 0x3c]
add esp, 8
and eax, 0xf
je 0x4d2288
mov ecx, dword [esp + 0x2c]
mov ecx, dword [ecx + eax*4]
cmp ecx, dword [esp + 0x54]
jb 0x4d229e
mov eax, dword [esp + 0xc]
mov dword [esp + eax*4 + 0x70], ecx
inc eax
dec dword [esp + 0x58]
mov dword [esp + 0xc], eax
mov ecx, esi
mov eax, edi
add ecx, 0xffffffff
adc eax, 0xffffffff
and esi, ecx
and edi, eax
ja 0x4d2250
jb 0x4d229e
test esi, esi
jne 0x4d2250
mov edi, dword [esp + 0x10]
mov edx, dword [esp + 0x1c]
mov esi, 0xf
mov eax, 0
movzx ecx, byte [edx]
dec ecx
and ecx, 0xf
cmove eax, esi
mov esi, dword [esp + 0x2c]
add ecx, eax
mov eax, dword [esp + 0x18]
mov byte [edx], cl
mov byte [ecx + edx], al
mov edx, dword [esp + 0x20]
mov eax, dword [edx + 0x1c]
mov dword [esi + ecx*4], eax
inc dword [edx + 0x1c]
cmp dword [esp + 0xc], 0
jbe 0x4d23f6
mov edx, dword [esp + 0xc]
xor eax, eax
nop word [eax + eax]
mov esi, dword [esp + eax*4 + 0x70]
mov dword [esp + 0x48], esi
cmp esi, dword [esp + 0x5c]
jb 0x4d2328
mov edx, dword [esp + 0x24]
mov ecx, dword [esp + 0x3c]
add edx, esi
mov eax, dword [edx + ecx - 3]
cmp eax, dword [ecx + edi - 3]
jne 0x4d23c5
push dword [esp + 0x38]
mov ecx, edi
call fcn.004ce1f0
add esp, 4
mov edi, eax
jmp 0x4d2398
mov ecx, dword [esp + 0x60]
mov eax, dword [esi + ecx]
cmp eax, dword [edi]
jne 0x4d23f0
add ecx, 4
add edi, 4
add esi, ecx
mov dword [esp + 0x30], edi
mov ecx, dword [esp + 0x5c]
mov eax, edi
add ecx, dword [esp + 0x60]
sub eax, esi
add eax, ecx
mov edx, esi
mov ecx, dword [esp + 0x38]
cmp eax, ecx
cmovb ecx, eax
push ecx
mov ecx, edi
call fcn.004ce1f0
mov edi, eax
add esp, 4
mov eax, dword [esp + 0x5c]
add eax, dword [esp + 0x60]
lea ecx, [edi + esi]
cmp ecx, eax
jne 0x4d2391
mov ecx, dword [esp + 0x30]
push dword [esp + 0x38]
mov edx, dword [esp + 0x6c]
lea ecx, [edi + ecx]
call fcn.004ce1f0
add esp, 4
add edi, eax
mov esi, dword [esp + 0x48]
add edi, 4
mov ecx, dword [esp + 0x3c]
cmp edi, ecx
jbe 0x4d23c1
mov eax, dword [esp + 0x14]
mov ecx, edi
mov edx, dword [esp + 0x6c]
sub eax, esi
add eax, 3
mov dword [esp + 0x3c], ecx
mov dword [edx], eax
mov eax, dword [esp + 0x10]
add eax, edi
cmp eax, dword [esp + 0x38]
je 0x4d23da
mov edi, dword [esp + 0x10]
mov edx, dword [esp + 0xc]
mov eax, dword [esp + 0x28]
inc eax
mov dword [esp + 0x28], eax
cmp eax, edx
jb 0x4d22f0
mov eax, ecx
pop edi
pop esi
mov ecx, dword [esp + 0x16c]
xor ecx, esp
call fcn.00511339
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x3c]
jmp 0x4d23c9
mov ecx, dword [esp + 0x174]
mov eax, 3
pop edi
pop esi
xor ecx, esp
call fcn.00511339
mov esp, ebp
pop ebp
ret