Function at 0x4ce490
Capabilities:
Encode data using xor
Encrypt data using twofish

Disassembly:
sub esp, 0x250
mov eax, dword [0x5894dc]
xor eax, esp
mov dword [esp + 0x24c], eax
push ebx
mov ebx, dword [esp + 0x258]
push esi
push edi
xor esi, esi
xor edi, edi
cmp dword [0x587b30], esi
mov dword [esp + 0x10], ebx
je 0x4ce4c3
call fcn.004cdbc0
mov eax, dword [ebx + 0xc]
mov ebx, dword [ebx + 4]
lea ecx, [eax + eax + 8]
lea eax, [ebx + 0x3f]
cdq
and edx, 0x3f
add eax, edx
sar eax, 6
mov dword [esp + 0x54], ebx
xor ebx, ebx
test eax, eax
push ebp
mov dword [esp + 0x34], ecx
mov dword [esp + 0x10], eax
jle 0x4ce541
mov ebp, dword [esp + 0x14]
lea edx, [esp + eax*4 + 0x14]
lea eax, [ebp + eax*4 + 0x2c]
mov dword [esp + 0x30], edx
mov dword [esp + 0x2c], eax
add ebp, 0x14
mov ecx, dword [ebp]
mov eax, dword [ebp - 4]
push ecx
push eax
mov dword [esp + ebx*4 + 0x40], eax
mov dword [esp + ebx*4 + 0x50], ecx
call fcn.004cda60
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x38]
mov dword [ecx], eax
mov dword [edx], eax
add ebx, 1
sub ecx, 4
sub edx, 4
add esp, 8
add ebp, 8
cmp ebx, dword [esp + 0x10]
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x30], edx
jl 0x4ce503
mov eax, dword [esp + 0x34]
cdq
sub eax, edx
xor ebx, ebx
sar eax, 1
test eax, eax
mov dword [esp + 0x2c], ebx
jle 0x4ce840
mov ecx, dword [esp + 0x10]
mov ebp, dword [esp + 0x14]
and ecx, 3
mov dword [esp + 0x30], ecx
add ebp, 0x44
mov dword [esp + 0x34], eax
mov edi, edi
mov eax, ecx
sub eax, 0
mov dword [esp + 0x10], ebx
je 0x4ce5cf
sub eax, 2
je 0x4ce60b
sub eax, 1
jne 0x4ce6bb
mov al, byte [esp + 0x13]
mov cl, byte [esp + 0x12]
mov dl, byte [esp + 0x11]
movzx edi, bl
mov bl, byte [edi + 0x587a30]
xor bl, byte [esp + 0x40]
movzx edx, dl
mov dl, byte [edx + 0x587a30]
xor dl, byte [esp + 0x41]
movzx ecx, cl
mov cl, byte [ecx + 0x587930]
xor cl, byte [esp + 0x42]
movzx eax, al
mov al, byte [eax + 0x587930]
xor al, byte [esp + 0x43]
jmp 0x4ce61b
movzx eax, byte [esp + 0x12]
movzx edx, byte [esp + 0x11]
mov dl, byte [edx + 0x587930]
xor dl, byte [esp + 0x45]
movzx ecx, bl
mov bl, byte [ecx + 0x587a30]
mov cl, byte [eax + 0x587930]
movzx eax, byte [esp + 0x13]
mov al, byte [eax + 0x587a30]
xor bl, byte [esp + 0x44]
xor cl, byte [esp + 0x46]
xor al, byte [esp + 0x47]
jmp 0x4ce599
mov al, byte [esp + 0x13]
mov cl, byte [esp + 0x12]
mov dl, byte [esp + 0x11]
mov bl, byte [esp + 0x10]
movzx edi, byte [esp + 0x3f]
movzx eax, al
movzx eax, byte [eax + 0x587a30]
xor eax, edi
movzx eax, byte [eax + 0x587a30]
movzx edi, byte [esp + 0x3b]
movzx ecx, cl
movzx ecx, byte [ecx + 0x587930]
xor eax, edi
movzx edi, byte [esp + 0x3e]
xor ecx, edi
movzx ecx, byte [ecx + 0x587a30]
movzx edi, byte [esp + 0x3a]
xor ecx, edi
mov edi, dword [eax*4 + 0x58c8e8]
xor edi, dword [ecx*4 + 0x58c4e8]
movzx ecx, byte [esp + 0x3d]
movzx edx, dl
movzx eax, byte [edx + 0x587a30]
xor eax, ecx
movzx edx, byte [eax + 0x587930]
movzx eax, byte [esp + 0x39]
xor edx, eax
xor edi, dword [edx*4 + 0x58c0e8]
movzx eax, byte [esp + 0x3c]
movzx ecx, bl
movzx edx, byte [ecx + 0x587930]
mov ebx, dword [esp + 0x2c]
xor edx, eax
movzx ecx, byte [edx + 0x587930]
movzx edx, byte [esp + 0x38]
xor ecx, edx
xor edi, dword [ecx*4 + 0x58bce8]
mov ecx, dword [esp + 0x30]
lea eax, [ebx + 0x1010101]
mov dword [esp + 0x10], eax
mov eax, ecx
sub eax, 0
je 0x4ce72c
sub eax, 2
je 0x4ce76a
sub eax, 1
jne 0x4ce814
mov bl, byte [esp + 0x13]
mov cl, byte [esp + 0x12]
mov dl, byte [esp + 0x11]
mov al, byte [esp + 0x10]
movzx eax, al
mov al, byte [eax + 0x587a30]
xor al, byte [esp + 0x50]
movzx edx, dl
mov dl, byte [edx + 0x587a30]
xor dl, byte [esp + 0x51]
mov byte [esp + 0x10], al
movzx eax, cl
mov cl, byte [eax + 0x587930]
xor cl, byte [esp + 0x52]
movzx eax, bl
mov al, byte [eax + 0x587930]
xor al, byte [esp + 0x53]
mov ebx, dword [esp + 0x2c]
jmp 0x4ce776
movzx ecx, byte [esp + 0x10]
mov al, byte [ecx + 0x587a30]
movzx edx, byte [esp + 0x11]
movzx ecx, byte [esp + 0x12]
movzx esi, byte [esp + 0x13]
mov dl, byte [edx + 0x587930]
mov cl, byte [ecx + 0x587930]
mov bl, byte [esi + 0x587a30]
xor al, byte [esp + 0x54]
xor dl, byte [esp + 0x55]
xor cl, byte [esp + 0x56]
xor bl, byte [esp + 0x57]
jmp 0x4ce6ee
mov al, byte [esp + 0x13]
mov cl, byte [esp + 0x12]
mov dl, byte [esp + 0x11]
movzx esi, byte [esp + 0x4f]
movzx eax, al
movzx eax, byte [eax + 0x587a30]
xor eax, esi
movzx eax, byte [eax + 0x587a30]
movzx esi, byte [esp + 0x4b]
movzx ecx, cl
movzx ecx, byte [ecx + 0x587930]
xor eax, esi
movzx esi, byte [esp + 0x4e]
xor ecx, esi
movzx ecx, byte [ecx + 0x587a30]
movzx esi, byte [esp + 0x4a]
xor ecx, esi
mov esi, dword [eax*4 + 0x58c8e8]
xor esi, dword [ecx*4 + 0x58c4e8]
movzx ecx, byte [esp + 0x4d]
movzx edx, dl
movzx eax, byte [edx + 0x587a30]
xor eax, ecx
movzx edx, byte [eax + 0x587930]
movzx eax, byte [esp + 0x49]
movzx ecx, byte [esp + 0x10]
xor edx, eax
xor esi, dword [edx*4 + 0x58c0e8]
movzx edx, byte [ecx + 0x587930]
movzx eax, byte [esp + 0x4c]
xor edx, eax
movzx ecx, byte [edx + 0x587930]
movzx edx, byte [esp + 0x48]
xor ecx, edx
xor esi, dword [ecx*4 + 0x58bce8]
mov ecx, dword [esp + 0x30]
rol esi, 8
lea eax, [esi + edi]
lea esi, [edi + esi*2]
mov edx, esi
rol edx, 9
mov dword [ebp - 4], eax
mov dword [ebp], edx
add ebx, 0x2020202
add ebp, 8
sub dword [esp + 0x34], 1
mov dword [esp + 0x2c], ebx
jne 0x4ce570
mov eax, dword [esp + 0x58]
sub eax, 0x80
pop ebp
je 0x4cedf3
sub eax, 0x40
je 0x4cebf3
sub eax, 0x40
jne 0x4ceb9e
mov eax, dword [esp + 0x20]
push eax
lea ecx, [esp + 0x15c]
push 0x587a30
push ecx
call fcn.004ce1b0
add esp, 0xc
xor eax, eax
mov edi, edi
movzx edx, byte [esp + eax + 0x158]
movzx ecx, byte [edx + 0x587a30]
movzx edx, byte [esp + eax + 0x159]
mov byte [esp + eax + 0x58], cl
movzx ecx, byte [edx + 0x587a30]
mov byte [esp + eax + 0x59], cl
add eax, 2
cmp eax, 0x100
jl 0x4ce880
mov edx, dword [esp + 0x1c]
push edx
lea eax, [esp + 0x5c]
push eax
mov ecx, eax
push ecx
call fcn.004ce1b0
mov edi, dword [esp + 0x1c]
movzx edx, byte [esp + 0x20]
movzx esi, byte [esp + 0x24]
add esp, 0xc
xor eax, eax
lea ecx, [edi + 0xe8]
jmp 0x4ce8e0
movzx ebx, byte [esp + eax + 0x58]
movzx ebx, byte [ebx + 0x587930]
xor ebx, esi
movzx ebx, byte [ebx + 0x587930]
xor ebx, edx
mov ebx, dword [ebx*4 + 0x58bce8]
mov dword [ecx - 8], ebx
movzx ebx, byte [esp + eax + 0x59]
movzx ebx, byte [ebx + 0x587930]
xor ebx, esi
movzx ebx, byte [ebx + 0x587930]
xor ebx, edx
mov ebx, dword [ebx*4 + 0x58bce8]
mov dword [ecx], ebx
add eax, 2
add ecx, 0x10
cmp eax, 0x100
jl 0x4ce8e0
mov edx, dword [esp + 0x21]
push edx
lea eax, [esp + 0x15c]
push 0x587930
push eax
call fcn.004ce1b0
add esp, 0xc
xor eax, eax
lea ebx, [ebx]
movzx ecx, byte [esp + eax + 0x158]
movzx edx, byte [ecx + 0x587a30]
movzx ecx, byte [esp + eax + 0x159]
mov byte [esp + eax + 0x58], dl
movzx edx, byte [ecx + 0x587a30]
mov byte [esp + eax + 0x59], dl
add eax, 2
cmp eax, 0x100
jl 0x4ce950
mov eax, dword [esp + 0x1d]
push eax
lea ecx, [esp + 0x5c]
push ecx
mov edx, ecx
push edx
call fcn.004ce1b0
movzx edx, byte [esp + 0x21]
movzx esi, byte [esp + 0x25]
add esp, 0xc
xor eax, eax
lea ecx, [edi + 0xec]
jmp 0x4ce9b0
movzx ebx, byte [esp + eax + 0x58]
movzx ebx, byte [ebx + 0x587a30]
xor ebx, esi
movzx ebx, byte [ebx + 0x587930]
xor ebx, edx
mov ebx, dword [ebx*4 + 0x58c0e8]
mov dword [ecx - 8], ebx
movzx ebx, byte [esp + eax + 0x59]
movzx ebx, byte [ebx + 0x587a30]
xor ebx, esi
movzx ebx, byte [ebx + 0x587930]
xor ebx, edx
mov ebx, dword [ebx*4 + 0x58c0e8]
mov dword [ecx], ebx
add eax, 2
add ecx, 0x10
cmp eax, 0x100
jl 0x4ce9b0
mov eax, dword [esp + 0x22]
push eax
lea ecx, [esp + 0x15c]
push 0x587930
push ecx
call fcn.004ce1b0
add esp, 0xc
xor eax, eax
lea ebx, [ebx]
movzx edx, byte [esp + eax + 0x158]
movzx ecx, byte [edx + 0x587930]
movzx edx, byte [esp + eax + 0x159]
mov byte [esp + eax + 0x58], cl
movzx ecx, byte [edx + 0x587930]
mov byte [esp + eax + 0x59], cl
add eax, 2
cmp eax, 0x100
jl 0x4cea20
mov edx, dword [esp + 0x1e]
push edx
lea eax, [esp + 0x5c]
push eax
mov ecx, eax
push ecx
call fcn.004ce1b0
movzx edx, byte [esp + 0x22]
movzx esi, byte [esp + 0x26]
add esp, 0xc
xor eax, eax
lea ecx, [edi + 0x8e8]
jmp 0x4cea80
movzx ebx, byte [esp + eax + 0x58]
movzx ebx, byte [ebx + 0x587930]
xor ebx, esi
movzx ebx, byte [ebx + 0x587a30]
xor ebx, edx
mov ebx, dword [ebx*4 + 0x58c4e8]
mov dword [ecx - 8], ebx
movzx ebx, byte [esp + eax + 0x59]
movzx ebx, byte [ebx + 0x587930]
xor ebx, esi
movzx ebx, byte [ebx + 0x587a30]
xor ebx, edx
mov ebx, dword [ebx*4 + 0x58c4e8]
mov dword [ecx], ebx
add eax, 2
add ecx, 0x10
cmp eax, 0x100
jl 0x4cea80
mov edx, dword [esp + 0x23]
push edx
lea eax, [esp + 0x15c]
push 0x587a30
push eax
call fcn.004ce1b0
add esp, 0xc
xor eax, eax
lea ebx, [ebx]
movzx ecx, byte [esp + eax + 0x158]
movzx edx, byte [ecx + 0x587930]
movzx ecx, byte [esp + eax + 0x159]
mov byte [esp + eax + 0x58], dl
movzx edx, byte [ecx + 0x587930]
mov byte [esp + eax + 0x59], dl
add eax, 2
cmp eax, 0x100
jl 0x4ceaf0
mov eax, dword [esp + 0x1f]
push eax
lea ecx, [esp + 0x5c]
push ecx
mov edx, ecx
push edx
call fcn.004ce1b0
movzx edx, byte [esp + 0x23]
movzx esi, byte [esp + 0x27]
add esp, 0xc
xor eax, eax
lea ecx, [edi + 0x8ec]
jmp 0x4ceb50
movzx edi, byte [esp + eax + 0x58]
movzx edi, byte [edi + 0x587a30]
xor edi, esi
movzx edi, byte [edi + 0x587a30]
xor edi, edx
mov edi, dword [edi*4 + 0x58c8e8]
mov dword [ecx - 8], edi
movzx edi, byte [esp + eax + 0x59]
movzx edi, byte [edi + 0x587a30]
xor edi, esi
movzx edi, byte [edi + 0x587a30]
xor edi, edx
mov edi, dword [edi*4 + 0x58c8e8]
mov dword [ecx], edi
add eax, 2
add ecx, 0x10
cmp eax, 0x100
jl 0x4ceb50
mov edi, dword [esp + 0x10]
cmp byte [edi], 0
jne 0x4cebd6
mov ecx, dword [edi + 0xc]
lea eax, [edi + 0x60]
lea ecx, [eax + ecx*8 - 8]
cmp eax, ecx
jae 0x4cebd3
mov ebx, dword [ecx]
mov edx, dword [eax]
mov esi, dword [eax + 4]
mov dword [eax], ebx
mov ebx, dword [ecx + 4]
mov dword [eax + 4], ebx
mov dword [ecx], edx
mov dword [ecx + 4], esi
add eax, 8
sub ecx, 8
cmp eax, ecx
jb 0x4cebb5
mov byte [edi], 0
mov ecx, dword [esp + 0x258]
pop edi
pop esi
pop ebx
xor ecx, esp
mov eax, 1
call fcn.004ec47e
add esp, 0x250
ret
mov eax, dword [esp + 0x1c]
push eax
lea ecx, [esp + 0x5c]
push 0x587a30
push ecx
call fcn.004ce1b0
mov edi, dword [esp + 0x1c]
movzx edx, byte [esp + 0x20]
movzx esi, byte [esp + 0x24]
add esp, 0xc
xor eax, eax
lea ecx, [edi + 0xe8]
movzx ebx, byte [esp + eax + 0x58]
movzx ebx, byte [ebx + 0x587930]
xor ebx, esi
movzx ebx, byte [ebx + 0x587930]
xor ebx, edx
mov ebx, dword [ebx*4 + 0x58bce8]
mov dword [ecx - 8], ebx
movzx ebx, byte [esp + eax + 0x59]
movzx ebx, byte [ebx + 0x587930]
xor ebx, esi
movzx ebx, byte [ebx + 0x587930]
xor ebx, edx
mov ebx, dword [ebx*4 + 0x58bce8]
mov dword [ecx], ebx
add eax, 2
add ecx, 0x10
cmp eax, 0x100
jl 0x4cec20
mov edx, dword [esp + 0x1d]
push edx
lea eax, [esp + 0x5c]
push 0x587a30
push eax
call fcn.004ce1b0
movzx edx, byte [esp + 0x21]
movzx esi, byte [esp + 0x25]
add esp, 0xc
xor eax, eax
lea ecx, [edi + 0xec]
jmp 0x4ceca0
movzx ebx, byte [esp + eax + 0x58]
movzx ebx, byte [ebx + 0x587a30]
xor ebx, esi
movzx ebx, byte [ebx + 0x587930]
xor ebx, edx
mov ebx, dword [ebx*4 + 0x58c0e8]
mov dword [ecx - 8], ebx
movzx ebx, byte [esp + eax + 0x59]
movzx ebx, byte [ebx + 0x587a30]
xor ebx, esi
movzx ebx, byte [ebx + 0x587930]
xor ebx, edx
mov ebx, dword [ebx*4 + 0x58c0e8]
mov dword [ecx], ebx
add eax, 2
add ecx, 0x10
cmp eax, 0x100
jl 0x4ceca0
mov ecx, dword [esp + 0x1e]
push ecx
lea edx, [esp + 0x5c]
push 0x587930
push edx
call fcn.004ce1b0
movzx edx, byte [esp + 0x22]
movzx esi, byte [esp + 0x26]
add esp, 0xc
xor eax, eax
lea ecx, [edi + 0x8e8]
jmp 0x4ced20
movzx ebx, byte [esp + eax + 0x58]
movzx ebx, byte [ebx + 0x587930]
xor ebx, esi
movzx ebx, byte [ebx + 0x587a30]
xor ebx, edx
mov ebx, dword [ebx*4 + 0x58c4e8]
mov dword [ecx - 8], ebx
movzx ebx, byte [esp + eax + 0x59]
movzx ebx, byte [ebx + 0x587930]
xor ebx, esi
movzx ebx, byte [ebx + 0x587a30]
xor ebx, edx
mov ebx, dword [ebx*4 + 0x58c4e8]
mov dword [ecx], ebx
add eax, 2
add ecx, 0x10
cmp eax, 0x100
jl 0x4ced20
mov eax, dword [esp + 0x1f]
push eax
lea ecx, [esp + 0x5c]
push 0x587930
push ecx
call fcn.004ce1b0
movzx edx, byte [esp + 0x23]
movzx esi, byte [esp + 0x27]
add esp, 0xc
xor eax, eax
lea ecx, [edi + 0x8ec]
jmp 0x4ceda0
movzx edi, byte [esp + eax + 0x58]
movzx edi, byte [edi + 0x587a30]
xor edi, esi
movzx edi, byte [edi + 0x587a30]
xor edi, edx
mov edi, dword [edi*4 + 0x58c8e8]
mov dword [ecx - 8], edi
movzx edi, byte [esp + eax + 0x59]
movzx edi, byte [edi + 0x587a30]
xor edi, esi
movzx edi, byte [edi + 0x587a30]
xor edi, edx
mov edi, dword [edi*4 + 0x58c8e8]
mov dword [ecx], edi
add eax, 2
add ecx, 0x10
cmp eax, 0x100
jl 0x4ceda0
jmp 0x4ceb9e
mov edx, dword [esp + 0x18]
push edx
lea eax, [esp + 0x5c]
push 0x587930
push eax
call fcn.004ce1b0
mov edi, dword [esp + 0x1c]
movzx edx, byte [esp + 0x20]
add esp, 0xc
xor eax, eax
lea ecx, [edi + 0xe8]
jmp 0x4cee20
movzx esi, byte [esp + eax + 0x58]
movzx esi, byte [esi + 0x587930]
xor esi, edx
mov esi, dword [esi*4 + 0x58bce8]
mov dword [ecx - 8], esi
movzx esi, byte [esp + eax + 0x59]
movzx esi, byte [esi + 0x587930]
xor esi, edx
mov esi, dword [esi*4 + 0x58bce8]
mov dword [ecx], esi
add eax, 2
add ecx, 0x10
cmp eax, 0x100
jl 0x4cee20
mov ecx, dword [esp + 0x19]
push ecx
lea edx, [esp + 0x5c]
push 0x587a30
push edx
call fcn.004ce1b0
movzx edx, byte [esp + 0x21]
add esp, 0xc
xor eax, eax
lea ecx, [edi + 0xec]
movzx esi, byte [esp + eax + 0x58]
movzx esi, byte [esi + 0x587930]
xor esi, edx
mov esi, dword [esi*4 + 0x58c0e8]
mov dword [ecx - 8], esi
movzx esi, byte [esp + eax + 0x59]
movzx esi, byte [esi + 0x587930]
xor esi, edx
mov esi, dword [esi*4 + 0x58c0e8]
mov dword [ecx], esi
add eax, 2
add ecx, 0x10
cmp eax, 0x100
jl 0x4cee80
mov eax, dword [esp + 0x1a]
push eax
lea ecx, [esp + 0x5c]
push 0x587930
push ecx
call fcn.004ce1b0
movzx edx, byte [esp + 0x22]
add esp, 0xc
xor eax, eax
lea ecx, [edi + 0x8e8]
movzx esi, byte [esp + eax + 0x58]
movzx esi, byte [esi + 0x587a30]
xor esi, edx
mov esi, dword [esi*4 + 0x58c4e8]
mov dword [ecx - 8], esi
movzx esi, byte [esp + eax + 0x59]
movzx esi, byte [esi + 0x587a30]
xor esi, edx
mov esi, dword [esi*4 + 0x58c4e8]
mov dword [ecx], esi
add eax, 2
add ecx, 0x10
cmp eax, 0x100
jl 0x4ceee0
mov edx, dword [esp + 0x1b]
push edx
lea eax, [esp + 0x5c]
push 0x587a30
push eax
call fcn.004ce1b0
movzx edx, byte [esp + 0x23]
add esp, 0xc
xor eax, eax
lea ecx, [edi + 0x8ec]
movzx esi, byte [esp + eax + 0x58]
movzx esi, byte [esi + 0x587a30]
xor esi, edx
mov esi, dword [esi*4 + 0x58c8e8]
mov dword [ecx - 8], esi
movzx esi, byte [esp + eax + 0x59]
movzx esi, byte [esi + 0x587a30]
xor esi, edx
mov esi, dword [esi*4 + 0x58c8e8]
mov dword [ecx], esi
add eax, 2
add ecx, 0x10
cmp eax, 0x100
jl 0x4cef40
jmp 0x4ceba2