Function at 0x406110
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x50
mov eax, dword [esp + 0xa8]
mov edi, dword [esp + 0x64]
mov ecx, dword [edi + 0x48]
mov ebx, dword [ecx + 4]
mov dword [esp + 0x4c], ebx
test eax, eax
je 0x406142
cmp dword [ecx + 0x34], 0
jne 0x406142
mov dword [edi + 0x1c], 3
jmp 0x4066dd
mov dword [esp], ecx
movzx ecx, word [esp + 0x74]
movzx esi, word [esp + 0x6c]
movzx ecx, cx
movzx ebp, word [esp + 0x7c]
mov dword [esp + 0x3c], ecx
mov edx, esi
mov dword [esp + 0x40], esi
add ecx, esi
add ecx, ebp
mov esi, dword [esp + 0xb4]
xor edx, edx
add ecx, esi
setb dl
add ecx, ebx
adc edx, 0
add ecx, 0x2e
adc edx, 0
cmp ecx, 0xffffffff
sbb edx, 0
jb 0x406192
mov dword [edi + 0x1c], 0xf
jmp 0x4066dd
mov dword [esp + 0x38], ebp
mov dword [esp + 4], ebx
mov ebp, dword [esp + 0x8c]
mov ecx, dword [esp + 0x84]
mov dword [esp + 0x44], ecx
mov dword [esp + 0xe], 0
mov dword [esp + 0x12], 0
mov dword [esp + 0x16], 0
mov dword [esp + 0x1a], 0
mov dword [esp + 0x1e], 0
mov dword [esp + 0x22], 0
mov dword [esp + 0x26], 0
mov dword [esp + 0x2a], 0
mov word [esp + 0x2e], 0
mov dword [esp + 0xa], 0x2014b50
movzx edi, word [esp + 0x94]
mov ecx, dword [esp + 0x90]
movzx edx, word [esp + 0x74]
add edx, esi
mov dword [esp + 0x48], edx
xor ebx, ebx
mov edx, 0
mov esi, edi
test di, di
je 0x406225
mov dl, 0x14
mov byte [esp + 0x10], dl
movzx edx, word [esp + 0x98]
mov byte [esp + 0x12], dl
mov byte [esp + 0x13], dh
mov edx, esi
mov byte [esp + 0x14], dl
mov byte [esp + 0x15], dh
movzx edx, word [esp + 0x9c]
mov byte [esp + 0x16], dl
mov byte [esp + 0x17], dh
movzx edx, word [esp + 0xa0]
mov byte [esp + 0x18], dl
mov byte [esp + 0x19], dh
mov byte [esp + 0x1a], cl
mov byte [esp + 0x1b], ch
mov edx, ecx
shr edx, 0x10
mov byte [esp + 0x1c], dl
shr ecx, 0x18
neg ebp
mov edx, 0
sbb edx, edx
mov byte [esp + 0x1d], cl
or edx, dword [esp + 0x88]
mov byte [esp + 0x1e], dl
mov byte [esp + 0x1f], dh
mov ecx, edx
shr ecx, 0x10
mov byte [esp + 0x20], cl
shr edx, 0x18
neg dword [esp + 0x44]
mov ecx, 0
sbb ecx, ecx
mov byte [esp + 0x21], dl
or ecx, dword [esp + 0x80]
mov byte [esp + 0x22], cl
mov byte [esp + 0x23], ch
mov edx, ecx
shr edx, 0x10
mov byte [esp + 0x24], dl
shr ecx, 0x18
mov byte [esp + 0x25], cl
movzx ecx, word [esp + 0x6c]
mov byte [esp + 0x26], cl
mov byte [esp + 0x27], ch
mov ecx, dword [esp + 0x48]
mov byte [esp + 0x28], cl
mov byte [esp + 0x29], ch
movzx ecx, word [esp + 0x7c]
mov byte [esp + 0x2a], cl
mov byte [esp + 0x2b], ch
mov edx, dword [esp + 0xac]
mov byte [esp + 0x30], dl
mov byte [esp + 0x31], dh
mov ecx, edx
shr ecx, 0x10
mov byte [esp + 0x32], cl
shr edx, 0x18
neg eax
sbb ebx, ebx
mov byte [esp + 0x33], dl
or ebx, dword [esp + 0xa4]
mov byte [esp + 0x34], bl
mov byte [esp + 0x35], bh
mov eax, ebx
shr eax, 0x10
mov byte [esp + 0x36], al
shr ebx, 0x18
mov byte [esp + 0x37], bl
mov ebp, dword [esp + 4]
lea edi, [ebp + 0x2e]
mov esi, dword [esp]
mov ebx, dword [esi + 8]
cmp ebx, edi
jae 0x4063a2
cmp ebx, 1
adc ebx, 0
cmp edi, 2
jb 0x40637c
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, ebx
and eax, 0xfffffffd
mov ecx, ebx
and ecx, 2
or ebx, 2
imul ebx, ecx
xor ecx, 2
imul ecx, eax
add ebx, ecx
cmp ebx, edi
jb 0x406360
push ebx
push dword [esi + 0xc]
push dword [esi]
mov eax, dword [esp + 0x70]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
je 0x4066ae
mov dword [esi], eax
mov dword [esi + 8], ebx
mov ebp, dword [esp + 4]
jmp 0x4063a4
mov eax, dword [esi]
mov dword [esi + 4], edi
mov ecx, dword [esi + 0xc]
mov edi, ecx
or edi, ebp
mov edx, ecx
and edx, ebp
imul edx, edi
add edx, eax
mov eax, ebp
not eax
and eax, ecx
imul edi, ecx, 0x2e
not ecx
and ecx, ebp
imul ecx, eax
add ecx, edx
lea eax, [esp + 0xa]
push edi
push eax
push ecx
call fcn.00408910
add esp, 0xc
mov ebx, dword [esi + 4]
mov edi, dword [esi + 8]
mov eax, dword [esp + 0x40]
lea ebp, [ebx + eax]
cmp edi, ebp
jae 0x40643c
cmp edi, 1
adc edi, 0
cmp ebp, 2
jb 0x40641c
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, edi
and eax, 0xfffffffd
mov ecx, edi
and ecx, 2
or edi, 2
imul edi, ecx
xor ecx, 2
imul ecx, eax
add edi, ecx
cmp edi, ebp
jb 0x406400
push edi
push dword [esi + 0xc]
push dword [esi]
mov eax, dword [esp + 0x70]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
je 0x4066ae
mov dword [esi], eax
mov dword [esi + 8], edi
movzx ecx, word [esp + 0x74]
mov dword [esi + 4], ebp
cmp word [esp + 0x6c], 0
je 0x40648e
mov ecx, dword [esi + 0xc]
mov eax, ecx
mov edx, ebx
not edx
and edx, ecx
mov edi, ecx
mov ebp, dword [esp + 0x40]
imul ebp, ecx
or ecx, ebx
and eax, ebx
imul eax, ecx
not edi
and edi, ebx
imul edi, edx
add eax, dword [esi]
add eax, edi
push ebp
push dword [esp + 0x6c]
push eax
call fcn.00408910
movzx ecx, word [esp + 0x80]
add esp, 0xc
mov ebp, dword [esi + 4]
mov edi, dword [esi + 8]
mov eax, dword [esp + 0x3c]
lea ebx, [eax + ebp]
cmp edi, ebx
mov eax, dword [esp + 0xb4]
jae 0x4064f8
cmp edi, 1
adc edi, 0
cmp ebx, 2
jb 0x4064cc
nop
nop
nop
nop
nop
mov eax, edi
and eax, 0xfffffffd
mov ecx, edi
and ecx, 2
or edi, 2
imul edi, ecx
xor ecx, 2
imul ecx, eax
add edi, ecx
cmp edi, ebx
jb 0x4064b0
push edi
push dword [esi + 0xc]
push dword [esi]
mov eax, dword [esp + 0x70]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
je 0x4066ae
mov dword [esi], eax
mov dword [esi + 8], edi
mov eax, dword [esp + 0xb4]
movzx ecx, word [esp + 0x74]
mov dword [esi + 4], ebx
test cx, cx
je 0x406541
mov ecx, dword [esi + 0xc]
mov eax, ecx
mov edx, ebp
not edx
and edx, ecx
mov edi, ecx
mov ebx, dword [esp + 0x3c]
imul ebx, ecx
or ecx, ebp
and eax, ebp
imul eax, ecx
not edi
and edi, ebp
imul edi, edx
add eax, dword [esi]
add eax, edi
push ebx
push dword [esp + 0x74]
push eax
call fcn.00408910
mov eax, dword [esp + 0xc0]
add esp, 0xc
mov ebx, dword [esi + 4]
mov edi, dword [esi + 8]
lea ebp, [ebx + eax]
cmp edi, ebp
jae 0x4065a3
cmp edi, 1
adc edi, 0
cmp ebp, 2
jb 0x40657c
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, edi
and eax, 0xfffffffd
mov ecx, edi
and ecx, 2
or edi, 2
imul edi, ecx
xor ecx, 2
imul ecx, eax
add edi, ecx
cmp edi, ebp
jb 0x406560
push edi
push dword [esi + 0xc]
push dword [esi]
mov eax, dword [esp + 0x70]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
je 0x4066ae
mov dword [esi], eax
mov dword [esi + 8], edi
mov eax, dword [esp + 0xb4]
mov dword [esi + 4], ebp
test eax, eax
je 0x4065ef
mov esi, eax
mov eax, dword [esp]
mov ecx, dword [eax + 0xc]
mov eax, ecx
mov edx, ebx
not edx
and edx, ecx
mov edi, ecx
imul esi, ecx
or ecx, ebx
and eax, ebx
imul eax, ecx
not edi
and edi, ebx
imul edi, edx
mov ecx, dword [esp]
add eax, dword [ecx]
add eax, edi
push esi
mov esi, dword [esp + 4]
push dword [esp + 0xb4]
push eax
call fcn.00408910
add esp, 0xc
mov ebp, dword [esi + 4]
mov edi, dword [esi + 8]
mov eax, dword [esp + 0x38]
lea ebx, [eax + ebp]
cmp edi, ebx
jae 0x406613
mov ecx, dword [esp + 0x64]
mov edx, esi
push 1
push ebx
call fcn.00408740
add esp, 8
test eax, eax
je 0x4066ae
mov dword [esi + 4], ebx
cmp word [esp + 0x7c], 0
je 0x406652
mov ecx, dword [esi + 0xc]
mov eax, ecx
mov edx, ebp
not edx
and edx, ecx
mov edi, ecx
mov ebx, dword [esp + 0x38]
imul ebx, ecx
or ecx, ebp
and eax, ebp
imul eax, ecx
not edi
and edi, ebp
imul edi, edx
add eax, dword [esi]
add eax, edi
push ebx
push dword [esp + 0x7c]
push eax
call fcn.00408910
add esp, 0xc
mov edi, dword [esi + 0x14]
lea ebx, [edi + 1]
cmp dword [esi + 0x18], ebx
jae 0x406673
lea edx, [esi + 0x10]
mov ecx, dword [esp + 0x64]
push 1
push ebx
call fcn.00408740
add esp, 8
test eax, eax
je 0x4066ae
mov dword [esi + 0x14], ebx
mov ecx, dword [esi + 0x1c]
mov edx, ecx
or edx, edi
mov eax, ecx
and eax, edi
imul eax, edx
mov edx, edi
not edx
and edx, ecx
mov ebx, ecx
not ebx
and ebx, edi
imul ebx, edx
add eax, dword [esi + 0x10]
add eax, ebx
lea edx, [esp + 0x4c]
push ecx
push edx
push eax
call fcn.00408910
add esp, 0xc
mov eax, 1
jmp 0x4066df
mov ebx, dword [esp + 4]
cmp dword [esi + 8], ebx
mov edi, dword [esp + 0x64]
jae 0x4066d3
push ebx
push dword [esi + 0xc]
push dword [esi]
push dword [edi + 0x34]
call dword [edi + 0x30]
add esp, 0x10
test eax, eax
je 0x4066d6
mov dword [esi], eax
mov dword [esi + 8], ebx
mov dword [esi + 4], ebx
mov dword [edi + 0x1c], 0x10
xor eax, eax
add esp, 0x50
pop esi
pop edi
pop ebx
pop ebp
ret