Function at 0x402050
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
push ebx
mov ebx, ecx
mov ecx, 0x510004
mov dword [ebp - 0x20], ebx
call fcn.004b532d
mov edx, dword [ebp + 0xc]
mov ecx, dword [ebp + 8]
test edx, edx
jne 0x40207a
mov al, byte [ecx + edx]
inc edx
test al, al
jne 0x402070
test edx, edx
jle 0x402337
lea eax, [edx - 1]
push esi
shr eax, 4
lea esi, [ecx + 0xc]
inc eax
mov dword [ebp - 0x18], esi
push edi
mov dword [ebp - 0x1c], eax
lea edx, [esi - 0xc]
mov edi, 4
lea ecx, [ebp - 0x2f]
nop dword [eax]
movzx eax, byte [edx]
lea edx, [edx + 1]
mov byte [ecx - 1], al
lea esi, [esi + 1]
movzx eax, byte [edx + 3]
lea ecx, [ecx + 4]
mov byte [ecx - 4], al
movzx eax, byte [esi - 5]
mov byte [ecx - 3], al
movzx eax, byte [esi - 1]
mov byte [ecx - 2], al
sub edi, 1
jne 0x4020a0
lea ecx, [ebp - 0x2c]
lea edx, [ebx + 0x208]
lea esi, [edi + 4]
movzx eax, byte [edx - 4]
lea ecx, [ecx + 1]
xor byte [ecx - 5], al
lea edx, [edx + 1]
movzx eax, byte [edx - 1]
xor byte [ecx - 1], al
movzx eax, byte [edx + 3]
xor byte [ecx + 3], al
movzx eax, byte [edx + 7]
xor byte [ecx + 7], al
sub esi, 1
jne 0x4020d5
lea eax, [ebx + 0x218]
mov dword [ebp - 4], 1
mov dword [ebp - 0x14], eax
nop dword [eax]
xor ecx, ecx
movzx eax, byte [ebp + ecx*4 - 0x30]
movzx eax, byte [eax + ebx + 4]
mov byte [ebp + ecx*4 - 0x30], al
movzx eax, byte [ebp + ecx*4 - 0x2f]
movzx eax, byte [eax + ebx + 4]
mov byte [ebp + ecx*4 - 0x2f], al
movzx eax, byte [ebp + ecx*4 - 0x2e]
movzx eax, byte [eax + ebx + 4]
mov byte [ebp + ecx*4 - 0x2e], al
movzx eax, byte [ebp + ecx*4 - 0x2d]
movzx eax, byte [eax + ebx + 4]
mov byte [ebp + ecx*4 - 0x2d], al
inc ecx
cmp ecx, 4
jl 0x402112
mov esi, 4
mov edi, 3
nop word [eax + eax]
lea eax, [edi - 2]
and eax, 0x80000003
jns 0x40216f
dec eax
or eax, 0xfffffffc
inc eax
add eax, esi
mov bl, byte [ebp + eax - 0x30]
lea eax, [edi - 1]
and eax, 0x80000003
jns 0x402184
dec eax
or eax, 0xfffffffc
inc eax
add eax, esi
mov dl, byte [ebp + eax - 0x30]
mov eax, edi
and eax, 0x80000003
jns 0x402198
dec eax
or eax, 0xfffffffc
inc eax
add eax, esi
inc edi
mov cl, byte [ebp + eax - 0x30]
mov eax, edi
and eax, 0x80000003
jns 0x4021ad
dec eax
or eax, 0xfffffffc
inc eax
add eax, esi
mov al, byte [ebp + eax - 0x30]
mov byte [ebp + esi - 0x2d], al
lea eax, [edi - 2]
mov byte [ebp + esi - 0x30], bl
mov byte [ebp + esi - 0x2f], dl
mov byte [ebp + esi - 0x2e], cl
add esi, 4
cmp eax, 4
jl 0x402160
mov ebx, dword [ebp - 4]
cmp ebx, 0xa
je 0x402292
xor ecx, ecx
mov dword [ebp - 0x10], ecx
nop
lea eax, [ebp + ecx - 0x30]
mov dword [ebp - 0xc], 4
mov dword [ebp - 8], eax
mov edi, 1
movzx eax, byte [eax]
mov byte [ebp + 0xc], al
movzx eax, byte [ebp + ecx - 0x2c]
mov byte [ebp + 0xd], al
movzx eax, byte [ebp + ecx - 0x28]
mov byte [ebp + 0xe], al
movzx eax, byte [ebp + ecx - 0x24]
mov byte [ebp + 0xf], al
mov cl, byte [ebp + edi + 0xb]
mov al, cl
add al, al
test cl, cl
jns 0x40221f
xor al, 0x1b
mov ecx, edi
and ecx, 0x80000003
jns 0x40222e
dec ecx
or ecx, 0xfffffffc
inc ecx
mov cl, byte [ebp + ecx + 0xc]
mov bl, cl
add bl, bl
test cl, cl
jns 0x40223d
xor bl, 0x1b
xor bl, cl
lea ecx, [edi + 1]
and ecx, 0x80000003
jns 0x40224f
dec ecx
or ecx, 0xfffffffc
inc ecx
mov dl, byte [ebp + ecx + 0xc]
lea ecx, [edi + 2]
and ecx, 0x80000003
jns 0x402263
dec ecx
or ecx, 0xfffffffc
inc ecx
mov cl, byte [ebp + ecx + 0xc]
inc edi
xor al, cl
xor al, dl
mov edx, dword [ebp - 8]
xor al, bl
mov byte [edx], al
add edx, 4
sub dword [ebp - 0xc], 1
mov dword [ebp - 8], edx
jne 0x402211
mov ecx, dword [ebp - 0x10]
inc ecx
mov dword [ebp - 0x10], ecx
cmp ecx, 4
jl 0x4021e0
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 0x14]
xor edx, edx
mov ecx, esi
nop dword [eax]
movzx eax, byte [ecx - 4]
lea ecx, [ecx + 1]
xor byte [ebp + edx - 0x30], al
movzx eax, byte [ecx - 1]
xor byte [ebp + edx - 0x2c], al
movzx eax, byte [ecx + 3]
xor byte [ebp + edx - 0x28], al
movzx eax, byte [ecx + 7]
xor byte [ebp + edx - 0x24], al
inc edx
cmp edx, 4
jl 0x4022a0
inc ebx
add esi, 0x10
mov dword [ebp - 4], ebx
cmp ebx, 0xa
mov ebx, dword [ebp - 0x20]
mov dword [ebp - 0x14], esi
jle 0x402110
mov esi, dword [ebp - 0x18]
xor ecx, ecx
mov edx, esi
nop word [eax + eax]
movzx eax, byte [ebp + ecx*4 - 0x30]
lea edx, [edx + 1]
mov byte [esi + ecx - 0xc], al
movzx eax, byte [ebp + ecx*4 - 0x2f]
mov byte [esi + ecx - 8], al
movzx eax, byte [ebp + ecx*4 - 0x2e]
mov byte [edx - 5], al
movzx eax, byte [ebp + ecx*4 - 0x2d]
inc ecx
mov byte [edx - 1], al
cmp ecx, 4
jl 0x4022f0
add esi, 0x10
sub dword [ebp - 0x1c], 1
mov dword [ebp - 0x18], esi
jne 0x402092
mov eax, dword [ebp + 8]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, ecx
pop ebx
mov esp, ebp
pop ebp
ret 8