Function at 0x798b70
Capabilities:
Encode data using xor

Disassembly:
push ebx
mov ebx, dword [esp + 0x10]
push ebp
push esi
test ebx, ebx
push edi
je 0x798fb8
mov ebp, dword [esp + 0x14]
mov ecx, dword [ebp + 0x14]
lea eax, [ecx + ebx*8]
cmp eax, ecx
jae 0x798b91
inc dword [ebp + 0x18]
mov edx, dword [ebp + 0x18]
mov ecx, ebx
shr ecx, 0x1d
mov dword [ebp + 0x14], eax
mov eax, dword [ebp + 0x5c]
add edx, ecx
test eax, eax
mov dword [ebp + 0x18], edx
je 0x798e2e
mov edi, eax
mov ecx, eax
add eax, ebx
lea edx, [ebp + 0x1c]
sar edi, 2
and ecx, 3
cmp eax, 0x40
mov dword [esp + 0x1c], edx
jb 0x798cb8
mov eax, dword [edx + edi*4]
cmp ecx, 3
ja case.default.0x798bd0
jmp dword [ecx*4 + 0x798fc0]
mov esi, dword [esp + 0x18]
xor eax, eax
xor ecx, ecx
mov al, byte [esi]
mov cl, byte [esi + 1]
shl eax, 0x18
inc esi
shl ecx, 0x10
or eax, ecx
inc esi
xor ecx, ecx
mov ch, byte [esi]
or eax, ecx
inc esi
xor ecx, ecx
mov cl, byte [esi]
or eax, ecx
inc esi
jmp 0x798c41
mov esi, dword [esp + 0x18]
xor ecx, ecx
mov cl, byte [esi]
shl ecx, 0x10
or eax, ecx
inc esi
xor ecx, ecx
mov ch, byte [esi]
or eax, ecx
inc esi
xor ecx, ecx
mov cl, byte [esi]
or eax, ecx
inc esi
jmp 0x798c41
mov esi, dword [esp + 0x18]
xor ecx, ecx
mov ch, byte [esi]
or eax, ecx
inc esi
xor ecx, ecx
mov cl, byte [esi]
or eax, ecx
inc esi
jmp 0x798c41
mov esi, dword [esp + 0x18]
xor ecx, ecx
mov cl, byte [esi]
or eax, ecx
inc esi
jmp 0x798c41
mov esi, dword [esp + 0x18]
mov dword [edx + edi*4], eax
inc edi
cmp edi, 0x10
jge 0x798c99
mov eax, 0x10
lea ecx, [edx + edi*4]
sub eax, edi
mov dword [esp + 0x18], eax
xor eax, eax
xor edx, edx
mov al, byte [esi]
mov dl, byte [esi + 1]
xor eax, esi
add ecx, 4
shl eax, 0x18
inc esi
xor edx, esi
shl edx, 0x10
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
shl edx, 8
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
or eax, edx
inc esi
mov dword [ecx - 4], eax
mov eax, dword [esp + 0x18]
dec eax
mov dword [esp + 0x18], eax
jne 0x798c58
mov edx, dword [esp + 0x1c]
mov eax, dword [ebp + 0x5c]
push 0x40
push edx
push ebp
lea ebx, [ebx + eax - 0x40]
call fcn.00798fe0
add esp, 0xc
mov dword [ebp + 0x5c], 0
jmp 0x798e32
lea esi, [ecx + ebx]
mov dword [ebp + 0x5c], eax
cmp esi, 4
jae 0x798d23
mov esi, dword [edx + edi*4]
sub ecx, 0
je 0x798cd9
dec ecx
je 0x798ced
dec ecx
je 0x798d10
mov dword [edx + edi*4], esi
pop edi
pop esi
pop ebp
pop ebx
ret
mov ebp, dword [esp + 0x18]
xor ecx, ecx
mov cl, byte [ebp]
mov esi, ecx
shl esi, 0x18
inc ebp
dec ebx
je 0x798d1b
jmp 0x798cf1
mov ebp, dword [esp + 0x18]
xor eax, eax
mov al, byte [ebp]
shl eax, 0x10
or esi, eax
inc ebp
dec ebx
test ebx, ebx
je 0x798d1b
xor ecx, ecx
mov ch, byte [ebp]
or esi, ecx
mov dword [edx + edi*4], esi
pop edi
pop esi
pop ebp
pop ebx
ret
mov ebp, dword [esp + 0x18]
xor ecx, ecx
mov ch, byte [ebp]
or esi, ecx
mov dword [edx + edi*4], esi
pop edi
pop esi
pop ebp
pop ebx
ret
mov ebp, dword [edx + edi*4]
mov esi, eax
and eax, 3
sar esi, 2
mov ebx, eax
cmp ecx, 3
mov dword [esp + 0x1c], ebx
ja case.default.0x798d39
jmp dword [ecx*4 + 0x798fd0]
mov eax, dword [esp + 0x18]
xor ecx, ecx
mov cl, byte [eax]
mov ebp, ecx
xor ecx, ecx
mov cl, byte [eax + 1]
shl ebp, 0x18
inc eax
shl ecx, 0x10
or ebp, ecx
inc eax
xor ecx, ecx
mov ch, byte [eax]
or ebp, ecx
inc eax
xor ecx, ecx
mov cl, byte [eax]
or ebp, ecx
inc eax
jmp 0x798dac
mov eax, dword [esp + 0x18]
xor ecx, ecx
mov cl, byte [eax]
shl ecx, 0x10
or ebp, ecx
inc eax
xor ecx, ecx
mov ch, byte [eax]
or ebp, ecx
inc eax
xor ecx, ecx
mov cl, byte [eax]
or ebp, ecx
inc eax
jmp 0x798dac
mov eax, dword [esp + 0x18]
xor ecx, ecx
mov ch, byte [eax]
or ebp, ecx
inc eax
xor ecx, ecx
mov cl, byte [eax]
or ebp, ecx
inc eax
jmp 0x798dac
mov eax, dword [esp + 0x18]
xor ecx, ecx
mov cl, byte [eax]
or ebp, ecx
inc eax
jmp 0x798dac
mov eax, dword [esp + 0x18]
mov dword [edx + edi*4], ebp
inc edi
cmp edi, esi
jge 0x798df4
sub esi, edi
lea ebp, [edx + edi*4]
add edi, esi
xor ecx, ecx
xor ebx, ebx
mov cl, byte [eax]
mov bl, byte [eax + 1]
xor ecx, eax
add ebp, 4
shl ecx, 0x18
inc eax
xor ebx, eax
shl ebx, 0x10
or ecx, ebx
inc eax
xor ebx, ebx
mov bl, byte [eax]
xor ebx, eax
shl ebx, 8
or ecx, ebx
inc eax
xor ebx, ebx
mov bl, byte [eax]
xor ebx, eax
or ecx, ebx
inc eax
mov dword [ebp - 4], ecx
dec esi
jne 0x798dbb
mov ebx, dword [esp + 0x1c]
test ebx, ebx
je 0x798fb8
mov ecx, ebx
xor esi, esi
add eax, ebx
dec ecx
je 0x798e1c
dec ecx
je 0x798e12
dec ecx
jne 0x798e26
dec eax
xor ecx, ecx
mov ch, byte [eax]
mov esi, ecx
dec eax
xor ecx, ecx
mov cl, byte [eax]
shl ecx, 0x10
or esi, ecx
xor ecx, ecx
mov cl, byte [eax - 1]
shl ecx, 0x18
or esi, ecx
mov dword [edx + edi*4], esi
pop edi
pop esi
pop ebp
pop ebx
ret
mov esi, dword [esp + 0x18]
cmp ebx, 0x40
lea edi, [ebp + 0x1c]
jb 0x798f3c
mov eax, ebx
shr eax, 6
mov dword [esp + 0x18], eax
mov ecx, 4
xor eax, eax
xor edx, edx
mov al, byte [esi]
mov dl, byte [esi + 1]
xor eax, esi
add edi, 4
shl eax, 0x18
inc esi
add edi, 4
xor edx, esi
add edi, 4
shl edx, 0x10
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
shl edx, 8
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
or eax, edx
inc esi
mov dword [edi - 0xc], eax
xor eax, eax
mov al, byte [esi]
xor edx, edx
mov dl, byte [esi + 1]
xor eax, esi
shl eax, 0x18
inc esi
xor edx, esi
shl edx, 0x10
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
shl edx, 8
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
or eax, edx
inc esi
mov dword [edi - 8], eax
xor eax, eax
mov al, byte [esi]
xor edx, edx
mov dl, byte [esi + 1]
xor eax, esi
shl eax, 0x18
inc esi
xor edx, esi
shl edx, 0x10
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
shl edx, 8
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
or eax, edx
inc esi
mov dword [edi - 4], eax
xor eax, eax
mov al, byte [esi]
xor edx, edx
mov dl, byte [esi + 1]
xor eax, esi
shl eax, 0x18
inc esi
xor edx, esi
shl edx, 0x10
or eax, edx
inc esi
xor edx, edx
add edi, 4
mov dl, byte [esi]
xor edx, esi
shl edx, 8
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
or eax, edx
inc esi
mov dword [edi - 4], eax
dec ecx
jne 0x798e4c
lea edi, [ebp + 0x1c]
push 0x40
push edi
push ebp
call fcn.00798fe0
mov eax, dword [esp + 0x24]
add esp, 0xc
sub ebx, 0x40
dec eax
mov dword [esp + 0x18], eax
jne 0x798e47
mov eax, ebx
mov dword [ebp + 0x5c], ebx
sar eax, 2
and ebx, 3
xor edx, edx
test eax, eax
jle 0x798f8e
mov ecx, edi
mov ebp, eax
mov dword [esp + 0x18], eax
xor eax, eax
xor edx, edx
mov al, byte [esi]
mov dl, byte [esi + 1]
xor eax, esi
add ecx, 4
shl eax, 0x18
inc esi
xor edx, esi
shl edx, 0x10
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
shl edx, 8
or eax, edx
inc esi
xor edx, edx
mov dl, byte [esi]
xor edx, esi
or eax, edx
inc esi
mov dword [ecx - 4], eax
dec ebp
jne 0x798f55
mov edx, dword [esp + 0x18]
mov ecx, ebx
xor eax, eax
add esi, ebx
dec ecx
je 0x798fab
dec ecx
je 0x798fa1
dec ecx
jne 0x798fb5
mov ah, byte [esi - 1]
dec esi
dec esi
xor ecx, ecx
mov cl, byte [esi]
shl ecx, 0x10
or eax, ecx
xor ecx, ecx
mov cl, byte [esi - 1]
shl ecx, 0x18
or eax, ecx
mov dword [edi + edx*4], eax
pop edi
pop esi
pop ebp
pop ebx
ret