Function at 0x401980
Capabilities:
Encode data using xor

Disassembly:
push ebp
push edi
mov ebp, ecx
push esi
push ebx
sub esp, 0x20
mov eax, dword [ebp]
mov ecx, dword [esp + 0x34]
mov esi, dword [esp + 0x38]
mov dword [esp + 8], eax
shl eax, 2
mov edi, eax
mov dword [esp], eax
xor eax, eax
test edi, edi
je 0x4019cf
lea esi, [esi]
lea edi, [edi]
movzx edx, byte [ecx + eax]
mov byte [esi + eax], dl
mov ebx, dword [ebp]
add eax, 1
lea edx, [ebx*4]
cmp edx, eax
ja 0x4019b0
mov dword [esp], edx
mov dword [esp + 8], ebx
mov eax, dword [ebp + 4]
mov esi, dword [esp]
mov edi, dword [esp + 0x38]
add eax, 1
shl eax, 4
add edi, esi
cmp esi, eax
mov dword [esp + 0xc], edi
jae 0x401be0
mov eax, ebp
mov ebp, edi
mov edi, eax
jmp 0x401a9f
cmp edx, 4
jne 0x401a14
cmp dword [esp + 8], 6
lea edx, [esp + 0x18]
ja 0x401b30
mov eax, dword [esp + 8]
shl eax, 2
mov dword [esp + 8], eax
mov edx, dword [esp]
mov ebx, dword [esp + 0x38]
add ebp, 4
mov eax, edx
sub eax, dword [esp + 8]
xor cl, byte [ebx + eax]
mov byte [ebp - 4], cl
mov ecx, dword [esp + 0xc]
mov eax, dword [edi]
mov ebx, ecx
shl eax, 2
sub ebx, eax
mov eax, ebx
mov ebx, esi
mov esi, ecx
xor bl, byte [eax + 1]
mov byte [ebp - 3], bl
mov eax, dword [edi]
movzx ebx, byte [esp + 7]
shl eax, 2
sub esi, eax
xor bl, byte [esi + 2]
mov esi, ecx
mov byte [ebp - 2], bl
mov eax, dword [edi]
movzx ebx, byte [esp + 6]
shl eax, 2
sub esi, eax
mov eax, edx
xor bl, byte [esi + 3]
add eax, 4
mov dword [esp], eax
mov byte [ebp - 1], bl
mov ebx, eax
mov eax, dword [edi + 4]
add eax, 1
shl eax, 4
cmp eax, ebx
jbe 0x401be0
mov eax, dword [edi]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x38]
add eax, ebx
mov dword [esp + 0xc], eax
movzx esi, byte [ebp - 3]
mov edx, dword [esp]
movzx ebx, byte [ebp - 1]
movzx ecx, byte [ebp - 4]
shr edx, 2
mov eax, esi
mov byte [esp + 0x19], al
movzx eax, byte [ebp - 2]
mov byte [esp + 6], bl
mov byte [esp + 0x1b], bl
mov byte [esp + 0x18], cl
mov byte [esp + 7], al
mov byte [esp + 0x1a], al
mov eax, edx
xor edx, edx
div dword [esp + 8]
test edx, edx
mov ebx, edx
jne 0x401a00
movzx eax, byte [esp + 7]
mov edx, esi
mov byte [esp + 0x1b], cl
mov byte [esp + 0x18], dl
lea edx, [esp + 0x18]
mov ecx, esi
mov byte [esp + 0x19], al
movzx eax, byte [esp + 6]
mov byte [esp + 0x1a], al
mov eax, ecx
and ecx, 0xf
add edx, 1
shr al, 4
movzx eax, al
shl eax, 4
movzx eax, byte [ecx + eax + 0x4a70e0]
mov byte [edx - 1], al
lea eax, [esp + 0x1c]
cmp edx, eax
je 0x401b60
movzx ecx, byte [edx]
jmp 0x401b03
mov eax, ecx
and ecx, 0xf
add edx, 1
shr al, 4
movzx eax, al
shl eax, 4
movzx eax, byte [ecx + eax + 0x4a70e0]
mov byte [edx - 1], al
lea eax, [esp + 0x1c]
cmp eax, edx
je 0x401bf0
movzx ecx, byte [edx]
jmp 0x401b30
mov eax, dword [esp + 8]
xor edx, edx
mov ecx, 1
shl eax, 2
mov esi, eax
mov dword [esp + 8], eax
mov eax, dword [esp]
div esi
sub eax, 1
je 0x401ba0
nop
mov edx, ecx
add ebx, 1
add ecx, ecx
shr dl, 7
mov esi, edx
lea edx, [esi + esi]
add edx, esi
lea esi, [edx*8]
add edx, esi
xor ecx, edx
cmp ebx, eax
jne 0x401b80
mov byte [esp + 0x1c], cl
xor cl, byte [esp + 0x18]
mov byte [esp + 0x1f], 0
mov byte [esp + 0x1e], 0
mov byte [esp + 0x1d], 0
mov byte [esp + 0x18], cl
movzx eax, byte [esp + 0x1a]
movzx esi, byte [esp + 0x19]
mov byte [esp + 7], al
movzx eax, byte [esp + 0x1b]
mov byte [esp + 6], al
jmp 0x401a1f
add esp, 0x20
pop ebx
pop esi
pop edi
pop ebp
ret 8
mov eax, dword [esp + 8]
movzx ecx, byte [esp + 0x18]
shl eax, 2
mov dword [esp + 8], eax
jmp 0x401bbb