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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5cc1ad
mov eax, dword fs:[0]
push eax
sub esp, 0x5c
mov eax, dword [0x68cc00]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x5c], ecx
mov eax, dword [ebp + 0x10]
lea ecx, [ebp - 0x50]
mov edi, dword [ebp + 0x14]
xorps xmm0, xmm0
mov esi, dword [ebp + 0xc]
push 0x659f00
push edi
mov dword [ebp - 0x68], esi
mov dword [ebp - 0x64], eax
movq qword [ebp - 0x50], xmm0
mov dword [ebp - 0x48], 0
call fcn.00447f50
mov eax, dword [esi + 0x10]
lea ecx, [esi + 0x14]
cdq
and edx, 7
mov dword [ebp - 4], 0
lea ebx, [edx + eax]
sar ebx, 3
call fcn.00438c00
lea ecx, [esi + 0x14]
mov dword [ebp - 0x54], eax
call fcn.00402f80
cmp eax, ebx
jae 0x597958
mov eax, dword [edi]
mov ecx, edi
push str.Not_enough_key_material_for_twofish.
call dword [eax + 0x14]
xor bl, bl
jmp 0x597e85
mov eax, ebx
cdq
and edx, 7
lea edi, [edx + eax]
sar edi, 3
mov dword [ebp - 0x60], edi
test ebx, ebx
jle 0x59797b
push ebx
push dword [ebp - 0x54]
lea eax, [ebp - 0x40]
push eax
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
test edi, edi
jle 0x597a11
lea esi, [ebp - 0x1e]
lea eax, [ebp - 0x3a]
nop dword [eax]
movzx ecx, byte [eax + 1]
lea esi, [esi + 4]
movzx edx, byte [eax - 1]
lea eax, [eax + 8]
mov ebx, dword [ecx*4 + 0x659b00]
xor ebx, dword [edx*4 + 0x659300]
movzx ecx, byte [eax - 0xa]
xor ebx, dword [ecx*4 + 0x658f00]
movzx ecx, byte [eax - 0xb]
xor ebx, dword [ecx*4 + 0x658b00]
movzx ecx, byte [eax - 0xc]
xor ebx, dword [ecx*4 + 0x658700]
movzx ecx, byte [eax - 0xd]
xor ebx, dword [ecx*4 + 0x658300]
movzx ecx, byte [eax - 0xe]
xor ebx, dword [ecx*4 + 0x657f00]
movzx ecx, byte [eax - 8]
xor ebx, dword [ecx*4 + 0x659700]
mov ecx, ebx
mov byte [esi - 6], bl
shr ecx, 0x18
mov byte [esi - 3], cl
mov ecx, ebx
shr ecx, 0x10
mov byte [esi - 4], cl
mov ecx, ebx
shr ecx, 8
mov byte [esi - 5], cl
sub edi, 1
jne 0x597990
mov edi, dword [ebp - 0x60]
mov eax, dword [ebp - 0x5c]
add eax, 0x108c
xor ebx, ebx
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x54], ebx
push 0
push edi
lea eax, [ebp - 0x40]
add bl, bl
push eax
lea eax, [ebp - 0x58]
mov byte [ebp - 0x44], bl
push eax
lea eax, [ebp - 0x44]
mov byte [ebp - 0x43], bl
push eax
mov byte [ebp - 0x42], bl
mov byte [ebp - 0x41], bl
call fcn.005983e0
movzx esi, byte [ebp - 0x55]
inc bl
movzx eax, byte [ebp - 0x56]
shl esi, 8
or esi, eax
mov byte [ebp - 0x44], bl
mov eax, dword [ebp - 0x58]
movzx ecx, ah
shl esi, 8
or esi, ecx
movzx eax, al
push 1
shl esi, 8
or esi, eax
mov byte [ebp - 0x43], bl
push edi
lea eax, [ebp - 0x40]
mov byte [ebp - 0x42], bl
push eax
lea eax, [ebp - 0x58]
mov byte [ebp - 0x41], bl
push eax
lea eax, [ebp - 0x44]
push eax
call fcn.005983e0
movzx edx, byte [ebp - 0x55]
add esp, 0x28
movzx eax, byte [ebp - 0x56]
mov ebx, dword [ebp - 0x54]
shl edx, 8
inc ebx
or edx, eax
mov dword [ebp - 0x54], ebx
mov eax, dword [ebp - 0x58]
movzx ecx, ah
shl edx, 8
or edx, ecx
movzx eax, al
mov ecx, dword [ebp - 0x60]
shl edx, 8
or edx, eax
rol edx, 8
lea eax, [edx + esi]
mov dword [ecx - 4], eax
lea eax, [esi + edx*2]
rol eax, 9
mov dword [ecx], eax
add ecx, 8
mov dword [ebp - 0x60], ecx
cmp ebx, 0x14
jl 0x597a21
xor eax, eax
mov dword [ebp - 0x54], eax
cmp edi, 2
jne 0x597bcb
mov edi, dword [ebp - 0x5c]
mov dh, byte [ebp - 0x20]
lea esi, [edi + 0x488]
nop dword [eax]
movzx eax, al
lea esi, [esi + 4]
movzx ecx, dh
mov dl, byte [eax + 0x656d00]
mov bl, byte [eax + 0x656e00]
movzx eax, dl
xor ecx, eax
mov eax, dword [ebp - 0x1c]
movzx eax, al
movzx ecx, byte [ecx + 0x656d00]
xor ecx, eax
movzx eax, byte [ecx + 0x656e00]
mov eax, dword [eax*4 + 0x656f00]
mov dword [esi - 0x404], eax
mov eax, dword [ebp - 0x1f]
movzx ecx, al
movzx eax, bl
xor ecx, eax
mov eax, dword [ebp - 0x1b]
movzx eax, al
movzx ecx, byte [ecx + 0x656d00]
xor ecx, eax
movzx eax, byte [ecx + 0x656d00]
mov eax, dword [eax*4 + 0x657300]
mov dword [esi - 4], eax
mov eax, dword [ebp - 0x1e]
movzx ecx, al
movzx eax, dl
xor ecx, eax
mov eax, dword [ebp - 0x1a]
movzx eax, al
movzx ecx, byte [ecx + 0x656e00]
xor ecx, eax
movzx eax, byte [ecx + 0x656e00]
mov eax, dword [eax*4 + 0x657700]
mov dword [esi + 0x3fc], eax
mov eax, dword [ebp - 0x1d]
movzx ecx, al
movzx eax, bl
xor ecx, eax
mov eax, dword [ebp - 0x19]
movzx eax, al
movzx ecx, byte [ecx + 0x656e00]
xor ecx, eax
movzx eax, byte [ecx + 0x656d00]
mov eax, dword [eax*4 + 0x657b00]
mov dword [esi + 0x7fc], eax
mov eax, dword [ebp - 0x54]
inc eax
mov dword [ebp - 0x54], eax
cmp eax, 0x100
jl 0x597af0
jmp 0x597e49
cmp edi, 3
mov edi, dword [ebp - 0x5c]
lea esi, [edi + 0x488]
jne 0x597cf7
mov dh, byte [ebp - 0x20]
movzx eax, al
lea esi, [esi + 4]
movzx ecx, dh
mov dl, byte [eax + 0x656e00]
mov bl, byte [eax + 0x656d00]
movzx eax, dl
xor ecx, eax
mov eax, dword [ebp - 0x1c]
movzx eax, al
movzx ecx, byte [ecx + 0x656d00]
xor ecx, eax
mov eax, dword [ebp - 0x18]
movzx eax, al
movzx ecx, byte [ecx + 0x656d00]
xor ecx, eax
movzx eax, byte [ecx + 0x656e00]
mov eax, dword [eax*4 + 0x656f00]
mov dword [esi - 0x404], eax
mov eax, dword [ebp - 0x1f]
movzx ecx, al
movzx eax, dl
xor ecx, eax
mov eax, dword [ebp - 0x1b]
movzx eax, al
movzx ecx, byte [ecx + 0x656e00]
xor ecx, eax
mov eax, dword [ebp - 0x17]
movzx eax, al
movzx ecx, byte [ecx + 0x656d00]
xor ecx, eax
movzx eax, byte [ecx + 0x656d00]
mov eax, dword [eax*4 + 0x657300]
mov dword [esi - 4], eax
mov eax, dword [ebp - 0x1e]
movzx ecx, al
movzx eax, bl
xor ecx, eax
mov eax, dword [ebp - 0x1a]
movzx eax, al
movzx ecx, byte [ecx + 0x656d00]
xor ecx, eax
mov eax, dword [ebp - 0x16]
movzx eax, al
movzx ecx, byte [ecx + 0x656e00]
xor ecx, eax
movzx eax, byte [ecx + 0x656e00]
mov eax, dword [eax*4 + 0x657700]
mov dword [esi + 0x3fc], eax
mov eax, dword [ebp - 0x1d]
movzx ecx, al
movzx eax, bl
xor ecx, eax
mov eax, dword [ebp - 0x19]
movzx eax, al
movzx ecx, byte [ecx + 0x656e00]
xor ecx, eax
mov eax, dword [ebp - 0x15]
movzx eax, al
movzx ecx, byte [ecx + 0x656e00]
xor ecx, eax
movzx eax, byte [ecx + 0x656d00]
mov eax, dword [eax*4 + 0x657b00]
mov dword [esi + 0x7fc], eax
mov eax, dword [ebp - 0x54]
inc eax
mov dword [ebp - 0x54], eax
cmp eax, 0x100
jl 0x597be0
jmp 0x597e49
mov dh, byte [ebp - 0x11]
mov bh, byte [ebp - 0x12]
nop dword [eax]
movzx eax, al
lea esi, [esi + 4]
movzx ecx, byte [ebp - 0x20]
mov bl, byte [eax + 0x656e00]
mov dl, byte [eax + 0x656d00]
movzx eax, bl
xor ecx, eax
mov eax, dword [ebp - 0x1c]
movzx eax, al
movzx ecx, byte [ecx + 0x656e00]
xor ecx, eax
mov eax, dword [ebp - 0x18]
movzx eax, al
movzx ecx, byte [ecx + 0x656d00]
xor ecx, eax
mov eax, dword [ebp - 0x14]
movzx eax, al
movzx ecx, byte [ecx + 0x656d00]
xor ecx, eax
movzx eax, byte [ecx + 0x656e00]
mov eax, dword [eax*4 + 0x656f00]
mov dword [esi - 0x404], eax
mov eax, dword [ebp - 0x1f]
movzx ecx, al
movzx eax, dl
xor ecx, eax
mov eax, dword [ebp - 0x1b]
movzx eax, al
movzx ecx, byte [ecx + 0x656e00]
xor ecx, eax
mov eax, dword [ebp - 0x17]
movzx eax, al
movzx ecx, byte [ecx + 0x656e00]
xor ecx, eax
mov eax, dword [ebp - 0x14]
movzx eax, ah
movzx ecx, byte [ecx + 0x656d00]
xor ecx, eax
movzx eax, byte [ecx + 0x656d00]
mov eax, dword [eax*4 + 0x657300]
mov dword [esi - 4], eax
mov eax, dword [ebp - 0x1e]
movzx ecx, al
movzx eax, dl
xor ecx, eax
mov eax, dword [ebp - 0x1a]
movzx eax, al
movzx ecx, byte [ecx + 0x656d00]
xor ecx, eax
mov eax, dword [ebp - 0x16]
movzx eax, al
movzx ecx, byte [ecx + 0x656d00]
xor ecx, eax
movzx eax, bh
movzx ecx, byte [ecx + 0x656e00]
xor ecx, eax
movzx eax, byte [ecx + 0x656e00]
mov eax, dword [eax*4 + 0x657700]
mov dword [esi + 0x3fc], eax
mov eax, dword [ebp - 0x1d]
movzx ecx, al
movzx eax, bl
xor ecx, eax
mov eax, dword [ebp - 0x19]
movzx eax, al
movzx ecx, byte [ecx + 0x656d00]
xor ecx, eax
mov eax, dword [ebp - 0x15]
movzx eax, al
movzx ecx, byte [ecx + 0x656e00]
xor ecx, eax
movzx eax, dh
movzx ecx, byte [ecx + 0x656e00]
xor ecx, eax
movzx eax, byte [ecx + 0x656d00]
mov eax, dword [eax*4 + 0x657b00]
mov dword [esi + 0x7fc], eax
mov eax, dword [ebp - 0x54]
inc eax
mov dword [ebp - 0x54], eax
cmp eax, 0x100
jl 0x597d00
mov ebx, dword [ebp - 0x64]
test ebx, ebx
je 0x597e83
mov esi, dword [ebp - 0x68]
mov eax, dword [esi + 8]
cmp eax, 3
je 0x597e60
cmp eax, 4
jne 0x597e83
push dword [edi + 0x80]
lea ecx, [esi + 0x34]
call fcn.00402f80
push eax
lea ecx, [esi + 0x34]
call fcn.00438c00
push eax
lea ecx, [ebx + 0x484]
call fcn.00593cb0
mov bl, 1
lea ecx, [ebp - 0x50]
call fcn.00448050
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.005af618
mov esp, ebp
pop ebp
ret 0x10