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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x250
push ebx
push esi
push edi
xor edi, edi
xor esi, esi
cmp dword [0x5cb024], edi
je 0x50a543
call fcn.0050a0c6
mov ebx, dword [ebp + 8]
push 0x40
pop ecx
and dword [ebp - 4], 0
mov eax, dword [ebx + 0x50]
lea eax, [eax + eax + 8]
mov dword [ebp - 0x4c], eax
mov eax, dword [ebx + 4]
mov dword [ebp - 0x50], eax
add eax, 0x3f
cdq
idiv ecx
mov ecx, eax
test ecx, ecx
mov dword [ebp - 0x28], ecx
jle 0x50a5c5
lea eax, [ebp + ecx*4 - 0x1c]
lea edx, [ebx + 0x58]
mov dword [ebp - 0x24], eax
lea eax, [ebx + ecx*4 + 0x70]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x20], edx
jmp 0x50a585
mov edx, dword [ebp - 0x20]
mov ecx, dword [edx - 4]
mov eax, dword [ebp - 4]
mov edx, dword [edx]
shl eax, 2
push edx
push ecx
mov dword [ebp + eax - 0x38], ecx
mov dword [ebp + eax - 0x48], edx
call fcn.0050a046
pop ecx
inc dword [ebp - 4]
pop ecx
add dword [ebp - 0x20], 8
mov ecx, dword [ebp - 0x1c]
sub dword [ebp - 0x1c], 4
mov dword [ecx], eax
mov ecx, dword [ebp - 0x24]
sub dword [ebp - 0x24], 4
mov dword [ecx], eax
mov eax, dword [ebp - 4]
cmp eax, dword [ebp - 0x28]
jl 0x50a582
mov ecx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x4c]
and dword [ebp - 0x20], 0
cdq
sub eax, edx
sar eax, 1
test eax, eax
jle 0x50a875
mov dword [ebp - 0x1c], ecx
lea ecx, [ebx + 0x88]
and dword [ebp - 0x1c], 3
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x20]
sub eax, 0
mov dword [ebp - 4], ecx
je 0x50a606
dec eax
dec eax
je 0x50a67d
dec eax
je 0x50a63e
jmp 0x50a717
movzx eax, cl
mov dl, byte [eax + 0x5caf24]
movzx eax, byte [ebp - 3]
xor dl, byte [ebp - 0x2c]
mov al, byte [eax + 0x5cae24]
xor al, byte [ebp - 0x2b]
mov byte [ebp - 3], al
movzx eax, byte [ebp - 2]
mov cl, byte [eax + 0x5cae24]
movzx eax, byte [ebp - 1]
xor cl, byte [ebp - 0x2a]
mov al, byte [eax + 0x5caf24]
xor al, byte [ebp - 0x29]
jmp 0x50a647
mov al, byte [ebp - 1]
mov cl, byte [ebp - 2]
mov dl, byte [ebp - 4]
movzx edx, dl
movzx ecx, cl
mov dl, byte [edx + 0x5caf24]
xor dl, byte [ebp - 0x30]
mov cl, byte [ecx + 0x5cae24]
xor cl, byte [ebp - 0x2e]
mov byte [ebp - 4], dl
movzx edx, byte [ebp - 3]
movzx eax, al
mov dl, byte [edx + 0x5caf24]
mov al, byte [eax + 0x5cae24]
xor dl, byte [ebp - 0x2f]
xor al, byte [ebp - 0x2d]
jmp 0x50a686
mov al, byte [ebp - 1]
mov cl, byte [ebp - 2]
mov dl, byte [ebp - 3]
movzx esi, byte [ebp - 0x31]
movzx eax, al
movzx ecx, cl
movzx eax, byte [eax + 0x5caf24]
xor eax, esi
movzx esi, byte [ebp - 0x35]
movzx eax, byte [eax + 0x5caf24]
movzx ecx, byte [ecx + 0x5cae24]
xor eax, esi
movzx esi, byte [ebp - 0x32]
xor ecx, esi
movzx esi, byte [ebp - 0x36]
movzx ecx, byte [ecx + 0x5caf24]
xor ecx, esi
mov esi, dword [eax*4 + 0x650140]
movzx eax, dl
xor esi, dword [ecx*4 + 0x64fd40]
movzx eax, byte [eax + 0x5caf24]
movzx ecx, byte [ebp - 0x33]
xor eax, ecx
movzx ecx, byte [ebp - 0x37]
movzx eax, byte [eax + 0x5cae24]
xor eax, ecx
movzx ecx, byte [ebp - 0x34]
xor esi, dword [eax*4 + 0x64f940]
movzx eax, byte [ebp - 4]
movzx eax, byte [eax + 0x5cae24]
xor eax, ecx
movzx ecx, byte [ebp - 0x38]
movzx eax, byte [eax + 0x5cae24]
xor eax, ecx
xor esi, dword [eax*4 + 0x64f540]
mov eax, dword [ebp - 0x20]
add eax, 0x1010101
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0x1c]
sub eax, 0
je 0x50a736
dec eax
dec eax
je 0x50a7aa
dec eax
je 0x50a76c
jmp 0x50a849
movzx eax, byte [ebp - 4]
mov bl, byte [eax + 0x5caf24]
movzx eax, byte [ebp - 3]
xor bl, byte [ebp - 0x3c]
mov dl, byte [eax + 0x5cae24]
movzx eax, byte [ebp - 2]
xor dl, byte [ebp - 0x3b]
mov cl, byte [eax + 0x5cae24]
movzx eax, byte [ebp - 1]
xor cl, byte [ebp - 0x3a]
mov al, byte [eax + 0x5caf24]
xor al, byte [ebp - 0x39]
jmp 0x50a778
mov al, byte [ebp - 1]
mov cl, byte [ebp - 2]
mov dl, byte [ebp - 3]
mov bl, byte [ebp - 4]
movzx edi, bl
movzx edx, dl
mov bl, byte [edi + 0x5caf24]
mov dl, byte [edx + 0x5caf24]
xor bl, byte [ebp - 0x40]
xor dl, byte [ebp - 0x3f]
movzx ecx, cl
movzx eax, al
mov cl, byte [ecx + 0x5cae24]
mov al, byte [eax + 0x5cae24]
xor cl, byte [ebp - 0x3e]
xor al, byte [ebp - 0x3d]
jmp 0x50a7b6
mov al, byte [ebp - 1]
mov cl, byte [ebp - 2]
mov dl, byte [ebp - 3]
mov bl, byte [ebp - 4]
movzx edi, byte [ebp - 0x41]
movzx eax, al
movzx ecx, cl
movzx eax, byte [eax + 0x5caf24]
xor eax, edi
movzx edi, byte [ebp - 0x45]
movzx eax, byte [eax + 0x5caf24]
movzx ecx, byte [ecx + 0x5cae24]
xor eax, edi
movzx edi, byte [ebp - 0x42]
xor ecx, edi
movzx edi, byte [ebp - 0x46]
movzx ecx, byte [ecx + 0x5caf24]
xor ecx, edi
mov edi, dword [eax*4 + 0x650140]
movzx eax, dl
xor edi, dword [ecx*4 + 0x64fd40]
movzx eax, byte [eax + 0x5caf24]
movzx ecx, byte [ebp - 0x43]
xor eax, ecx
movzx ecx, byte [ebp - 0x47]
movzx eax, byte [eax + 0x5cae24]
xor eax, ecx
movzx ecx, byte [ebp - 0x44]
xor edi, dword [eax*4 + 0x64f940]
movzx eax, bl
mov ebx, dword [ebp + 8]
movzx eax, byte [eax + 0x5cae24]
xor eax, ecx
movzx ecx, byte [ebp - 0x48]
movzx eax, byte [eax + 0x5cae24]
xor eax, ecx
xor edi, dword [eax*4 + 0x64f540]
mov eax, dword [ebp - 0x28]
add dword [ebp - 0x20], 0x2020202
rol edi, 8
lea ecx, [edi + esi]
lea edi, [esi + edi*2]
mov dword [eax - 4], ecx
mov ecx, edi
rol ecx, 9
mov dword [eax], ecx
add eax, 8
dec dword [ebp - 0x24]
mov dword [ebp - 0x28], eax
jne 0x50a5ec
mov eax, dword [ebp - 0x50]
sub eax, 0x80
je 0x50ade5
sub eax, 0x40
je 0x50abcf
sub eax, 0x40
jne 0x50af81
push dword [ebp - 0xc]
lea eax, [ebp - 0x250]
push 0x5caf24
push eax
call fcn.0050a252
add esp, 0xc
xor eax, eax
mov esi, 0x100
movzx ecx, byte [ebp + eax - 0x250]
inc eax
mov cl, byte [ecx + 0x5caf24]
mov byte [ebp + eax - 0x151], cl
movzx ecx, byte [ebp + eax - 0x250]
inc eax
mov cl, byte [ecx + 0x5caf24]
cmp eax, esi
mov byte [ebp + eax - 0x151], cl
jl 0x50a8b3
push dword [ebp - 0x10]
lea eax, [ebp - 0x150]
push eax
lea eax, [ebp - 0x150]
push eax
call fcn.0050a252
add esp, 0xc
xor ecx, ecx
lea eax, [ebx + 0x12c]
movzx edx, byte [ebp + ecx - 0x150]
movzx edi, byte [edx + 0x5cae24]
movzx edx, byte [ebp - 0x14]
xor edi, edx
movzx edx, byte [ebp - 0x18]
movzx edi, byte [edi + 0x5cae24]
xor edi, edx
mov edx, dword [edi*4 + 0x64f540]
mov dword [eax - 8], edx
movzx edx, byte [ebp + ecx - 0x14f]
movzx edi, byte [edx + 0x5cae24]
movzx edx, byte [ebp - 0x14]
xor edi, edx
movzx edx, byte [ebp - 0x18]
movzx edi, byte [edi + 0x5cae24]
xor edi, edx
inc ecx
inc ecx
mov edx, dword [edi*4 + 0x64f540]
mov dword [eax], edx
add eax, 0x10
cmp ecx, esi
jl 0x50a904
push dword [ebp - 0xb]
mov edi, 0x5cae24
lea eax, [ebp - 0x250]
push edi
push eax
call fcn.0050a252
add esp, 0xc
xor eax, eax
movzx ecx, byte [ebp + eax - 0x250]
inc eax
mov cl, byte [ecx + 0x5caf24]
mov byte [ebp + eax - 0x151], cl
movzx ecx, byte [ebp + eax - 0x250]
inc eax
mov cl, byte [ecx + 0x5caf24]
cmp eax, esi
mov byte [ebp + eax - 0x151], cl
jl 0x50a97e
push dword [ebp - 0xf]
lea eax, [ebp - 0x150]
push eax
lea eax, [ebp - 0x150]
push eax
call fcn.0050a252
add esp, 0xc
and dword [ebp - 4], 0
lea eax, [ebx + 0x130]
mov ecx, dword [ebp - 4]
movzx ecx, byte [ebp + ecx - 0x150]
movzx edx, byte [ecx + 0x5caf24]
movzx ecx, byte [ebp - 0x13]
xor edx, ecx
movzx ecx, byte [ebp - 0x17]
movzx edx, byte [edx + 0x5cae24]
xor edx, ecx
mov ecx, dword [edx*4 + 0x64f940]
mov dword [eax - 8], ecx
mov ecx, dword [ebp - 4]
add dword [ebp - 4], 2
movzx ecx, byte [ebp + ecx - 0x14f]
movzx edx, byte [ecx + 0x5caf24]
movzx ecx, byte [ebp - 0x13]
xor edx, ecx
movzx ecx, byte [ebp - 0x17]
movzx edx, byte [edx + 0x5cae24]
xor edx, ecx
mov ecx, dword [edx*4 + 0x64f940]
mov dword [eax], ecx
add eax, 0x10
cmp dword [ebp - 4], esi
jl 0x50a9d1
push dword [ebp - 0xa]
lea eax, [ebp - 0x250]
push edi
push eax
call fcn.0050a252
add esp, 0xc
xor eax, eax
movzx ecx, byte [ebp + eax - 0x250]
inc eax
mov cl, byte [ecx + 0x5cae24]
mov byte [ebp + eax - 0x151], cl
movzx ecx, byte [ebp + eax - 0x250]
inc eax
mov cl, byte [ecx + 0x5cae24]
cmp eax, esi
mov byte [ebp + eax - 0x151], cl
jl 0x50aa4f
push dword [ebp - 0xe]
lea eax, [ebp - 0x150]
push eax
lea eax, [ebp - 0x150]
push eax
call fcn.0050a252
add esp, 0xc
xor ecx, ecx
lea eax, [ebx + 0x92c]
movzx edx, byte [ebp + ecx - 0x150]
movzx edi, byte [edx + 0x5cae24]
movzx edx, byte [ebp - 0x12]
xor edi, edx
movzx edx, byte [ebp - 0x16]
movzx edi, byte [edi + 0x5caf24]
xor edi, edx
mov edx, dword [edi*4 + 0x64fd40]
mov dword [eax - 8], edx
movzx edx, byte [ebp + ecx - 0x14f]
movzx edi, byte [edx + 0x5cae24]
movzx edx, byte [ebp - 0x12]
xor edi, edx
movzx edx, byte [ebp - 0x16]
movzx edi, byte [edi + 0x5caf24]
xor edi, edx
inc ecx
inc ecx
mov edx, dword [edi*4 + 0x64fd40]
mov dword [eax], edx
add eax, 0x10
cmp ecx, esi
jl 0x50aaa0
push dword [ebp - 9]
lea eax, [ebp - 0x250]
push 0x5caf24
push eax
call fcn.0050a252
add esp, 0xc
xor eax, eax
movzx ecx, byte [ebp + eax - 0x250]
inc eax
mov cl, byte [ecx + 0x5cae24]
mov byte [ebp + eax - 0x151], cl
movzx ecx, byte [ebp + eax - 0x250]
inc eax
mov cl, byte [ecx + 0x5cae24]
cmp eax, esi
mov byte [ebp + eax - 0x151], cl
jl 0x50ab19
push dword [ebp - 0xd]
lea eax, [ebp - 0x150]
push eax
lea eax, [ebp - 0x150]
push eax
call fcn.0050a252
add esp, 0xc
xor ecx, ecx
lea eax, [ebx + 0x930]
movzx edx, byte [ebp + ecx - 0x150]
movzx edi, byte [edx + 0x5caf24]
movzx edx, byte [ebp - 0x11]
xor edi, edx
movzx edx, byte [ebp - 0x15]
movzx edi, byte [edi + 0x5caf24]
xor edi, edx
mov edx, dword [edi*4 + 0x650140]
mov dword [eax - 8], edx
movzx edx, byte [ebp + ecx - 0x14f]
movzx edi, byte [edx + 0x5caf24]
movzx edx, byte [ebp - 0x11]
xor edi, edx
movzx edx, byte [ebp - 0x15]
movzx edi, byte [edi + 0x5caf24]
xor edi, edx
inc ecx
inc ecx
mov edx, dword [edi*4 + 0x650140]
mov dword [eax], edx
add eax, 0x10
cmp ecx, esi
jl 0x50ab6a
jmp 0x50af81
push dword [ebp - 0x10]
mov edi, 0x5caf24
lea eax, [ebp - 0x150]
push edi
push eax
call fcn.0050a252
add esp, 0xc
and dword [ebp - 4], 0
lea eax, [ebx + 0x12c]
mov esi, 0x100
mov ecx, dword [ebp - 4]
movzx ecx, byte [ebp + ecx - 0x150]
movzx edx, byte [ecx + 0x5cae24]
movzx ecx, byte [ebp - 0x14]
xor edx, ecx
movzx ecx, byte [ebp - 0x18]
movzx edx, byte [edx + 0x5cae24]
xor edx, ecx
mov ecx, dword [edx*4 + 0x64f540]
mov dword [eax - 8], ecx
mov ecx, dword [ebp - 4]
add dword [ebp - 4], 2
movzx ecx, byte [ebp + ecx - 0x14f]
movzx edx, byte [ecx + 0x5cae24]
movzx ecx, byte [ebp - 0x14]
xor edx, ecx
movzx ecx, byte [ebp - 0x18]
movzx edx, byte [edx + 0x5cae24]
xor edx, ecx
mov ecx, dword [edx*4 + 0x64f540]
mov dword [eax], ecx
add eax, 0x10
cmp dword [ebp - 4], esi
jl 0x50abf6
push dword [ebp - 0xf]
lea eax, [ebp - 0x150]
push edi
push eax
call fcn.0050a252
add esp, 0xc
xor ecx, ecx
lea eax, [ebx + 0x130]
movzx edx, byte [ebp + ecx - 0x150]
movzx edi, byte [edx + 0x5caf24]
movzx edx, byte [ebp - 0x13]
xor edi, edx
movzx edx, byte [ebp - 0x17]
movzx edi, byte [edi + 0x5cae24]
xor edi, edx
mov edx, dword [edi*4 + 0x64f940]
mov dword [eax - 8], edx
movzx edx, byte [ebp + ecx - 0x14f]
movzx edi, byte [edx + 0x5caf24]
movzx edx, byte [ebp - 0x13]
xor edi, edx
movzx edx, byte [ebp - 0x17]
movzx edi, byte [edi + 0x5cae24]
xor edi, edx
inc ecx
inc ecx
mov edx, dword [edi*4 + 0x64f940]
mov dword [eax], edx
add eax, 0x10
cmp ecx, esi
jl 0x50ac7a
push dword [ebp - 0xe]
mov edi, 0x5cae24
lea eax, [ebp - 0x150]
push edi
push eax
call fcn.0050a252
add esp, 0xc
and dword [ebp - 4], 0
lea eax, [ebx + 0x92c]
mov ecx, dword [ebp - 4]
movzx ecx, byte [ebp + ecx - 0x150]
movzx edx, byte [ecx + 0x5cae24]
movzx ecx, byte [ebp - 0x12]
xor edx, ecx
movzx ecx, byte [ebp - 0x16]
movzx edx, byte [edx + 0x5caf24]
xor edx, ecx
mov ecx, dword [edx*4 + 0x64fd40]
mov dword [eax - 8], ecx
mov ecx, dword [ebp - 4]
add dword [ebp - 4], 2
movzx ecx, byte [ebp + ecx - 0x14f]
movzx edx, byte [ecx + 0x5cae24]
movzx ecx, byte [ebp - 0x12]
xor edx, ecx
movzx ecx, byte [ebp - 0x16]
movzx edx, byte [edx + 0x5caf24]
xor edx, ecx
mov ecx, dword [edx*4 + 0x64fd40]
mov dword [eax], ecx
add eax, 0x10
cmp dword [ebp - 4], esi
jl 0x50acfc
push dword [ebp - 0xd]
lea eax, [ebp - 0x150]
push edi
push eax
call fcn.0050a252
add esp, 0xc
xor ecx, ecx
lea eax, [ebx + 0x930]
movzx edx, byte [ebp + ecx - 0x150]
movzx edi, byte [edx + 0x5caf24]
movzx edx, byte [ebp - 0x11]
xor edi, edx
movzx edx, byte [ebp - 0x15]
movzx edi, byte [edi + 0x5caf24]
xor edi, edx
mov edx, dword [edi*4 + 0x650140]
mov dword [eax - 8], edx
movzx edx, byte [ebp + ecx - 0x14f]
movzx edi, byte [edx + 0x5caf24]
movzx edx, byte [ebp - 0x11]
xor edi, edx
movzx edx, byte [ebp - 0x15]
movzx edi, byte [edi + 0x5caf24]
xor edi, edx
inc ecx
inc ecx
mov edx, dword [edi*4 + 0x650140]
mov dword [eax], edx
add eax, 0x10
cmp ecx, esi
jl 0x50ad80
jmp 0x50af81
push dword [ebp - 0x14]
mov edi, 0x5cae24
lea eax, [ebp - 0x150]
push edi
push eax
call fcn.0050a252
movzx ecx, byte [ebp - 0x18]
add esp, 0xc
and dword [ebp - 4], 0
lea eax, [ebx + 0x12c]
mov esi, 0x100
mov edx, dword [ebp - 4]
movzx edx, byte [ebp + edx - 0x150]
movzx edx, byte [edx + 0x5cae24]
xor edx, ecx
mov edx, dword [edx*4 + 0x64f540]
mov dword [eax - 8], edx
mov edx, dword [ebp - 4]
add dword [ebp - 4], 2
movzx edx, byte [ebp + edx - 0x14f]
movzx edx, byte [edx + 0x5cae24]
xor edx, ecx
mov edx, dword [edx*4 + 0x64f540]
mov dword [eax], edx
add eax, 0x10
cmp dword [ebp - 4], esi
jl 0x50ae10
push dword [ebp - 0x13]
lea eax, [ebp - 0x150]
push 0x5caf24
push eax
call fcn.0050a252
movzx ecx, byte [ebp - 0x17]
add esp, 0xc
and dword [ebp - 4], 0
lea eax, [ebx + 0x130]
mov edx, dword [ebp - 4]
movzx edx, byte [ebp + edx - 0x150]
movzx edx, byte [edx + 0x5cae24]
xor edx, ecx
mov edx, dword [edx*4 + 0x64f940]
mov dword [eax - 8], edx
mov edx, dword [ebp - 4]
add dword [ebp - 4], 2
movzx edx, byte [ebp + edx - 0x14f]
movzx edx, byte [edx + 0x5cae24]
xor edx, ecx
mov edx, dword [edx*4 + 0x64f940]
mov dword [eax], edx
add eax, 0x10
cmp dword [ebp - 4], esi
jl 0x50ae7c
push dword [ebp - 0x12]
lea eax, [ebp - 0x150]
push edi
push eax
call fcn.0050a252
movzx edx, byte [ebp - 0x16]
add esp, 0xc
xor ecx, ecx
lea eax, [ebx + 0x92c]
movzx edi, byte [ebp + ecx - 0x150]
movzx edi, byte [edi + 0x5caf24]
xor edi, edx
mov edi, dword [edi*4 + 0x64fd40]
mov dword [eax - 8], edi
movzx edi, byte [ebp + ecx - 0x14f]
movzx edi, byte [edi + 0x5caf24]
xor edi, edx
inc ecx
inc ecx
mov edi, dword [edi*4 + 0x64fd40]
mov dword [eax], edi
add eax, 0x10
cmp ecx, esi
jl 0x50aee2
push dword [ebp - 0x11]
lea eax, [ebp - 0x150]
push 0x5caf24
push eax
call fcn.0050a252
movzx edx, byte [ebp - 0x15]
add esp, 0xc
xor ecx, ecx
lea eax, [ebx + 0x930]
movzx edi, byte [ebp + ecx - 0x150]
movzx edi, byte [edi + 0x5caf24]
xor edi, edx
mov edi, dword [edi*4 + 0x650140]
mov dword [eax - 8], edi
movzx edi, byte [ebp + ecx - 0x14f]
movzx edi, byte [edi + 0x5caf24]
xor edi, edx
inc ecx
inc ecx
mov edi, dword [edi*4 + 0x650140]
mov dword [eax], edi
add eax, 0x10
cmp ecx, esi
jl 0x50af43
cmp byte [ebx], 0
jne 0x50af90
push 0
push ebx
call fcn.0050a212
pop ecx
pop ecx
push 1
pop eax
pop edi
pop esi
pop ebx
leave
ret