Function at 0x40a130
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
cmp dword [ebp + 0x14], 0
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
lea ecx, [eax + 0x400]
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x20], ecx
lea edx, [eax + 0x1000]
lea ecx, [eax + 0x800]
mov dword [ebp - 0x1c], edx
mov dword [ebp - 0x24], ecx
lea ecx, [eax + 0xc00]
mov dword [ebp - 0x28], ecx
jne 0x40a180
lea esi, [ebp - 1]
mov dword [ebp - 0x14], 1
mov dword [ebp + 0x14], esi
mov byte [ebp - 1], 0
jmp 0x40a186
mov ecx, dword [ebp + 0x18]
mov dword [ebp - 0x14], ecx
movsx edi, word [ebp + 0x10]
xor ecx, ecx
mov ebx, 0xfffff002
mov dword [ebp - 0x10], ecx
sub ebx, eax
mov esi, edx
mov dword [ebp - 0x18], ebx
nop dword [eax + eax]
mov eax, ecx
add ebx, esi
cdq
idiv edi
mov ecx, dword [ebp + 0xc]
movzx eax, byte [edx + ecx]
shl eax, 0x18
xor dword [esi], eax
lea eax, [ebx - 1]
cdq
idiv edi
mov eax, ebx
movzx ecx, byte [edx + ecx]
cdq
idiv edi
mov eax, dword [ebp + 0xc]
shl ecx, 0x10
xor ecx, dword [esi]
mov dword [esi], ecx
movzx edi, byte [edx + eax]
lea eax, [ebx + 1]
shl edi, 8
xor edi, ecx
cdq
movsx ecx, word [ebp + 0x10]
idiv ecx
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x10]
mov ebx, dword [ebp - 0x18]
add ecx, 4
mov dword [esi], edi
movzx eax, byte [edx + eax]
xor eax, edi
mov dword [ebp - 0x10], ecx
movsx edi, word [ebp + 0x10]
mov dword [esi], eax
add esi, 4
cmp ecx, 0x48
jl 0x40a1a0
mov ecx, dword [ebp + 8]
xor eax, eax
mov esi, dword [ebp + 0x14]
xor ebx, ebx
mov dword [ebp - 8], eax
add ecx, 0x1004
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x14]
movsx edi, ax
mov eax, 2
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x14], ecx
nop dword [eax + eax]
dec eax
cdq
idiv edi
mov eax, dword [ebp - 0xc]
push dword [ebp + 8]
add dword [ebp - 0xc], 8
movzx ecx, byte [edx + esi]
cdq
idiv edi
movzx eax, byte [edx + esi]
shl eax, 8
xor ecx, eax
mov eax, dword [ebp - 0x10]
cdq
idiv edi
shl ecx, 8
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp - 0x10]
inc eax
shl ecx, 8
cdq
idiv edi
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp - 8]
xor eax, ecx
mov dword [ebp - 8], eax
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x10]
add eax, 2
cdq
idiv edi
mov eax, dword [ebp - 0x10]
add eax, 3
movzx ecx, byte [edx + esi]
cdq
idiv edi
shl ecx, 8
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp - 0x10]
add eax, 4
shl ecx, 8
cdq
idiv edi
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp - 0x10]
add eax, 5
add dword [ebp - 0x10], 8
cdq
idiv edi
shl ecx, 8
movzx eax, byte [edx + esi]
xor ecx, eax
lea eax, [ebp - 0x30]
push eax
mov eax, dword [ebp - 8]
xor ebx, ecx
push ebx
push eax
mov dword [ebp - 0x2c], ebx
call fcn.00409d00
mov ecx, dword [ebp - 0x18]
add esp, 0x10
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x30]
mov ebx, dword [ebp - 0x2c]
mov dword [ebp - 8], eax
mov dword [edx + ecx*4], eax
mov eax, dword [ebp - 0x14]
mov dword [eax + ecx*4], ebx
add ecx, 2
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x18], ecx
cmp ecx, 0x12
jl 0x40a230
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x18], 0
lea ecx, [eax + 2]
mov dword [ebp + 0x14], ecx
nop
cdq
idiv edi
mov eax, dword [ebp + 0x14]
dec eax
add dword [ebp - 0xc], 8
push dword [ebp + 8]
movzx ecx, byte [edx + esi]
cdq
idiv edi
shl ecx, 8
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp + 0x14]
cdq
idiv edi
shl ecx, 8
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp + 0x14]
inc eax
shl ecx, 8
cdq
idiv edi
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp - 8]
xor eax, ecx
mov dword [ebp - 8], eax
mov dword [ebp - 0x30], eax
mov eax, dword [ebp + 0x14]
add eax, 2
cdq
idiv edi
mov eax, dword [ebp + 0x14]
add eax, 3
movzx ecx, byte [edx + esi]
cdq
idiv edi
shl ecx, 8
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp + 0x14]
add eax, 4
shl ecx, 8
cdq
idiv edi
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp + 0x14]
add eax, 5
add dword [ebp + 0x14], 8
cdq
idiv edi
shl ecx, 8
movzx eax, byte [edx + esi]
xor ecx, eax
lea eax, [ebp - 0x30]
push eax
mov eax, dword [ebp - 8]
xor ebx, ecx
push ebx
push eax
mov dword [ebp - 0x2c], ebx
call fcn.00409d00
mov edx, dword [ebp - 0x18]
add esp, 0x10
mov ecx, dword [ebp + 8]
mov eax, dword [ebp - 0x30]
mov ebx, dword [ebp - 0x2c]
mov dword [ebp - 8], eax
mov dword [ecx + edx*4], eax
mov eax, dword [ebp - 0xc]
mov dword [ecx + edx*4 + 4], ebx
add edx, 2
mov dword [ebp - 0x18], edx
cmp edx, 0x100
jl 0x40a310
lea ecx, [eax + 2]
mov dword [ebp - 0x18], 0
mov dword [ebp + 0x14], ecx
nop dword [eax]
cdq
idiv edi
mov eax, dword [ebp + 0x14]
dec eax
add dword [ebp - 0xc], 8
push dword [ebp + 8]
movzx ecx, byte [edx + esi]
cdq
idiv edi
shl ecx, 8
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp + 0x14]
cdq
idiv edi
shl ecx, 8
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp + 0x14]
inc eax
shl ecx, 8
cdq
idiv edi
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp - 8]
xor eax, ecx
mov dword [ebp - 8], eax
mov dword [ebp - 0x30], eax
mov eax, dword [ebp + 0x14]
add eax, 2
cdq
idiv edi
mov eax, dword [ebp + 0x14]
add eax, 3
movzx ecx, byte [edx + esi]
cdq
idiv edi
shl ecx, 8
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp + 0x14]
add eax, 4
shl ecx, 8
cdq
idiv edi
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp + 0x14]
add eax, 5
add dword [ebp + 0x14], 8
cdq
idiv edi
shl ecx, 8
movzx eax, byte [edx + esi]
xor ecx, eax
lea eax, [ebp - 0x30]
push eax
mov eax, dword [ebp - 8]
xor ebx, ecx
push ebx
push eax
mov dword [ebp - 0x2c], ebx
call fcn.00409d00
mov ecx, dword [ebp - 0x18]
add esp, 0x10
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x30]
mov ebx, dword [ebp - 0x2c]
mov dword [ebp - 8], eax
mov dword [edx + ecx*4], eax
mov eax, dword [ebp - 0xc]
mov dword [edx + ecx*4 + 4], ebx
add ecx, 2
mov dword [ebp - 0x18], ecx
cmp ecx, 0x100
jl 0x40a3f0
add eax, 2
mov dword [ebp - 0x18], 0
mov dword [ebp + 0x14], eax
nop dword [eax]
dec eax
cdq
idiv edi
mov eax, dword [ebp - 0xc]
push dword [ebp + 8]
add dword [ebp - 0xc], 8
movzx ecx, byte [edx + esi]
cdq
idiv edi
movzx eax, byte [edx + esi]
shl eax, 8
xor ecx, eax
mov eax, dword [ebp + 0x14]
cdq
idiv edi
shl ecx, 8
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp + 0x14]
inc eax
shl ecx, 8
cdq
idiv edi
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp - 8]
xor eax, ecx
mov dword [ebp - 8], eax
mov dword [ebp - 0x30], eax
mov eax, dword [ebp + 0x14]
add eax, 2
cdq
idiv edi
mov eax, dword [ebp + 0x14]
add eax, 3
movzx ecx, byte [edx + esi]
cdq
idiv edi
shl ecx, 8
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp + 0x14]
add eax, 4
shl ecx, 8
cdq
idiv edi
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp + 0x14]
add eax, 5
add dword [ebp + 0x14], 8
cdq
idiv edi
shl ecx, 8
movzx eax, byte [edx + esi]
xor ecx, eax
lea eax, [ebp - 0x30]
push eax
mov eax, dword [ebp - 8]
xor ebx, ecx
push ebx
push eax
mov dword [ebp - 0x2c], ebx
call fcn.00409d00
mov ecx, dword [ebp - 0x18]
add esp, 0x10
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x30]
mov ebx, dword [ebp - 0x2c]
mov dword [ebp - 8], eax
mov dword [edx + ecx*4], eax
mov eax, dword [ebp + 0x14]
mov dword [edx + ecx*4 + 4], ebx
add ecx, 2
mov dword [ebp - 0x18], ecx
cmp ecx, 0x100
jl 0x40a4d0
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x18], 0
lea ecx, [eax + 2]
mov dword [ebp + 0x14], ecx
cdq
idiv edi
mov eax, dword [ebp + 0x14]
dec eax
add dword [ebp - 0xc], 8
push dword [ebp + 8]
movzx ecx, byte [edx + esi]
cdq
idiv edi
shl ecx, 8
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp + 0x14]
cdq
idiv edi
shl ecx, 8
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp + 0x14]
inc eax
shl ecx, 8
cdq
idiv edi
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp - 8]
xor eax, ecx
mov dword [ebp - 8], eax
mov dword [ebp - 0x30], eax
mov eax, dword [ebp + 0x14]
add eax, 2
cdq
idiv edi
mov eax, dword [ebp + 0x14]
add eax, 3
movzx ecx, byte [edx + esi]
cdq
idiv edi
shl ecx, 8
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp + 0x14]
add eax, 4
shl ecx, 8
cdq
idiv edi
movzx eax, byte [edx + esi]
xor ecx, eax
mov eax, dword [ebp + 0x14]
add eax, 5
add dword [ebp + 0x14], 8
cdq
idiv edi
shl ecx, 8
movzx eax, byte [edx + esi]
xor ecx, eax
lea eax, [ebp - 0x30]
push eax
mov eax, dword [ebp - 8]
xor ebx, ecx
push ebx
push eax
mov dword [ebp - 0x2c], ebx
call fcn.00409d00
mov ecx, dword [ebp - 0x18]
add esp, 0x10
mov edx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x30]
mov ebx, dword [ebp - 0x2c]
mov dword [ebp - 8], eax
mov dword [edx + ecx*4], eax
mov eax, dword [ebp - 0xc]
mov dword [edx + ecx*4 + 4], ebx
add ecx, 2
mov dword [ebp - 0x18], ecx
cmp ecx, 0x100
jl 0x40a5b0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret