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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5c2308
mov eax, dword fs:[0]
push eax
sub esp, 0x60
mov eax, dword [0x68683c]
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 eax, dword [ebp + 0x10]
mov ebx, dword [ebp + 0x14]
mov edi, dword [ebp + 0xc]
push str.initCrypt_twofish
mov dword [ebp - 0x4c], ecx
push ebx
lea ecx, [ebp - 0x6c]
mov dword [ebp - 0x5c], edi
mov dword [ebp - 0x60], eax
call fcn.0045a1b0
mov eax, dword [edi + 0x10]
cdq
and edx, 7
lea esi, [edx + eax]
lea ecx, [edi + 0x14]
mov dword [ebp - 4], 0
sar esi, 3
call fcn.0041b6d0
lea ecx, [edi + 0x14]
mov dword [ebp - 0x50], eax
call fcn.004078c0
cmp eax, esi
jae 0x5977ca
mov edx, dword [ebx]
mov eax, dword [edx + 0x14]
push str.Not_enough_key_material_for_twofish.
mov ecx, ebx
call eax
lea ecx, [ebp - 0x6c]
mov dword [ebp - 4], 0xffffffff
call fcn.0045a240
xor al, al
jmp 0x597cba
mov eax, esi
cdq
and edx, 7
lea edi, [edx + eax]
sar edi, 3
mov dword [ebp - 0x54], edi
test esi, esi
jle 0x5977ee
mov ecx, dword [ebp - 0x50]
push esi
push ecx
lea edx, [ebp - 0x40]
push edx
call sub.MSVCR100.dll_memcpy
add esp, 0xc
test edi, edi
jle 0x59787b
lea esi, [ebp - 0x1e]
lea ecx, [ebp - 0x3a]
mov edx, edi
mov edi, edi
movzx eax, byte [ecx + 1]
mov eax, dword [eax*4 + 0x6534c8]
movzx ebx, byte [ecx - 1]
xor eax, dword [ebx*4 + 0x652cc8]
movzx ebx, byte [ecx - 2]
xor eax, dword [ebx*4 + 0x6528c8]
movzx ebx, byte [ecx - 3]
xor eax, dword [ebx*4 + 0x6524c8]
movzx ebx, byte [ecx - 4]
xor eax, dword [ebx*4 + 0x6520c8]
movzx ebx, byte [ecx - 5]
xor eax, dword [ebx*4 + 0x651cc8]
movzx ebx, byte [ecx - 6]
xor eax, dword [ebx*4 + 0x6518c8]
movzx ebx, byte [ecx]
xor eax, dword [ebx*4 + 0x6530c8]
add esi, 4
mov ebx, eax
shr ebx, 0x18
mov byte [esi - 3], bl
mov ebx, eax
shr ebx, 0x10
mov byte [esi - 4], bl
mov ebx, eax
shr ebx, 8
mov byte [esi - 5], bl
mov byte [esi - 6], al
add ecx, 8
dec edx
jne 0x597800
mov ecx, dword [ebp - 0x4c]
add ecx, 0x108c
mov dword [ebp - 0x58], 0
mov dword [ebp - 0x50], ecx
jmp 0x597893
mov edi, dword [ebp - 0x54]
mov bl, byte [ebp - 0x58]
add bl, bl
push edi
xor eax, eax
lea ecx, [ebp - 0x40]
lea esi, [ebp - 0x48]
lea edx, [ebp - 0x44]
mov byte [ebp - 0x44], bl
mov byte [ebp - 0x43], bl
mov byte [ebp - 0x42], bl
mov byte [ebp - 0x41], bl
call fcn.00597590
movzx edi, byte [ebp - 0x45]
movzx edx, byte [ebp - 0x46]
mov eax, dword [ebp - 0x48]
shl edi, 8
or edi, edx
movzx ecx, ah
shl edi, 8
movzx edx, al
mov eax, dword [ebp - 0x54]
or edi, ecx
inc bl
shl edi, 8
or edi, edx
push eax
mov eax, 1
lea ecx, [ebp - 0x40]
lea edx, [ebp - 0x44]
mov byte [ebp - 0x44], bl
mov byte [ebp - 0x43], bl
mov byte [ebp - 0x42], bl
mov byte [ebp - 0x41], bl
call fcn.00597590
movzx eax, byte [ebp - 0x45]
movzx ecx, byte [ebp - 0x46]
shl eax, 8
or eax, ecx
mov ecx, dword [ebp - 0x48]
shl eax, 8
movzx edx, ch
or eax, edx
shl eax, 8
movzx ecx, cl
or eax, ecx
mov ecx, dword [ebp - 0x50]
add esp, 8
rol eax, 8
lea edx, [eax + edi]
lea eax, [edi + eax*2]
rol eax, 9
mov dword [ecx], eax
mov eax, dword [ebp - 0x58]
inc eax
mov dword [ecx - 4], edx
add ecx, 8
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x50], ecx
cmp eax, 0x14
jl 0x597890
mov eax, dword [ebp - 0x54]
xor esi, esi
cmp eax, 2
jne 0x597a2b
mov eax, dword [ebp - 0x4c]
add eax, 0x488
lea ebx, [ebx]
movzx edi, byte [ebp - 0x20]
mov ecx, esi
and ecx, 0xff
mov dl, byte [ecx + 0x6506c8]
mov cl, byte [ecx + 0x6507c8]
movzx edx, dl
mov ebx, edx
xor ebx, edi
movzx ebx, byte [ebx + 0x6506c8]
movzx edi, byte [ebp - 0x1c]
xor ebx, edi
movzx edi, byte [ebx + 0x6507c8]
mov edi, dword [edi*4 + 0x6508c8]
mov dword [eax - 0x400], edi
movzx edi, byte [ebp - 0x1f]
movzx ecx, cl
mov ebx, ecx
xor ebx, edi
movzx ebx, byte [ebx + 0x6506c8]
movzx edi, byte [ebp - 0x1b]
xor ebx, edi
movzx edi, byte [ebx + 0x6506c8]
mov edi, dword [edi*4 + 0x650cc8]
mov dword [eax], edi
movzx edi, byte [ebp - 0x1e]
xor edi, edx
movzx edi, byte [edi + 0x6507c8]
movzx edx, byte [ebp - 0x1a]
xor edi, edx
movzx edx, byte [edi + 0x6507c8]
mov edx, dword [edx*4 + 0x6510c8]
mov dword [eax + 0x400], edx
movzx edx, byte [ebp - 0x1d]
xor edx, ecx
movzx edx, byte [edx + 0x6507c8]
movzx ecx, byte [ebp - 0x19]
xor edx, ecx
movzx ecx, byte [edx + 0x6506c8]
mov edx, dword [ecx*4 + 0x6514c8]
mov dword [eax + 0x800], edx
inc esi
add eax, 4
cmp esi, 0x100
jl 0x597960
jmp 0x597c6a
cmp eax, 3
mov eax, dword [ebp - 0x4c]
jne 0x597b3b
add eax, 0x488
lea esp, [esp]
movzx edi, byte [ebp - 0x20]
mov ecx, esi
and ecx, 0xff
mov dl, byte [ecx + 0x6506c8]
movzx ecx, byte [ecx + 0x6507c8]
mov ebx, ecx
xor ebx, edi
movzx ebx, byte [ebx + 0x6506c8]
movzx edi, byte [ebp - 0x1c]
xor ebx, edi
movzx ebx, byte [ebx + 0x6506c8]
movzx edi, byte [ebp - 0x18]
xor ebx, edi
movzx edi, byte [ebx + 0x6507c8]
mov edi, dword [edi*4 + 0x6508c8]
mov dword [eax - 0x400], edi
movzx edi, byte [ebp - 0x1f]
xor ecx, edi
movzx edi, byte [ecx + 0x6507c8]
movzx ecx, byte [ebp - 0x1b]
xor edi, ecx
movzx edi, byte [edi + 0x6506c8]
movzx ecx, byte [ebp - 0x17]
xor edi, ecx
movzx ecx, byte [edi + 0x6506c8]
mov ecx, dword [ecx*4 + 0x650cc8]
mov dword [eax], ecx
movzx ecx, dl
movzx edx, byte [ebp - 0x1e]
xor edx, ecx
movzx edi, byte [edx + 0x6506c8]
movzx edx, byte [ebp - 0x1a]
xor edi, edx
movzx edi, byte [edi + 0x6507c8]
movzx edx, byte [ebp - 0x16]
xor edi, edx
movzx edx, byte [edi + 0x6507c8]
mov edx, dword [edx*4 + 0x6510c8]
mov dword [eax + 0x400], edx
movzx edx, byte [ebp - 0x1d]
xor edx, ecx
movzx edx, byte [edx + 0x6507c8]
movzx ecx, byte [ebp - 0x19]
xor edx, ecx
movzx edx, byte [edx + 0x6507c8]
movzx ecx, byte [ebp - 0x15]
xor edx, ecx
movzx ecx, byte [edx + 0x6506c8]
mov edx, dword [ecx*4 + 0x6514c8]
mov dword [eax + 0x800], edx
inc esi
add eax, 4
cmp esi, 0x100
jl 0x597a40
jmp 0x597c6a
add eax, 0x488
movzx edi, byte [ebp - 0x20]
mov ecx, esi
and ecx, 0xff
mov dl, byte [ecx + 0x6506c8]
movzx ecx, byte [ecx + 0x6507c8]
mov ebx, ecx
xor ebx, edi
movzx ebx, byte [ebx + 0x6507c8]
movzx edi, byte [ebp - 0x1c]
xor ebx, edi
movzx ebx, byte [ebx + 0x6506c8]
movzx edi, byte [ebp - 0x18]
xor ebx, edi
movzx ebx, byte [ebx + 0x6506c8]
movzx edi, byte [ebp - 0x14]
xor ebx, edi
movzx edi, byte [ebx + 0x6507c8]
mov edi, dword [edi*4 + 0x6508c8]
mov dword [eax - 0x400], edi
movzx edi, byte [ebp - 0x1f]
movzx edx, dl
xor edi, edx
movzx ebx, byte [edi + 0x6507c8]
movzx edi, byte [ebp - 0x1b]
xor ebx, edi
movzx ebx, byte [ebx + 0x6507c8]
movzx edi, byte [ebp - 0x17]
xor ebx, edi
movzx ebx, byte [ebx + 0x6506c8]
movzx edi, byte [ebp - 0x13]
xor ebx, edi
movzx edi, byte [ebx + 0x6506c8]
mov edi, dword [edi*4 + 0x650cc8]
mov dword [eax], edi
movzx edi, byte [ebp - 0x1e]
xor edi, edx
movzx edi, byte [edi + 0x6506c8]
movzx edx, byte [ebp - 0x1a]
xor edi, edx
movzx edi, byte [edi + 0x6506c8]
movzx edx, byte [ebp - 0x16]
xor edi, edx
movzx edi, byte [edi + 0x6507c8]
movzx edx, byte [ebp - 0x12]
xor edi, edx
movzx edx, byte [edi + 0x6507c8]
mov edx, dword [edx*4 + 0x6510c8]
mov dword [eax + 0x400], edx
movzx edx, byte [ebp - 0x1d]
xor edx, ecx
movzx edx, byte [edx + 0x6506c8]
movzx ecx, byte [ebp - 0x19]
xor edx, ecx
movzx edx, byte [edx + 0x6507c8]
movzx ecx, byte [ebp - 0x15]
xor edx, ecx
movzx edx, byte [edx + 0x6507c8]
movzx ecx, byte [ebp - 0x11]
xor edx, ecx
movzx ecx, byte [edx + 0x6506c8]
mov edx, dword [ecx*4 + 0x6514c8]
mov dword [eax + 0x800], edx
inc esi
add eax, 4
cmp esi, 0x100
jl 0x597b40
mov edi, dword [ebp - 0x60]
test edi, edi
je 0x597ca9
mov ecx, dword [ebp - 0x5c]
mov eax, dword [ecx + 8]
cmp eax, 3
je 0x597c81
cmp eax, 4
jne 0x597ca9
mov eax, dword [ebp - 0x4c]
lea esi, [ecx + 0x34]
mov ecx, dword [eax + 0x80]
push ecx
mov ecx, esi
call fcn.004078c0
push eax
mov ecx, esi
call fcn.0041b6d0
push eax
lea ecx, [edi + 0x484]
call fcn.005351f0
lea ecx, [ebp - 0x6c]
mov dword [ebp - 4], 0xffffffff
call fcn.0045a240
mov al, 1
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.005a6cf8
mov esp, ebp
pop ebp
ret 0x10