Function at 0x100040f0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
mov esi, ecx
mov dword [ebp - 8], edx
lea eax, [ebp - 0x14]
push eax
lea edx, [ebp - 0x10]
mov ebx, dword [esi + 0xc]
sub ebx, dword [esi]
and ebx, 0xfffffffc
mov dword [ebp - 0xc], ebx
call fcn.10004020
test eax, eax
jne 0x1000437a
mov ecx, dword [ebp - 0x10]
mov eax, ecx
push edi
sub eax, 0xa4
je 0x1000427d
sub eax, 1
je 0x10004154
cmp ecx, 0xa4
jb 0x10004146
cmp ecx, 0x16c
jbe 0x10004351
pop edi
pop esi
mov eax, 0xb
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov edi, dword [esi + 0xc]
mov eax, edi
mov ecx, dword [esi]
sub eax, ecx
mov edx, dword [esi + 4]
sar eax, 2
add eax, 4
cmp eax, edx
jae 0x100042aa
mov eax, dword [esi + 0xc]
mov edi, dword [edi]
add eax, 4
mov dword [ebp - 0x10], eax
mov dword [esi + 0xc], eax
sub eax, ecx
sar eax, 2
add eax, 4
mov dword [esi + 8], edx
cmp eax, edx
jae 0x100042aa
mov ecx, dword [ebp - 0x10]
mov eax, dword [ecx]
add ecx, 4
mov dword [esi + 8], edx
mov edx, dword [ebp - 0x14]
mov dword [esi + 0xc], ecx
sub ecx, dword [esi]
mov dword [ebp - 0x10], eax
and ecx, 0xfffffffc
lea eax, [edx + ebx]
cmp eax, ecx
jb 0x10004146
mov ebx, edx
sub ebx, ecx
add ebx, dword [ebp - 0xc]
cmp ebx, 0xffff
ja 0x10004146
test bl, 3
jne 0x10004146
mov edx, dword [ebp + 8]
lea eax, [ebp - 4]
push eax
push dword [ebp - 0x10]
push edi
push ecx
mov ecx, dword [ebp - 8]
call fcn.10007d20
cmp eax, 1
jne 0x1000434e
mov eax, dword [ebp - 4]
test eax, eax
jns 0x100041ec
mov eax, dword [ebp + 8]
mov eax, dword [eax]
add eax, eax
lea edx, [ecx + eax*8]
mov ecx, dword [ebp + 0xc]
mov dword [edx + 4], edi
mov eax, ebx
and eax, 0xfffffffc
mov dword [edx], ebx
mov dword [ebp - 8], eax
mov ecx, dword [ecx]
sub ecx, eax
mov dword [ebp - 0x18], edx
mov dword [edx + 0xc], ecx
mov edx, dword [esi + 0xc]
mov eax, edx
sub eax, dword [esi]
sar eax, 2
add eax, ebx
cmp eax, dword [esi + 4]
jae 0x100042aa
push ebx
push edx
push ecx
call fcn.10425d60
mov edx, dword [ebp - 8]
add esp, 0xc
add dword [esi + 0xc], edx
test byte [ebp - 0x10], 0x10
mov eax, dword [esi + 4]
mov dword [esi + 8], eax
je 0x10004261
shr ebx, 1
mov ecx, dword [ebp - 0x18]
mov ecx, dword [ecx + 0xc]
je 0x10004261
mov eax, edi
lea ecx, [ecx + 2]
and eax, 0x7f
inc edi
mov ax, word [eax*2 + 0x10f24df0]
xor word [ecx - 2], ax
sub ebx, 1
jne 0x10004247
mov eax, dword [ebp + 0xc]
mov ebx, dword [ebp - 0xc]
sub dword [eax], edx
cmp dword [ebp - 4], 0
jge 0x10004351
mov eax, dword [ebp + 8]
inc dword [eax]
jmp 0x10004351
mov edx, dword [esi + 0xc]
mov eax, edx
sub eax, dword [esi]
mov ecx, dword [esi + 4]
sar eax, 2
add eax, 4
cmp eax, ecx
jae 0x100042aa
mov edi, dword [edx]
add edx, 4
mov eax, edx
mov dword [esi + 0xc], edx
sub eax, dword [esi]
sar eax, 2
add eax, 4
mov dword [esi + 8], ecx
cmp eax, ecx
jb 0x100042b8
pop edi
pop esi
mov eax, 7
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [edx]
mov dword [ebp + 0xc], eax
lea eax, [edx + 4]
mov edx, dword [ebp + 8]
mov dword [esi + 0xc], eax
lea eax, [ebp - 4]
push eax
push dword [ebp + 0xc]
mov dword [esi + 8], ecx
push edi
push ecx
mov ecx, dword [ebp - 8]
call fcn.10007d20
cmp eax, 1
jne 0x10004351
push 4
lea edx, [ebp - 0x18]
mov ecx, esi
call fcn.10008860
test eax, eax
jne 0x10004379
mov ecx, dword [ebp - 4]
test ecx, ecx
jns 0x10004304
mov edx, dword [ebp + 8]
mov ecx, dword [edx]
lea eax, [ecx + 1]
mov dword [edx], eax
mov eax, dword [ebp - 8]
add ecx, ecx
test byte [ebp + 0xc], 0x10
mov edx, dword [ebp - 0x18]
mov dword [eax + ecx*8 + 4], edi
mov dword [eax + ecx*8], 4
mov dword [eax + ecx*8 + 0xc], edx
je 0x10004351
mov eax, edi
and eax, 0x7f
movzx eax, word [eax*2 + 0x10f24df0]
xor ax, dx
mov edx, dword [ebp - 8]
mov word [edx + ecx*8 + 0xc], ax
lea eax, [edi + 1]
and eax, 0x7f
movzx eax, word [eax*2 + 0x10f24df0]
xor word [edx + ecx*8 + 0xe], ax
jmp 0x10004351
mov ebx, dword [ebp - 0xc]
add ebx, dword [ebp - 0x14]
test bl, 3
je 0x10004367
pop edi
pop esi
mov eax, 6
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp dword [esi + 4], ebx
jbe 0x100042aa
mov eax, dword [esi]
add eax, ebx
mov dword [esi + 0xc], eax
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc