Function at 0x402780
Capabilities:
Encode data using xor

Disassembly:
cmp dword [0x40a868], 0
jne 0x402798
call fcn.00403671
mov dword [0x40a868], 1
push ebx
mov ebx, dword [esp + 0x10]
mov eax, ebx
sub eax, 0x80
je 0x4027d0
sub eax, 0x40
je 0x4027c4
sub eax, 0x40
je 0x4027b8
push 0xffffffffffffffe0
pop eax
jmp 0x4029ea
mov edx, dword [esp + 8]
mov dword [edx], 0xe
jmp 0x4027da
mov edx, dword [esp + 8]
mov dword [edx], 0xc
jmp 0x4027da
mov edx, dword [esp + 8]
mov dword [edx], 0xa
push ebp
push esi
push edi
shr ebx, 5
lea edi, [edx + 8]
xor ebp, ebp
mov dword [edx + 4], edi
test ebx, ebx
je 0x402822
mov esi, dword [esp + 0x18]
mov edx, ebp
add esi, 2
movzx ecx, byte [esi + 1]
movzx eax, byte [esi]
lea esi, [esi + 4]
shl ecx, 8
or ecx, eax
movzx eax, byte [esi - 5]
shl ecx, 8
or ecx, eax
movzx eax, byte [esi - 6]
shl ecx, 8
or ecx, eax
mov dword [edi + edx*4], ecx
inc edx
cmp edx, ebx
jb 0x4027f5
mov edx, dword [esp + 0x14]
mov eax, dword [edx]
sub eax, 0xa
je 0x40297e
dec eax
dec eax
je 0x402905
dec eax
dec eax
jne 0x4029e5
mov ebx, dword [edi + 0x1c]
movzx eax, bl
mov edx, dword [edi + 0xc]
movzx ecx, byte [eax + 0x40a870]
movzx eax, byte [edi + 0x1f]
shl ecx, 8
movzx eax, byte [eax + 0x40a870]
xor ecx, eax
movzx eax, byte [edi + 0x1e]
shl ecx, 8
movzx eax, byte [eax + 0x40a870]
xor ecx, eax
movzx eax, byte [edi + 0x1d]
shl ecx, 8
movzx eax, byte [eax + 0x40a870]
xor ecx, eax
mov eax, dword [edi + 4]
xor ecx, dword [ebp + 0x40ca70]
add ebp, 4
xor ecx, dword [edi]
lea edi, [edi + 0x20]
xor eax, ecx
mov dword [edi], ecx
mov ecx, dword [edi - 0x18]
xor ecx, eax
mov dword [edi + 4], eax
xor edx, ecx
mov dword [edi + 8], ecx
mov dword [edi + 0xc], edx
movzx eax, byte [edi + 0xf]
movzx ecx, byte [eax + 0x40a870]
movzx eax, byte [edi + 0xe]
shl ecx, 8
movzx eax, byte [eax + 0x40a870]
xor ecx, eax
movzx eax, byte [edi + 0xd]
shl ecx, 8
movzx eax, byte [eax + 0x40a870]
xor ecx, eax
movzx eax, dl
shl ecx, 8
movzx eax, byte [eax + 0x40a870]
xor ecx, eax
mov eax, dword [edi - 0xc]
xor ecx, dword [edi - 0x10]
xor eax, ecx
mov dword [edi + 0x10], ecx
mov ecx, dword [edi - 8]
xor ecx, eax
mov dword [edi + 0x14], eax
mov dword [edi + 0x18], ecx
xor ecx, ebx
mov dword [edi + 0x1c], ecx
cmp ebp, 0x1c
jb 0x40283d
jmp 0x4029e5
mov ebx, dword [edi + 0x14]
movzx eax, bl
movzx ecx, byte [eax + 0x40a870]
movzx eax, byte [edi + 0x17]
shl ecx, 8
movzx eax, byte [eax + 0x40a870]
xor ecx, eax
movzx eax, byte [edi + 0x16]
shl ecx, 8
movzx eax, byte [eax + 0x40a870]
xor ecx, eax
movzx eax, byte [edi + 0x15]
shl ecx, 8
movzx eax, byte [eax + 0x40a870]
xor ecx, eax
mov eax, dword [edi + 4]
xor ecx, dword [ebp + 0x40ca70]
add ebp, 4
xor ecx, dword [edi]
lea edi, [edi + 0x18]
xor eax, ecx
mov dword [edi], ecx
mov ecx, dword [edi - 0x10]
xor ecx, eax
mov dword [edi + 4], eax
mov eax, dword [edi - 0xc]
xor eax, ecx
mov dword [edi + 8], ecx
mov ecx, dword [edi - 8]
xor ecx, eax
mov dword [edi + 0xc], eax
mov dword [edi + 0x10], ecx
xor ecx, ebx
mov dword [edi + 0x14], ecx
cmp ebp, 0x20
jb 0x402905
jmp 0x4029e5
mov ebx, dword [edi + 0xc]
movzx eax, bl
movzx ecx, byte [eax + 0x40a870]
movzx eax, byte [edi + 0xf]
shl ecx, 8
movzx eax, byte [eax + 0x40a870]
xor ecx, eax
movzx eax, byte [edi + 0xe]
shl ecx, 8
movzx eax, byte [eax + 0x40a870]
xor ecx, eax
movzx eax, byte [edi + 0xd]
shl ecx, 8
movzx eax, byte [eax + 0x40a870]
xor ecx, eax
mov eax, dword [edi + 4]
xor ecx, dword [ebp + 0x40ca70]
add ebp, 4
xor ecx, dword [edi]
lea edi, [edi + 0x10]
xor eax, ecx
mov dword [edi], ecx
mov ecx, dword [edi - 8]
xor ecx, eax
mov dword [edi + 4], eax
mov dword [edi + 8], ecx
xor ecx, ebx
mov dword [edi + 0xc], ecx
cmp ebp, 0x28
jb 0x40297e
pop edi
pop esi
xor eax, eax
pop ebp
pop ebx
ret 0xc