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

Disassembly:
sub esp, 0x240
mov eax, dword [0x5b0c20]
xor eax, esp
mov dword [esp + 0x23c], eax
push ebx
push ebp
mov ebp, dword [esp + 0x250]
push esi
push edi
mov dword [esp + 0x48], ebp
call fcn.004fa840
mov ebx, dword [esp + 0x254]
add ebp, 0xc
lea esi, [esp + 0x40]
xor edi, edi
mov ecx, dword [ebx + 4]
mov eax, dword [ebx]
push ecx
push eax
mov dword [esp + edi + 0x2c], eax
mov dword [esp + edi + 0x1c], ecx
call fcn.004fadb0
mov dword [ebp], eax
mov dword [esi], eax
add edi, 4
add esp, 8
add ebx, 8
sub ebp, 4
sub esi, 4
cmp edi, 0x10
jl 0x4faf58
mov esi, dword [esp + 0x48]
xor edx, edx
add esi, 0x14
lea edi, [edx + 0x14]
mov dword [esp + 0x10], edx
movzx ecx, byte [esp + 0x11]
mov cl, byte [ecx + 0x5a8708]
xor cl, byte [esp + 0x31]
movzx ebx, byte [esp + 0x12]
mov bl, byte [ebx + 0x5a8708]
xor bl, byte [esp + 0x32]
movzx ecx, cl
mov cl, byte [ecx + 0x5a8808]
xor cl, byte [esp + 0x2d]
mov byte [esp + 0x12], bl
movzx ebx, byte [esp + 0x13]
mov bl, byte [ebx + 0x5a8808]
xor bl, byte [esp + 0x33]
mov byte [esp + 0x11], cl
movzx ecx, byte [esp + 0x12]
mov cl, byte [ecx + 0x5a8708]
xor cl, byte [esp + 0x2e]
movzx eax, dl
mov al, byte [eax + 0x5a8808]
xor al, byte [esp + 0x30]
mov byte [esp + 0x12], cl
movzx eax, al
mov al, byte [eax + 0x5a8808]
xor al, byte [esp + 0x2c]
movzx ecx, bl
mov bl, byte [ecx + 0x5a8708]
movzx eax, al
movzx ecx, byte [eax + 0x5a8708]
movzx eax, byte [esp + 0x28]
xor ecx, eax
movzx ecx, byte [ecx + 0x5a8708]
movzx eax, byte [esp + 0x24]
xor ecx, eax
movzx eax, byte [esp + 0x11]
movzx ebp, byte [eax + 0x5a8808]
movzx eax, byte [esp + 0x29]
xor ebp, eax
movzx ebp, byte [ebp + 0x5a8708]
movzx eax, byte [esp + 0x25]
mov ecx, dword [ecx*4 + 0x6004b8]
xor ebp, eax
xor ecx, dword [ebp*4 + 0x6008b8]
movzx eax, byte [esp + 0x12]
movzx ebp, byte [eax + 0x5a8708]
movzx eax, byte [esp + 0x2a]
xor bl, byte [esp + 0x2f]
xor ebp, eax
movzx eax, byte [esp + 0x26]
movzx ebp, byte [ebp + 0x5a8808]
xor ebp, eax
movzx eax, bl
movzx ebx, byte [eax + 0x5a8808]
movzx eax, byte [esp + 0x2b]
xor ebx, eax
movzx eax, byte [esp + 0x27]
movzx ebx, byte [ebx + 0x5a8808]
xor ebx, eax
lea eax, [edx + 0x1010101]
mov dword [esp + 0x10], eax
movzx eax, al
mov al, byte [eax + 0x5a8808]
xor al, byte [esp + 0x20]
xor ecx, dword [ebp*4 + 0x600cb8]
mov byte [esp + 0x10], al
movzx eax, byte [esp + 0x11]
mov al, byte [eax + 0x5a8708]
xor al, byte [esp + 0x21]
xor ecx, dword [ebx*4 + 0x6010b8]
mov byte [esp + 0x11], al
movzx eax, byte [esp + 0x12]
mov al, byte [eax + 0x5a8708]
xor al, byte [esp + 0x22]
mov byte [esp + 0x12], al
movzx eax, byte [esp + 0x13]
mov al, byte [eax + 0x5a8808]
xor al, byte [esp + 0x23]
mov byte [esp + 0x13], al
movzx eax, byte [esp + 0x10]
mov al, byte [eax + 0x5a8808]
xor al, byte [esp + 0x1c]
mov byte [esp + 0x10], al
movzx eax, byte [esp + 0x11]
mov al, byte [eax + 0x5a8808]
xor al, byte [esp + 0x1d]
add esi, 8
mov byte [esp + 0x11], al
movzx eax, byte [esp + 0x12]
mov al, byte [eax + 0x5a8708]
xor al, byte [esp + 0x1e]
add edx, 0x2020202
mov byte [esp + 0x12], al
movzx eax, byte [esp + 0x13]
mov al, byte [eax + 0x5a8708]
xor al, byte [esp + 0x1f]
movzx eax, al
movzx ebx, byte [eax + 0x5a8808]
movzx eax, byte [esp + 0x1b]
xor ebx, eax
movzx ebx, byte [ebx + 0x5a8808]
movzx eax, byte [esp + 0x17]
xor ebx, eax
movzx eax, byte [esp + 0x10]
movzx ebp, byte [eax + 0x5a8708]
movzx eax, byte [esp + 0x18]
xor ebp, eax
movzx ebp, byte [ebp + 0x5a8708]
movzx eax, byte [esp + 0x14]
xor ebp, eax
mov eax, dword [ebx*4 + 0x6010b8]
xor eax, dword [ebp*4 + 0x6004b8]
movzx ebx, byte [esp + 0x11]
movzx ebp, byte [ebx + 0x5a8808]
movzx ebx, byte [esp + 0x19]
xor ebp, ebx
movzx ebp, byte [ebp + 0x5a8708]
movzx ebx, byte [esp + 0x15]
xor ebp, ebx
xor eax, dword [ebp*4 + 0x6008b8]
movzx ebx, byte [esp + 0x12]
movzx ebp, byte [ebx + 0x5a8708]
movzx ebx, byte [esp + 0x1a]
xor ebp, ebx
movzx ebp, byte [ebp + 0x5a8808]
movzx ebx, byte [esp + 0x16]
xor ebp, ebx
xor eax, dword [ebp*4 + 0x600cb8]
rol eax, 8
lea ebx, [eax + ecx]
lea ecx, [ecx + eax*2]
rol ecx, 9
sub edi, 1
mov dword [esi - 0xc], ebx
mov dword [esi - 8], ecx
jne 0x4faf91
mov edx, dword [esp + 0x40]
push edx
lea eax, [esp + 0x150]
push 0x5a8808
push eax
call fcn.00459440
add esp, 0xc
xor eax, eax
jmp 0x4fb230
movzx ecx, byte [esp + eax + 0x14c]
movzx edx, byte [ecx + 0x5a8808]
movzx ecx, byte [esp + eax + 0x14d]
mov byte [esp + eax + 0x4c], dl
movzx edx, byte [ecx + 0x5a8808]
mov byte [esp + eax + 0x4d], dl
add eax, 2
cmp eax, 0x100
jl 0x4fb230
mov eax, dword [esp + 0x3c]
push eax
lea ecx, [esp + 0x50]
push ecx
mov edx, ecx
push edx
call fcn.00459440
mov edi, dword [esp + 0x54]
movzx edx, byte [esp + 0x40]
movzx esi, byte [esp + 0x44]
add esp, 0xc
xor eax, eax
lea ecx, [edi + 0xb8]
jmp 0x4fb290
movzx ebx, byte [esp + eax + 0x4c]
movzx ebx, byte [ebx + 0x5a8708]
xor ebx, esi
movzx ebx, byte [ebx + 0x5a8708]
xor ebx, edx
mov ebx, dword [ebx*4 + 0x6004b8]
mov dword [ecx - 8], ebx
movzx ebx, byte [esp + eax + 0x4d]
movzx ebx, byte [ebx + 0x5a8708]
xor ebx, esi
movzx ebx, byte [ebx + 0x5a8708]
xor ebx, edx
mov ebx, dword [ebx*4 + 0x6004b8]
mov dword [ecx], ebx
add eax, 2
add ecx, 0x10
cmp eax, 0x100
jl 0x4fb290
mov eax, dword [esp + 0x41]
push eax
lea ecx, [esp + 0x150]
push 0x5a8708
push ecx
call fcn.00459440
add esp, 0xc
xor eax, eax
lea ebx, [ebx]
movzx edx, byte [esp + eax + 0x14c]
movzx ecx, byte [edx + 0x5a8808]
movzx edx, byte [esp + eax + 0x14d]
mov byte [esp + eax + 0x4c], cl
movzx ecx, byte [edx + 0x5a8808]
mov byte [esp + eax + 0x4d], cl
add eax, 2
cmp eax, 0x100
jl 0x4fb300
mov edx, dword [esp + 0x3d]
push edx
lea eax, [esp + 0x50]
push eax
mov ecx, eax
push ecx
call fcn.00459440
movzx edx, byte [esp + 0x41]
movzx esi, byte [esp + 0x45]
add esp, 0xc
xor eax, eax
lea ecx, [edi + 0xbc]
jmp 0x4fb360
movzx ebx, byte [esp + eax + 0x4c]
movzx ebx, byte [ebx + 0x5a8808]
xor ebx, esi
movzx ebx, byte [ebx + 0x5a8708]
xor ebx, edx
mov ebx, dword [ebx*4 + 0x6008b8]
mov dword [ecx - 8], ebx
movzx ebx, byte [esp + eax + 0x4d]
movzx ebx, byte [ebx + 0x5a8808]
xor ebx, esi
movzx ebx, byte [ebx + 0x5a8708]
xor ebx, edx
mov ebx, dword [ebx*4 + 0x6008b8]
mov dword [ecx], ebx
add eax, 2
add ecx, 0x10
cmp eax, 0x100
jl 0x4fb360
mov edx, dword [esp + 0x42]
push edx
lea eax, [esp + 0x150]
push 0x5a8708
push eax
call fcn.00459440
add esp, 0xc
xor eax, eax
lea ebx, [ebx]
movzx ecx, byte [esp + eax + 0x14c]
movzx edx, byte [ecx + 0x5a8708]
movzx ecx, byte [esp + eax + 0x14d]
mov byte [esp + eax + 0x4c], dl
movzx edx, byte [ecx + 0x5a8708]
mov byte [esp + eax + 0x4d], dl
add eax, 2
cmp eax, 0x100
jl 0x4fb3d0
mov eax, dword [esp + 0x3e]
push eax
lea ecx, [esp + 0x50]
push ecx
mov edx, ecx
push edx
call fcn.00459440
movzx edx, byte [esp + 0x42]
movzx esi, byte [esp + 0x46]
add esp, 0xc
xor eax, eax
lea ecx, [edi + 0x8b8]
jmp 0x4fb430
movzx ebx, byte [esp + eax + 0x4c]
movzx ebx, byte [ebx + 0x5a8708]
xor ebx, esi
movzx ebx, byte [ebx + 0x5a8808]
xor ebx, edx
mov ebx, dword [ebx*4 + 0x600cb8]
mov dword [ecx - 8], ebx
movzx ebx, byte [esp + eax + 0x4d]
movzx ebx, byte [ebx + 0x5a8708]
xor ebx, esi
movzx ebx, byte [ebx + 0x5a8808]
xor ebx, edx
mov ebx, dword [ebx*4 + 0x600cb8]
mov dword [ecx], ebx
add eax, 2
add ecx, 0x10
cmp eax, 0x100
jl 0x4fb430
mov eax, dword [esp + 0x43]
push eax
lea ecx, [esp + 0x150]
push 0x5a8808
push ecx
call fcn.00459440
add esp, 0xc
xor eax, eax
lea ebx, [ebx]
movzx edx, byte [esp + eax + 0x14c]
movzx ecx, byte [edx + 0x5a8708]
movzx edx, byte [esp + eax + 0x14d]
mov byte [esp + eax + 0x4c], cl
movzx ecx, byte [edx + 0x5a8708]
mov byte [esp + eax + 0x4d], cl
add eax, 2
cmp eax, 0x100
jl 0x4fb4a0
mov edx, dword [esp + 0x3f]
push edx
lea eax, [esp + 0x50]
push eax
mov ecx, eax
push ecx
call fcn.00459440
movzx edx, byte [esp + 0x43]
movzx esi, byte [esp + 0x47]
add esp, 0xc
xor eax, eax
lea ecx, [edi + 0x8bc]
jmp 0x4fb500
movzx edi, byte [esp + eax + 0x4c]
movzx edi, byte [edi + 0x5a8808]
xor edi, esi
movzx edi, byte [edi + 0x5a8808]
xor edi, edx
mov edi, dword [edi*4 + 0x6010b8]
mov dword [ecx - 8], edi
movzx edi, byte [esp + eax + 0x4d]
movzx edi, byte [edi + 0x5a8808]
xor edi, esi
movzx edi, byte [edi + 0x5a8808]
xor edi, edx
mov edi, dword [edi*4 + 0x6010b8]
mov dword [ecx], edi
add eax, 2
add ecx, 0x10
cmp eax, 0x100
jl 0x4fb500
mov ecx, dword [esp + 0x24c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
mov eax, 1
call fcn.00524d83
add esp, 0x240
ret