Function at 0x410699
Capabilities:
Encode data using xor

Disassembly:
mov ecx, dword [esp + 4]
sub esp, 0x3c
push ebx
push ebp
push esi
push edi
test ecx, ecx
je 0x410a24
mov edi, dword [esp + 0x54]
test edi, edi
je 0x410a24
cmp byte [edi], 1
je 0x410a24
mov eax, dword [esp + 0x5c]
shl eax, 3
cdq
and edx, 0x7f
lea esi, [edx + eax]
movzx eax, byte [ecx]
sar esi, 7
mov dword [esp + 0x24], esi
dec eax
je 0x4109f0
dec eax
je 0x410968
dec eax
jne 0x410a24
mov eax, dword [ecx + 1]
mov ebp, esi
mov dword [esp + 0x2c], eax
mov eax, dword [ecx + 5]
mov dword [esp + 0x30], eax
mov eax, dword [ecx + 9]
mov dword [esp + 0x34], eax
mov eax, dword [ecx + 0xd]
mov dword [esp + 0x38], eax
test esi, esi
jle 0x410a1d
mov al, byte [esp + 0x3b]
lea esi, [edi + 0x2a]
mov byte [esp + 0x1f], al
mov al, byte [esp + 0x3a]
mov byte [esp + 0x1e], al
mov al, byte [esp + 0x39]
mov byte [esp + 0x1d], al
mov al, byte [esp + 0x38]
mov byte [esp + 0x1c], al
mov al, byte [esp + 0x37]
mov byte [esp + 0x1b], al
mov al, byte [esp + 0x36]
mov byte [esp + 0x1a], al
mov al, byte [esp + 0x35]
mov byte [esp + 0x19], al
mov al, byte [esp + 0x34]
mov edi, dword [esp + 0x60]
mov byte [esp + 0x18], al
mov al, byte [esp + 0x33]
mov byte [esp + 0x17], al
mov al, byte [esp + 0x32]
mov byte [esp + 0x16], al
mov al, byte [esp + 0x31]
mov byte [esp + 0x15], al
mov al, byte [esp + 0x30]
mov byte [esp + 0x14], al
mov al, byte [esp + 0x2f]
mov byte [esp + 0x13], al
mov al, byte [esp + 0x2e]
mov byte [esp + 0x12], al
mov al, byte [esp + 0x2d]
mov byte [esp + 0x5c], al
mov al, byte [esp + 0x2c]
mov byte [esp + 0x50], al
xor ebx, ebx
mov dword [esp + 0x20], ebx
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 0x44], eax
mov eax, dword [esp + 0x38]
mov dword [esp + 0x48], eax
lea eax, [esp + 0x3c]
push esi
push eax
push eax
call fcn.00410f19
mov eax, dword [esp + 0x2c]
and bl, 7
cdq
mov cl, bl
and edx, 7
add esp, 0xc
add eax, edx
mov dl, byte [esp + 0x3c]
sar eax, 3
and dl, 0x80
shr dl, cl
mov cl, byte [esp + 0x50]
add cl, cl
xor byte [eax + edi], dl
mov dl, byte [eax + edi]
mov ah, byte [esp + 0x5c]
mov al, ah
add ah, ah
shr al, 7
or cl, al
mov byte [esp + 0x50], cl
mov byte [esp + 0x2c], cl
mov cl, byte [esp + 0x12]
mov al, cl
add cl, cl
shr al, 7
or ah, al
mov byte [esp + 0x5c], ah
mov byte [esp + 0x2d], ah
mov ah, byte [esp + 0x13]
mov al, ah
add ah, ah
shr al, 7
or cl, al
mov byte [esp + 0x12], cl
mov byte [esp + 0x2e], cl
mov cl, byte [esp + 0x14]
mov al, cl
add cl, cl
shr al, 7
or ah, al
mov byte [esp + 0x13], ah
mov byte [esp + 0x2f], ah
mov ah, byte [esp + 0x15]
mov al, ah
add ah, ah
shr al, 7
or cl, al
mov byte [esp + 0x14], cl
mov byte [esp + 0x30], cl
mov cl, byte [esp + 0x16]
mov al, cl
add cl, cl
shr al, 7
or ah, al
mov byte [esp + 0x15], ah
mov byte [esp + 0x31], ah
mov ah, byte [esp + 0x17]
mov al, ah
add ah, ah
shr al, 7
or cl, al
mov byte [esp + 0x16], cl
mov byte [esp + 0x32], cl
mov cl, byte [esp + 0x18]
mov al, cl
shr al, 7
or ah, al
mov byte [esp + 0x17], ah
add cl, cl
mov byte [esp + 0x33], ah
mov ah, byte [esp + 0x19]
mov al, ah
mov dh, byte [esp + 0x1d]
shr al, 7
add ah, ah
or cl, al
mov ch, byte [esp + 0x1e]
mov byte [esp + 0x18], cl
mov byte [esp + 0x34], cl
mov cl, byte [esp + 0x1a]
mov al, cl
add cl, cl
shr al, 7
or ah, al
mov byte [esp + 0x19], ah
mov byte [esp + 0x35], ah
mov ah, byte [esp + 0x1b]
mov al, ah
add ah, ah
shr al, 7
or cl, al
mov byte [esp + 0x1a], cl
mov byte [esp + 0x36], cl
mov cl, byte [esp + 0x1c]
mov al, cl
add cl, cl
shr al, 7
or ah, al
mov al, dh
shr al, 7
add dh, dh
or cl, al
mov byte [esp + 0x1b], ah
mov al, ch
mov byte [esp + 0x1c], cl
shr al, 7
add ch, ch
mov byte [esp + 0x38], cl
or dh, al
mov byte [esp + 0x37], ah
mov cl, 7
mov ah, byte [esp + 0x1f]
sub cl, bl
mov ebx, dword [esp + 0x20]
mov al, ah
shr dl, cl
add ah, ah
shr al, 7
and dl, 1
or ch, al
mov byte [esp + 0x1d], dh
or ah, dl
mov byte [esp + 0x39], dh
inc ebx
mov byte [esp + 0x1e], ch
mov byte [esp + 0x3a], ch
mov byte [esp + 0x1f], ah
mov byte [esp + 0x3b], ah
mov dword [esp + 0x20], ebx
cmp ebx, 0x80
jl 0x4107a1
dec ebp
test ebp, ebp
jg 0x41079b
jmp 0x410a19
mov eax, dword [ecx + 9]
mov ebx, dword [ecx + 1]
mov ebp, dword [ecx + 5]
mov ecx, dword [ecx + 0xd]
mov dword [esp + 0x20], eax
mov dword [esp + 0x5c], esi
test esi, esi
jle 0x410a1d
mov edx, dword [esp + 0x60]
lea eax, [edi + 0x2a]
mov edi, dword [esp + 0x58]
mov esi, dword [esp + 0x20]
add edi, 8
mov dword [esp + 0x28], eax
mov dword [esp + 0x50], edx
push dword [esp + 0x28]
xor ecx, dword [edi + 4]
lea eax, [esp + 0x40]
xor ebx, dword [edi - 8]
xor ebp, dword [edi - 4]
xor esi, dword [edi]
push edx
push eax
mov dword [esp + 0x48], ebx
mov dword [esp + 0x4c], ebp
mov dword [esp + 0x50], esi
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x54], ecx
call fcn.00410f19
mov edx, dword [esp + 0x5c]
lea edi, [edi + 0x10]
mov eax, dword [esp + 0x68]
add edx, 0x10
mov ecx, dword [esp + 0x2c]
add esp, 0xc
dec eax
mov dword [esp + 0x50], edx
mov dword [esp + 0x5c], eax
test eax, eax
jg 0x41099e
jmp 0x410a19
mov ebx, esi
test esi, esi
jle 0x410a1d
mov ebp, dword [esp + 0x58]
lea esi, [edi + 0x2a]
mov edi, dword [esp + 0x60]
sub ebp, edi
push esi
lea eax, [edi + ebp]
push edi
push eax
call fcn.00410f19
add esp, 0xc
add edi, 0x10
dec ebx
test ebx, ebx
jg 0x410a03
mov esi, dword [esp + 0x24]
shl esi, 7
mov eax, esi
jmp 0x410a27
push 0xfffffffffffffffb
pop eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret