Function at 0x402080
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
push ebx
mov ebx, ecx
mov ecx, 0x51300c
mov dword [ebp - 0x20], ebx
call fcn.004ba18d
mov edx, dword [ebp + 0xc]
mov ecx, dword [ebp + 8]
test edx, edx
jne 0x4020ab
lea eax, [ecx + edx]
inc edx
cmp byte [eax], 0
jne 0x4020a0
test edx, edx
jle 0x402363
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
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 0x4020d0
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 0x402105
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 0x402142
mov esi, 4
mov edi, 3
nop word [eax + eax]
lea eax, [edi - 2]
and eax, 0x80000003
jns 0x40219f
dec eax
or eax, 0xfffffffc
inc eax
add eax, esi
mov bl, byte [ebp + eax - 0x30]
lea eax, [edi - 1]
and eax, 0x80000003
jns 0x4021b4
dec eax
or eax, 0xfffffffc
inc eax
add eax, esi
mov dl, byte [ebp + eax - 0x30]
mov eax, edi
and eax, 0x80000003
jns 0x4021c8
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 0x4021dd
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 0x402190
mov ebx, dword [ebp - 4]
cmp ebx, 0xa
je 0x4022c2
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 0x40224f
xor al, 0x1b
mov ecx, edi
and ecx, 0x80000003
jns 0x40225e
dec ecx
or ecx, 0xfffffffc
inc ecx
mov cl, byte [ebp + ecx + 0xc]
mov bl, cl
add bl, bl
test cl, cl
jns 0x40226d
xor bl, 0x1b
xor bl, cl
lea ecx, [edi + 1]
and ecx, 0x80000003
jns 0x40227f
dec ecx
or ecx, 0xfffffffc
inc ecx
mov dl, byte [ebp + ecx + 0xc]
lea ecx, [edi + 2]
and ecx, 0x80000003
jns 0x402293
dec ecx
or ecx, 0xfffffffc
inc ecx
mov cl, byte [ebp + ecx + 0xc]
inc edi
xor cl, dl
mov edx, dword [ebp - 8]
xor cl, bl
xor cl, al
mov byte [edx], cl
add edx, 4
sub dword [ebp - 0xc], 1
mov dword [ebp - 8], edx
jne 0x402241
mov ecx, dword [ebp - 0x10]
inc ecx
mov dword [ebp - 0x10], ecx
cmp ecx, 4
jl 0x402210
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 0x4022d0
inc ebx
add esi, 0x10
mov dword [ebp - 4], ebx
cmp ebx, 0xa
mov ebx, dword [ebp - 0x20]
mov dword [ebp - 0x14], esi
jle 0x402140
mov esi, dword [ebp - 0x18]
xor ecx, ecx
mov edx, esi
lea eax, [ebp - 0x30]
movzx eax, byte [eax + ecx*4]
lea edx, [edx + 1]
mov byte [esi + ecx - 0xc], al
movzx eax, byte [ebp + ecx*4 - 0x2f]
mov byte [esi + ecx - 8], al
lea eax, [ebp - 0x2e]
movzx eax, byte [eax + ecx*4]
mov byte [edx - 5], al
lea eax, [ebp - 0x2d]
movzx eax, byte [eax + ecx*4]
inc ecx
mov byte [edx - 1], al
cmp ecx, 4
jl 0x402316
add esi, 0x10
sub dword [ebp - 0x1c], 1
mov dword [ebp - 0x18], esi
jne 0x4020c3
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