Function at 0x10003f10
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
cmp dword [ebp + 0xc], 1
mov eax, dword [ebp + 0x14]
push ebx
push esi
mov esi, ecx
mov ecx, dword [ebp + 8]
push edi
mov edi, edx
mov dword [ebp - 0xc], esi
mov dword [ebp - 4], edi
lea ebx, [eax + ecx*4]
mov dword [ebp - 0x10], ebx
ja 0x10003f40
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0x18
mov ecx, dword [ebp + 0x10]
lea edx, [eax + 0x40000]
mov eax, 1
lea edx, [edx + esi*4]
shl eax, cl
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 8], edx
mov dword [ebp - 0x18], eax
cmp ecx, eax
ja 0x100040c0
cmp ecx, dword [ebp + 0x1c]
ja 0x100040c0
mov eax, dword [ebp + 0x14]
lea edi, [eax + esi*4]
mov dword [ebp + 0x18], 0
mov eax, dword [ebx]
add eax, dword [ebp - 4]
mov ecx, eax
mov dword [ebp + 0x1c], 1
sub ecx, esi
cmp eax, esi
cmovb ecx, eax
mov eax, dword [edx + ecx*4]
mov ecx, dword [ebp + 0x10]
mov dword [ebp + 0x14], eax
shl eax, cl
cmp dword [ebp + 0xc], 1
mov dword [edi], eax
jbe 0x10004237
mov ecx, ebx
lea ebx, [edi + 4]
sub ecx, edi
mov dword [ebp - 0x1c], ecx
mov eax, dword [ecx + ebx]
lea ebx, [ebx + 4]
add eax, dword [ebp - 4]
mov ecx, eax
sub ecx, esi
cmp eax, esi
cmovb ecx, eax
mov edx, dword [edx + ecx*4]
mov eax, edx
mov ecx, dword [ebp + 0x10]
xor edx, dword [ebp + 0x14]
shl eax, cl
mov ecx, dword [ebp + 0x1c]
or eax, ecx
mov dword [ebx - 4], eax
inc ecx
mov eax, dword [ebp + 0x18]
or eax, edx
mov dword [ebp + 0x1c], ecx
cmp ecx, dword [ebp + 0xc]
mov edx, dword [ebp - 8]
mov ecx, dword [ebp - 0x1c]
mov dword [ebp + 0x18], eax
jb 0x10003fb0
mov ebx, dword [ebp - 0x10]
test eax, eax
je 0x10004237
mov edx, dword [ebp + 0xc]
mov ecx, edi
call fcn.10014110
mov esi, dword [ebp - 0x18]
xor eax, eax
mov ecx, dword [ebp + 0x10]
dec esi
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 8]
mov dword [ebp + 0x14], eax
mov eax, dword [edi]
mov edx, eax
shr edx, cl
and eax, esi
mov dword [ebp - 0x18], esi
mov esi, 1
mov dword [ebp + 0x1c], edx
mov dword [ebp + 0x18], 0
mov eax, dword [ebx + eax*4]
mov dword [edi], eax
jmp 0x10004039
mov ecx, dword [ebp + 0x10]
mov eax, dword [edi + esi*4]
mov edx, eax
shr edx, cl
mov dword [ebp - 0x1c], eax
cmp edx, dword [ebp + 0x1c]
je 0x1000406c
mov eax, dword [ebp + 8]
add eax, esi
mov dword [ebp + 0x1c], edx
mov dword [ebp + 0x14], eax
mov edx, esi
mov eax, dword [ebp + 0x18]
sub edx, eax
lea ecx, [edi + eax*4]
call fcn.10003ed0
mov eax, dword [ebp - 0x1c]
mov ecx, esi
mov dword [ebp + 0x18], ecx
jmp 0x10004076
mov ecx, dword [ebp + 0x18]
mov dword [ebp - 0x14], 1
and eax, dword [ebp - 0x18]
mov edx, dword [ebp - 8]
mov eax, dword [ebx + eax*4]
mov ebx, dword [ebp + 0x14]
mov dword [edi + esi*4], eax
inc esi
mov dword [edx + eax*4], ebx
mov ebx, dword [ebp - 0x10]
cmp esi, dword [ebp + 0xc]
jb 0x10004036
sub esi, ecx
lea ecx, [edi + ecx*4]
mov edx, esi
call fcn.10003ed0
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x100040b4
sub edi, ebx
mov ecx, dword [edi + ebx]
lea ebx, [ebx + 4]
mov dword [ebx - 4], ecx
sub eax, 1
jne 0x100040a6
mov eax, dword [ebp - 0x14]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18
mov eax, dword [ebx]
add eax, edi
mov ecx, eax
sub ecx, esi
cmp eax, esi
cmovb ecx, eax
mov edi, dword [edx + ecx*4]
mov edx, 1
cmp dword [ebp + 0xc], edx
jbe 0x100040fd
nop word [eax + eax]
mov eax, dword [ebx + edx*4]
add eax, dword [ebp - 4]
mov ecx, eax
sub ecx, esi
cmp eax, esi
cmovb ecx, eax
mov eax, dword [ebp - 8]
cmp dword [eax + ecx*4], edi
jne 0x100040fd
inc edx
cmp edx, dword [ebp + 0xc]
jb 0x100040e0
mov edi, dword [ebp + 0xc]
cmp edx, edi
je 0x1000423a
mov eax, dword [ebp + 0x1c]
cmp eax, 1
jbe 0x1000423a
mov edx, dword [ebp + 0x18]
inc eax
shr eax, 1
mov dword [ebp - 0x1c], eax
add eax, edx
mov dword [ebp - 0x14], eax
mov eax, edi
xor edi, edi
mov edx, dword [ebx + edi*4]
lea ecx, [ebx + edi*4]
mov ecx, dword [ebp - 4]
mov ebx, dword [ebp - 8]
add ecx, edx
mov dword [ebp - 0x18], edx
mov edx, ecx
sub edx, esi
cmp ecx, esi
cmovb edx, ecx
mov ecx, dword [ebp - 0x14]
cmp dword [ebx + edx*4], ecx
mov ebx, dword [ebp - 0x10]
jb 0x10004188
dec eax
cmp eax, edi
jbe 0x1000418d
mov esi, dword [ebx + eax*4]
mov ecx, dword [ebp - 4]
mov ebx, dword [ebp - 8]
add ecx, esi
mov edx, ecx
sub edx, dword [ebp - 0xc]
cmp ecx, dword [ebp - 0xc]
cmovb edx, ecx
mov ecx, dword [ebp - 0x14]
cmp dword [ebx + edx*4], ecx
mov ebx, dword [ebp - 0x10]
jb 0x10004178
dec eax
cmp eax, edi
ja 0x10004150
jmp 0x1000418d
mov edx, dword [ebp - 0x18]
mov dword [ebx + edi*4], esi
mov dword [ebx + eax*4], edx
cmp edi, eax
jae 0x1000418d
mov esi, dword [ebp - 0xc]
inc edi
cmp edi, eax
jb 0x10004126
mov dword [ebp - 0x18], edi
test edi, edi
jne 0x100041a5
mov edx, dword [ebp + 0x18]
mov eax, dword [ebp + 0x1c]
sub edx, ecx
add eax, edx
mov edx, ecx
mov dword [ebp + 0x18], edx
jmp 0x100041b2
mov eax, dword [ebp + 0xc]
cmp edi, eax
jne 0x100041c6
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp + 0x18]
mov esi, dword [ebp - 0xc]
mov edi, dword [ebp + 0xc]
mov dword [ebp + 0x1c], eax
cmp eax, 1
ja 0x10004117
jmp 0x1000423a
mov esi, dword [ebp + 8]
mov ecx, edi
add esi, edi
cmp edi, eax
jae 0x100041e4
mov edx, dword [ebp - 8]
mov edi, eax
mov eax, dword [ebx + ecx*4]
inc ecx
mov dword [edx + eax*4], esi
cmp ecx, edi
jb 0x100041d6
mov edi, dword [ebp - 0x18]
push dword [ebp - 0x1c]
mov eax, dword [ebp + 0x14]
push dword [ebp + 0x18]
mov edx, dword [ebp - 4]
mov ecx, dword [ebp - 0xc]
push eax
push dword [ebp + 0x10]
push edi
push dword [ebp + 8]
call fcn.10003f10
mov ecx, dword [ebp + 0x18]
mov esi, eax
mov eax, dword [ebp - 0x14]
sub ecx, eax
add ecx, dword [ebp + 0x1c]
mov edx, dword [ebp - 4]
push ecx
mov ecx, dword [ebp - 0xc]
push eax
push dword [ebp + 0x14]
mov eax, dword [ebp + 0xc]
push dword [ebp + 0x10]
sub eax, edi
push eax
mov eax, dword [ebp + 8]
add eax, edi
push eax
call fcn.10003f10
pop edi
or eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18
mov edi, dword [ebp + 0xc]
mov edx, edi
mov ecx, ebx
call fcn.10003ed0
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret 0x18