Function at 0x10040c90
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0xc
push ebx
push ebp
push esi
mov esi, ecx
mov dword [esp + 0x14], esi
mov ebp, dword [esi + 0x1c]
mov ebx, dword [esi + 0xc]
mov dword [esp + 0xc], ebp
cmp ebp, ebx
jge 0x10040f19
push edi
cmp dword [esi + 0x20], ebx
jge 0x10040d15
test ebx, ebx
je 0x10040cce
lea eax, [ebx*4]
push 0x10
push eax
call fcn.1005c880
add esp, 8
mov edi, eax
jmp 0x10040cd0
xor edi, edi
mov edx, dword [esi + 0x1c]
xor ecx, ecx
test edx, edx
jle 0x10040cee
nop dword [eax]
mov eax, dword [esi + 0x24]
mov eax, dword [eax + ecx*4]
mov dword [edi + ecx*4], eax
inc ecx
cmp ecx, edx
jl 0x10040ce0
mov eax, dword [esi + 0x24]
test eax, eax
je 0x10040d0b
cmp byte [esi + 0x28], 0
je 0x10040d04
push eax
call fcn.1005c890
add esp, 4
mov dword [esi + 0x24], 0
mov byte [esi + 0x28], 1
mov dword [esi + 0x24], edi
mov dword [esi + 0x20], ebx
mov edx, ebx
mov ecx, ebp
sub edx, ebp
cmp edx, 4
jb 0x10040d80
mov eax, dword [esi + 0x24]
lea edi, [esi + 0x24]
lea ebp, [eax + ebp*4]
lea eax, [eax + ebx*4]
mov dword [esp + 0x14], ebp
add eax, 0xfffffffc
cmp ebp, edi
ja 0x10040d3b
cmp eax, edi
jae 0x10040d80
and edx, 0x80000003
jns 0x10040d48
dec edx
or edx, 0xfffffffc
inc edx
mov eax, ebx
sub eax, edx
nop dword [eax]
add ecx, 4
mov ebp, ecx
cmp ecx, eax
jl 0x10040d50
sub eax, dword [esp + 0x10]
mov edi, dword [esp + 0x14]
add eax, 3
cdq
and edx, 3
lea ecx, [edx + eax]
xor eax, eax
sar ecx, 2
shl ecx, 4
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, ebp
cmp ebp, ebx
jge 0x10040d8f
nop
mov eax, dword [esi + 0x24]
mov dword [eax + ecx*4], 0
inc ecx
cmp ecx, ebx
jl 0x10040d80
mov dword [esi + 0x1c], ebx
mov edi, dword [esi + 0x30]
cmp ebx, edi
jl 0x10040e80
jle 0x10040e06
cmp dword [esi + 0x34], ebx
jge 0x10040e06
test ebx, ebx
je 0x10040dbe
lea eax, [ebx*4]
push 0x10
push eax
call fcn.1005c880
add esp, 8
mov ebp, eax
jmp 0x10040dc0
xor ebp, ebp
mov edx, dword [esi + 0x30]
xor ecx, ecx
test edx, edx
jle 0x10040ddf
nop dword [eax]
mov eax, dword [esi + 0x38]
mov eax, dword [eax + ecx*4]
mov dword [ebp + ecx*4], eax
inc ecx
cmp ecx, edx
jl 0x10040dd0
mov eax, dword [esi + 0x38]
test eax, eax
je 0x10040dfc
cmp byte [esi + 0x3c], 0
je 0x10040df5
push eax
call fcn.1005c890
add esp, 4
mov dword [esi + 0x38], 0
mov byte [esi + 0x3c], 1
mov dword [esi + 0x38], ebp
mov dword [esi + 0x34], ebx
mov edx, ebx
mov ecx, edi
sub edx, edi
cmp edi, ebx
jge 0x10040e80
cmp edx, 4
jb 0x10040e71
mov eax, dword [esi + 0x38]
lea ebp, [esi + 0x38]
lea esi, [eax + edi*4]
lea eax, [eax + ebx*4]
mov dword [esp + 0x14], esi
add eax, 0xfffffffc
cmp esi, ebp
mov esi, dword [esp + 0x18]
ja 0x10040e34
cmp eax, ebp
jae 0x10040e71
and edx, 0x80000003
jns 0x10040e41
dec edx
or edx, 0xfffffffc
inc edx
mov eax, ebx
sub eax, edx
add ecx, 4
mov ebp, ecx
cmp ecx, eax
jl 0x10040e45
sub eax, edi
mov edi, dword [esp + 0x14]
add eax, 3
cdq
and edx, 3
lea ecx, [edx + eax]
xor eax, eax
sar ecx, 2
shl ecx, 4
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, ebp
cmp ebp, ebx
jge 0x10040e80
mov eax, dword [esi + 0x38]
mov dword [eax + ecx*4], 0
inc ecx
cmp ecx, ebx
jl 0x10040e71
xor ecx, ecx
mov dword [esi + 0x30], ebx
lea edi, [esi + 0x24]
test ebx, ebx
jle 0x10040eaf
nop dword [eax]
mov eax, dword [edi]
mov dword [eax + ecx*4], 0xffffffff
inc ecx
cmp ecx, ebx
jl 0x10040e90
xor ecx, ecx
mov eax, dword [esi + 0x38]
mov dword [eax + ecx*4], 0xffffffff
inc ecx
cmp ecx, ebx
jl 0x10040ea0
xor ebx, ebx
cmp dword [esp + 0x10], ebx
jle 0x10040f18
xor ebp, ebp
nop dword [eax]
mov eax, dword [esi + 0x10]
lea ebp, [ebp + 0xc]
mov ecx, dword [eax + ebp - 8]
shl ecx, 0x10
or ecx, dword [eax + ebp - 0xc]
mov eax, ecx
shl eax, 0xf
not eax
add ecx, eax
mov eax, ecx
shr eax, 0xa
xor eax, ecx
lea ecx, [eax + eax*8]
mov eax, ecx
shr eax, 6
xor ecx, eax
mov eax, ecx
shl eax, 0xb
not eax
add ecx, eax
mov eax, dword [esi + 0xc]
mov edx, ecx
dec eax
shr edx, 0x10
xor edx, ecx
mov ecx, dword [esi + 0x38]
and edx, eax
mov eax, dword [edi]
mov eax, dword [eax + edx*4]
mov dword [ecx + ebx*4], eax
mov eax, dword [edi]
mov dword [eax + edx*4], ebx
inc ebx
cmp ebx, dword [esp + 0x10]
jl 0x10040ec0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret