Function at 0x402977
Capabilities:
Encode data using xor

Disassembly:
cmp dword [0x40ac38], 0
jne 0x40298f
call fcn.00403868
mov dword [0x40ac38], 1
push ebx
mov ebx, dword [esp + 0x10]
mov eax, ebx
sub eax, 0x80
je 0x4029c7
sub eax, 0x40
je 0x4029bb
sub eax, 0x40
je 0x4029af
push 0xffffffffffffffe0
pop eax
jmp 0x402be1
mov edx, dword [esp + 8]
mov dword [edx], 0xe
jmp 0x4029d1
mov edx, dword [esp + 8]
mov dword [edx], 0xc
jmp 0x4029d1
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 0x402a19
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 0x4029ec
mov edx, dword [esp + 0x14]
mov eax, dword [edx]
sub eax, 0xa
je 0x402b75
dec eax
dec eax
je 0x402afc
dec eax
dec eax
jne 0x402bdc
mov ebx, dword [edi + 0x1c]
movzx eax, bl
mov edx, dword [edi + 0xc]
movzx ecx, byte [eax + 0x40ac40]
movzx eax, byte [edi + 0x1f]
shl ecx, 8
movzx eax, byte [eax + 0x40ac40]
xor ecx, eax
movzx eax, byte [edi + 0x1e]
shl ecx, 8
movzx eax, byte [eax + 0x40ac40]
xor ecx, eax
movzx eax, byte [edi + 0x1d]
shl ecx, 8
movzx eax, byte [eax + 0x40ac40]
xor ecx, eax
mov eax, dword [edi + 4]
xor ecx, dword [ebp + 0x40ce40]
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 + 0x40ac40]
movzx eax, byte [edi + 0xe]
shl ecx, 8
movzx eax, byte [eax + 0x40ac40]
xor ecx, eax
movzx eax, byte [edi + 0xd]
shl ecx, 8
movzx eax, byte [eax + 0x40ac40]
xor ecx, eax
movzx eax, dl
shl ecx, 8
movzx eax, byte [eax + 0x40ac40]
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 0x402a34
jmp 0x402bdc
mov ebx, dword [edi + 0x14]
movzx eax, bl
movzx ecx, byte [eax + 0x40ac40]
movzx eax, byte [edi + 0x17]
shl ecx, 8
movzx eax, byte [eax + 0x40ac40]
xor ecx, eax
movzx eax, byte [edi + 0x16]
shl ecx, 8
movzx eax, byte [eax + 0x40ac40]
xor ecx, eax
movzx eax, byte [edi + 0x15]
shl ecx, 8
movzx eax, byte [eax + 0x40ac40]
xor ecx, eax
mov eax, dword [edi + 4]
xor ecx, dword [ebp + 0x40ce40]
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 0x402afc
jmp 0x402bdc
mov ebx, dword [edi + 0xc]
movzx eax, bl
movzx ecx, byte [eax + 0x40ac40]
movzx eax, byte [edi + 0xf]
shl ecx, 8
movzx eax, byte [eax + 0x40ac40]
xor ecx, eax
movzx eax, byte [edi + 0xe]
shl ecx, 8
movzx eax, byte [eax + 0x40ac40]
xor ecx, eax
movzx eax, byte [edi + 0xd]
shl ecx, 8
movzx eax, byte [eax + 0x40ac40]
xor ecx, eax
mov eax, dword [edi + 4]
xor ecx, dword [ebp + 0x40ce40]
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 0x402b75
pop edi
pop esi
xor eax, eax
pop ebp
pop ebx
ret 0xc