Function at 0x401f20
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
mov edi, ecx
push 4
mov dword [ebp - 0x14], edi
call fcn.00d49408
mov esi, eax
push 4
mov dword [ebp - 0x10], esi
call fcn.00d49408
mov ebx, eax
add esp, 8
mov eax, dword [edi + 4]
xor edx, edx
mov dword [ebp - 0xc], ebx
lea ecx, [eax*4]
test ecx, ecx
jle 0x401f7f
mov esi, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
sub esi, ecx
mov al, byte [esi + ecx]
inc edx
mov byte [ecx], al
inc ecx
mov ebx, dword [edi + 4]
lea eax, [ebx*4]
cmp edx, eax
jl 0x401f61
mov esi, dword [ebp - 0x10]
mov ebx, dword [ebp - 0xc]
mov eax, dword [edi + 4]
lea edx, [eax*4]
mov eax, dword [edi + 8]
inc eax
mov dword [ebp - 8], edx
imul eax, dword [edi]
shl eax, 2
cmp edx, eax
jge 0x4021e6
mov ebx, dword [ebp + 0xc]
add ebx, 0xfffffffd
add ebx, edx
mov dword [ebp - 0x10], ebx
mov cl, byte [ebx - 1]
mov byte [esi], cl
mov ch, byte [ebx]
mov byte [esi + 1], ch
mov al, byte [ebx + 1]
mov byte [ebp - 1], al
mov byte [esi + 2], al
mov al, byte [ebx + 2]
mov byte [ebp - 2], al
mov byte [esi + 3], al
mov eax, edx
cdq
and edx, 3
mov byte [ebp + 0xb], cl
add eax, edx
mov byte [ebp - 3], ch
sar eax, 2
cdq
idiv dword [edi + 4]
test edx, edx
jne 0x4020c6
movzx ecx, ch
mov eax, ecx
and eax, 0xfffffff0
and ecx, reloc.WS2_32.dll_ntohs
jns 0x401ff4
dec ecx
or ecx, 0xfffffff0
inc ecx
movzx eax, byte [eax + ecx + str.cw]
movzx ecx, byte [ebp - 1]
mov byte [esi], al
mov eax, ecx
and eax, 0xfffffff0
and ecx, reloc.WS2_32.dll_ntohs
jns 0x402014
dec ecx
or ecx, 0xfffffff0
inc ecx
movzx eax, byte [eax + ecx + str.cw]
movzx ecx, byte [ebp - 2]
mov byte [esi + 1], al
mov eax, ecx
and eax, 0xfffffff0
and ecx, reloc.WS2_32.dll_ntohs
jns 0x402035
dec ecx
or ecx, 0xfffffff0
inc ecx
movzx eax, byte [eax + ecx + str.cw]
movzx ecx, byte [ebp + 0xb]
mov byte [esi + 2], al
mov eax, ecx
and eax, 0xfffffff0
and ecx, reloc.WS2_32.dll_ntohs
jns 0x402056
dec ecx
or ecx, 0xfffffff0
inc ecx
movzx eax, byte [eax + ecx + str.cw]
mov bl, 1
mov byte [esi + 3], al
mov ecx, dword [edi + 4]
mov eax, dword [ebp - 8]
shl ecx, 2
cdq
idiv ecx
lea edi, [eax - 1]
test edi, edi
jle 0x402090
mov dl, bl
add dl, dl
mov al, dl
xor al, 0x1b
test bl, bl
movzx ecx, al
movzx eax, dl
cmovns ecx, eax
mov bl, cl
sub edi, 1
jne 0x402076
mov ecx, dword [ebp - 0xc]
mov edi, dword [ebp - 0x14]
mov byte [ecx], bl
mov word [ecx + 2], 0
mov byte [ecx + 1], 0
xor byte [esi], bl
mov al, byte [esi]
mov ebx, dword [ebp - 0x10]
mov byte [ebp + 0xb], al
movzx eax, byte [ecx + 1]
xor byte [esi + 1], al
movzx eax, byte [ecx + 2]
xor byte [esi + 2], al
movzx eax, byte [ecx + 3]
xor byte [esi + 3], al
jmp 0x402163
cmp dword [edi + 4], 6
mov byte [ebp + 0xb], cl
jle 0x402163
mov byte [ebp + 0xb], cl
cmp edx, 4
jne 0x402163
movzx ecx, cl
mov eax, ecx
and eax, 0xfffffff0
and ecx, reloc.WS2_32.dll_ntohs
jns 0x4020f4
dec ecx
or ecx, 0xfffffff0
inc ecx
mov al, byte [eax + ecx + str.cw]
movzx ecx, byte [ebp - 3]
mov byte [ebp + 0xb], al
mov byte [esi], al
mov eax, ecx
and eax, 0xfffffff0
and ecx, reloc.WS2_32.dll_ntohs
jns 0x402116
dec ecx
or ecx, 0xfffffff0
inc ecx
movzx eax, byte [eax + ecx + str.cw]
movzx ecx, byte [ebp - 1]
mov byte [esi + 1], al
mov eax, ecx
and eax, 0xfffffff0
and ecx, reloc.WS2_32.dll_ntohs
jns 0x402137
dec ecx
or ecx, 0xfffffff0
inc ecx
movzx eax, byte [eax + ecx + str.cw]
movzx ecx, byte [ebp - 2]
mov byte [esi + 2], al
mov eax, ecx
and eax, 0xfffffff0
and ecx, reloc.WS2_32.dll_ntohs
jns 0x402158
dec ecx
or ecx, 0xfffffff0
inc ecx
movzx eax, byte [eax + ecx + str.cw]
mov byte [esi + 3], al
mov ecx, dword [edi + 4]
mov edx, dword [ebp - 8]
mov eax, edx
shl ecx, 2
sub eax, ecx
mov ecx, dword [ebp + 0xc]
movzx eax, byte [eax + ecx]
xor al, byte [ebp + 0xb]
mov byte [ebx + 3], al
mov eax, edx
mov ecx, dword [edi + 4]
shl ecx, 2
sub eax, ecx
mov ecx, dword [ebp + 0xc]
movzx eax, byte [eax + ecx + 1]
xor al, byte [esi + 1]
mov byte [ebx + 4], al
mov eax, edx
mov ecx, dword [edi + 4]
shl ecx, 2
sub eax, ecx
mov ecx, dword [ebp + 0xc]
movzx eax, byte [eax + ecx + 2]
xor al, byte [esi + 2]
mov byte [ebx + 5], al
mov eax, edx
mov ecx, dword [edi + 4]
add edx, 4
shl ecx, 2
sub eax, ecx
mov dword [ebp - 8], edx
mov ecx, dword [ebp + 0xc]
movzx eax, byte [eax + ecx + 3]
xor al, byte [esi + 3]
mov byte [ebx + 6], al
add ebx, 4
mov eax, dword [edi + 8]
inc eax
mov dword [ebp - 0x10], ebx
imul eax, dword [edi]
shl eax, 2
cmp edx, eax
jl 0x401fa6
mov ebx, dword [ebp - 0xc]
push ebx
call fcn.00d491c8
push esi
call fcn.00d491c8
add esp, 8
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8