Function at 0x402a20
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x154
cmp dword [ebp + 0xc], 0x100
push ebx
push esi
push edi
jbe 0x402a43
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x400]
mov dword [ebp - 0x34], ecx
jmp 0x402a4a
mov dword [ebp - 0x34], 0x10
push 0x44
lea eax, [ebp - 0x8c]
push 0
push eax
call fcn.00407942
add esp, 0xc
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
mov edx, dword [eax]
add eax, 4
inc dword [ebp + edx*4 - 0x8c]
dec ecx
jne 0x402a63
mov eax, dword [ebp + 0xc]
cmp dword [ebp - 0x8c], eax
jne 0x402a8e
xor eax, eax
mov ecx, dword [ebp + 0x1c]
mov edx, dword [ebp + 0x20]
mov dword [ecx], eax
mov dword [edx], eax
jmp 0x402e81
mov ecx, 1
lea eax, [ebp - 0x88]
cmp dword [eax], 0
jne 0x402aa9
add eax, 4
inc ecx
lea edx, [ebp - 0x4c]
cmp eax, edx
jbe 0x402a99
mov edx, dword [ebp + 0x20]
mov dword [ebp - 0x14], ecx
mov esi, ecx
cmp dword [edx], ecx
jae 0x402ab7
mov dword [edx], esi
mov edi, 0x10
lea eax, [ebp - 0x4c]
cmp dword [eax], 0
jne 0x402ad2
sub eax, 4
dec edi
lea edx, [ebp - 0x8c]
cmp eax, edx
jne 0x402abf
mov edx, dword [ebp + 0x20]
mov dword [ebp - 0x24], edi
cmp dword [edx], edi
jbe 0x402ade
mov dword [edx], edi
mov eax, 1
shl eax, cl
mov dword [ebp - 0x20], eax
cmp ecx, edi
jae 0x402b0a
lea eax, [ebp + ecx*4 - 0x8c]
mov edx, dword [eax]
sub dword [ebp - 0x20], edx
js 0x402b22
add eax, 4
inc ecx
mov edx, dword [ebp - 0x20]
add edx, edx
cmp ecx, edi
mov dword [ebp - 0x20], edx
jb 0x402af3
lea ecx, [ebp + edi*4 - 0x8c]
mov eax, dword [ecx]
sub dword [ebp - 0x20], eax
jns 0x402b2c
mov eax, 2
jmp 0x402e81
mov eax, 2
jmp 0x402e81
add eax, dword [ebp - 0x20]
xor edx, edx
dec edi
mov dword [ecx], eax
lea eax, [ebp - 0x88]
lea ecx, [ebp - 0x10c]
mov dword [ebp - 0x110], edx
je 0x402b55
add edx, dword [eax]
add eax, 4
mov dword [ecx], edx
add ecx, 4
dec edi
jne 0x402b48
mov edx, dword [ebp + 8]
xor edi, edi
mov eax, dword [edx]
add edx, 4
test eax, eax
je 0x402b76
lea ecx, [ebp + eax*4 - 0x114]
mov eax, dword [ecx]
inc eax
mov dword [ecx], eax
mov dword [eax*4 + 0x408c14], edi
inc edi
cmp edi, dword [ebp + 0xc]
jb 0x402b5a
mov dword [ebp - 0x30], 0x408c18
mov dword [ebp - 0x28], 0xffffffff
xor ebx, ebx
xor edx, edx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x114], ebx
mov dword [ebp - 0xd0], ebx
mov dword [ebp - 8], ebx
mov dword [ebp - 0x154], ebx
mov dword [ebp - 0x2c], ebx
cmp esi, dword [ebp - 0x24]
jg 0x402e46
mov eax, dword [ebp - 0x14]
lea ecx, [ebp + eax*4 - 0x8c]
mov dword [ebp - 0x44], ecx
mov eax, dword [ecx]
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x38]
dec dword [ebp - 0x38]
test eax, eax
je 0x402e37
mov eax, dword [ebp - 0x28]
shl eax, 2
mov ecx, dword [ebp + eax - 0xcc]
add ecx, dword [ebp - 8]
cmp ecx, dword [ebp - 0x14]
jge 0x402d2f
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x38]
inc eax
mov dword [ebp - 0x48], eax
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0xc]
mov esi, dword [ebp - 0x24]
mov edx, dword [ebp + 0x20]
add eax, dword [ebp + ecx - 0xcc]
inc dword [ebp - 0x28]
sub esi, eax
mov dword [ebp - 8], eax
add dword [ebp - 0xc], 4
mov eax, dword [edx]
cmp esi, eax
jbe 0x402c1c
mov esi, eax
mov eax, dword [ebp - 0x14]
mov edx, 1
sub eax, dword [ebp - 8]
mov cl, al
mov dword [ebp - 4], eax
shl edx, cl
cmp edx, dword [ebp - 0x48]
jbe 0x402c59
mov eax, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x44]
inc eax
inc dword [ebp - 4]
sub edx, eax
cmp dword [ebp - 4], esi
jae 0x402c59
add edx, edx
add ecx, 4
mov eax, dword [ecx]
cmp edx, eax
jbe 0x402c59
sub edx, eax
inc dword [ebp - 4]
cmp dword [ebp - 4], esi
jb 0x402c44
mov ecx, dword [ebp - 8]
mov eax, dword [ebp - 4]
add eax, ecx
cmp eax, dword [ebp - 0x34]
jbe 0x402c73
cmp dword [ebp - 0x34], ecx
jbe 0x402c73
mov eax, dword [ebp - 0x34]
sub eax, ecx
mov dword [ebp - 4], eax
mov eax, 1
mov cl, byte [ebp - 4]
shl eax, cl
mov ecx, dword [ebp - 0xc]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 4]
lea edx, [ebp + ecx - 0xcc]
mov dword [ebp - 0x3c], edx
mov dword [edx], eax
mov eax, dword [ebp - 0x2c]
inc eax
imul eax, eax, 6
push eax
call fcn.004078e9
add esp, 4
test eax, eax
je 0x402e64
lea edx, [eax + 6]
mov ecx, dword [ebp - 0x2c]
inc ecx
mov esi, dword [ebp + 0x1c]
add eax, 2
add dword [0x43a9ac], ecx
mov ecx, dword [ebp - 0xc]
mov dword [esi], edx
mov dword [ebp + 0x1c], eax
mov dword [eax], 0
mov dword [ebp + ecx - 0x154], edx
test ecx, ecx
je 0x402d1e
mov eax, dword [ebp - 0x10]
mov dword [ebp + ecx - 0x114], eax
mov al, byte [ebp + ecx - 0xd0]
mov cl, byte [ebp - 8]
mov byte [ebp - 0x40], al
lea esi, [ebp - 0x1c]
mov edi, 1
mov byte [ebp - 0x1b], al
mov dword [ebp - 0x1a], edx
shl edi, cl
mov al, byte [ebp - 4]
dec edi
add al, 0x10
and edi, dword [ebp - 0x10]
sub cl, byte [ebp - 0x40]
mov byte [ebp - 0x1c], al
shr edi, cl
mov ecx, dword [ebp - 0xc]
imul edi, edi, 6
add edi, dword [ebp + ecx - 0x158]
movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov ecx, dword [ebp - 0x3c]
mov eax, dword [ecx]
add eax, dword [ebp - 8]
cmp eax, dword [ebp - 0x14]
jl 0x402bf5
mov cl, byte [ebp - 0x14]
mov eax, dword [ebp + 0xc]
sub cl, byte [ebp - 8]
lea esi, [eax*4 + 0x408c18]
mov byte [ebp - 0x1b], cl
cmp esi, dword [ebp - 0x30]
ja 0x402d4d
mov byte [ebp - 0x1c], 0x63
jmp 0x402d8a
mov eax, dword [ebp - 0x30]
mov esi, dword [eax]
cmp esi, dword [ebp + 0x10]
jae 0x402d6d
mov byte [ebp - 4], 0x10
cmp esi, 0x100
adc byte [ebp - 4], 0xff
mov al, byte [ebp - 4]
mov byte [ebp - 0x1c], al
jmp 0x402d82
sub esi, dword [ebp + 0x10]
mov eax, dword [ebp + 0x18]
add esi, esi
mov edi, dword [ebp + 0x14]
mov al, byte [eax + esi]
mov si, word [edi + esi]
mov byte [ebp - 0x1c], al
add dword [ebp - 0x30], 4
mov word [ebp - 0x1a], si
mov eax, 1
shl eax, cl
mov cl, byte [ebp - 8]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x10]
shr eax, cl
mov dword [ebp - 4], eax
cmp eax, dword [ebp - 0x2c]
jae 0x402dcc
imul eax, eax, 6
lea ecx, [eax + edx]
mov eax, dword [ebp - 0xc]
imul eax, eax, 6
mov dword [ebp - 0x3c], eax
lea esi, [ebp - 0x1c]
mov edi, ecx
movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
add ecx, dword [ebp - 0x3c]
mov eax, dword [ebp - 0xc]
mov esi, dword [ebp - 0x2c]
add dword [ebp - 4], eax
cmp dword [ebp - 4], esi
jb 0x402db3
mov eax, 1
mov cl, byte [ebp - 0x14]
dec cl
shl eax, cl
test dword [ebp - 0x10], eax
je 0x402de7
xor dword [ebp - 0x10], eax
shr eax, 1
test dword [ebp - 0x10], eax
jne 0x402ddd
mov esi, dword [ebp - 0x28]
mov cl, byte [ebp - 8]
shl esi, 2
xor dword [ebp - 0x10], eax
mov eax, 1
shl eax, cl
dec eax
and eax, dword [ebp - 0x10]
cmp eax, dword [ebp + esi - 0x114]
je 0x402bc4
mov eax, dword [ebp + esi - 0xd0]
sub esi, 4
dec dword [ebp - 0x28]
sub dword [ebp - 8], eax
mov eax, 1
mov cl, byte [ebp - 8]
shl eax, cl
dec eax
and eax, dword [ebp - 0x10]
cmp eax, dword [ebp + esi - 0x114]
jne 0x402e0b
jmp 0x402bc4
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x24]
jle 0x402bb2
mov eax, dword [ebp - 0xcc]
mov edx, dword [ebp + 0x20]
cmp dword [ebp - 0x20], 0
mov dword [edx], eax
je 0x402e7f
cmp dword [ebp - 0x24], 1
je 0x402e7f
mov eax, 1
jmp 0x402e81
cmp dword [ebp - 0x28], 0
je 0x402e78
push dword [ebp - 0x154]
call fcn.00402e88
add esp, 4
mov eax, 3
jmp 0x402e81
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret