Function at 0x40a260
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x50
mov eax, dword [esp + 0xa8]
mov esi, dword [esp + 0x64]
mov ecx, dword [esi + 0x48]
mov edi, dword [ecx + 4]
mov dword [esp + 0x4c], edi
test eax, eax
je 0x40a292
cmp dword [ecx + 0x34], 0
jne 0x40a292
mov dword [esi + 0x1c], 3
jmp 0x40a8f1
mov dword [esp], ecx
movzx ecx, word [esp + 0x74]
movzx ebp, word [esp + 0x6c]
movzx ecx, cx
movzx ebx, word [esp + 0x7c]
mov dword [esp + 0x3c], ecx
mov edx, ebp
mov dword [esp + 0x40], ebp
add ecx, ebp
add ecx, ebx
mov ebp, dword [esp + 0xb4]
xor edx, edx
add ecx, ebp
setb dl
add ecx, edi
adc edx, 0
add ecx, 0x2e
adc edx, 0
cmp ecx, 0xffffffff
sbb edx, 0
jb 0x40a2e2
mov dword [esi + 0x1c], 0xf
jmp 0x40a8f1
mov dword [esp + 0x38], ebx
mov dword [esp + 4], edi
mov edi, dword [esp + 0x8c]
mov ecx, ebp
mov edx, dword [esp + 0x84]
mov dword [esp + 0x44], edx
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 esi, word [esp + 0x94]
mov ebx, dword [esp + 0x90]
movzx edx, word [esp + 0x74]
lea ecx, [edx + ebp]
mov dword [esp + 0x48], ecx
xor ecx, ecx
mov edx, 0
mov ebp, esi
test si, si
je 0x40a378
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, ebp
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], bl
mov byte [esp + 0x1b], bh
mov edx, ebx
shr edx, 0x10
mov byte [esp + 0x1c], dl
shr ebx, 0x18
neg edi
mov edx, 0
sbb edx, edx
mov byte [esp + 0x1d], bl
or edx, dword [esp + 0x88]
mov byte [esp + 0x1e], dl
mov byte [esp + 0x1f], dh
mov ebx, edx
shr ebx, 0x10
mov byte [esp + 0x20], bl
shr edx, 0x18
neg dword [esp + 0x44]
mov ebx, 0
sbb ebx, ebx
mov byte [esp + 0x21], dl
or ebx, dword [esp + 0x80]
mov byte [esp + 0x22], bl
mov byte [esp + 0x23], bh
mov edx, ebx
shr edx, 0x10
mov byte [esp + 0x24], dl
shr ebx, 0x18
mov byte [esp + 0x25], bl
movzx edx, word [esp + 0x6c]
mov byte [esp + 0x26], dl
mov byte [esp + 0x27], dh
mov edx, dword [esp + 0x48]
mov byte [esp + 0x28], dl
mov byte [esp + 0x29], dh
movzx edx, word [esp + 0x7c]
mov byte [esp + 0x2a], dl
mov byte [esp + 0x2b], dh
mov ebx, dword [esp + 0xac]
mov byte [esp + 0x30], bl
mov byte [esp + 0x31], bh
mov edx, ebx
shr edx, 0x10
mov byte [esp + 0x32], dl
shr ebx, 0x18
neg eax
sbb ecx, ecx
mov byte [esp + 0x33], bl
or ecx, dword [esp + 0xa4]
mov byte [esp + 0x34], cl
mov byte [esp + 0x35], ch
mov eax, ecx
shr eax, 0x10
mov byte [esp + 0x36], al
shr ecx, 0x18
mov byte [esp + 0x37], cl
mov ebp, dword [esp + 4]
lea esi, [ebp + 0x2e]
mov edx, dword [esp]
mov eax, dword [edx + 8]
cmp eax, esi
jae 0x40a4ce
cmp eax, 1
adc eax, 0
cmp esi, 2
jb 0x40a4d2
mov edi, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ecx, eax
or ecx, 2
and edi, 2
imul ecx, edi
and eax, 0xfffffffd
xor edi, 2
imul edi, eax
add edi, ecx
mov eax, edi
cmp edi, esi
jb 0x40a4b0
jmp 0x40a4d4
mov eax, dword [edx]
jmp 0x40a4fc
mov edi, eax
push edi
push dword [edx + 0xc]
push dword [edx]
mov eax, dword [esp + 0x70]
push dword [eax + 0x34]
call dword [eax + 0x30]
mov edx, dword [esp + 0x10]
add esp, 0x10
test eax, eax
je 0x40a8be
mov dword [edx], eax
mov dword [edx + 8], edi
mov ebp, dword [esp + 4]
mov dword [edx + 4], esi
mov ecx, dword [edx + 0xc]
mov edx, ecx
not edx
mov esi, ebp
and esi, edx
mov edi, ebp
not edi
and edi, ecx
imul edi, esi
mov ebx, ecx
and ebx, ebp
mov esi, ecx
or esi, ebp
imul esi, ebx
add esi, eax
add esi, edi
mov eax, ecx
and eax, 0xffffffd1
and edx, 0x2e
imul edx, eax
mov eax, ecx
and eax, 0x2e
or ecx, 0x2e
imul ecx, eax
add ecx, edx
lea eax, [esp + 0xa]
push ecx
push eax
push esi
call fcn.0040ca30
mov edx, dword [esp + 0xc]
add esp, 0xc
mov edi, dword [edx + 4]
mov eax, dword [edx + 8]
mov ecx, dword [esp + 0x40]
lea ebp, [edi + ecx]
cmp eax, ebp
jae 0x40a58e
cmp eax, 1
adc eax, 0
cmp ebp, 2
jb 0x40a592
mov ebx, eax
nop
nop
nop
nop
nop
mov ecx, eax
or ecx, 2
and ebx, 2
imul ecx, ebx
and eax, 0xfffffffd
xor ebx, 2
imul ebx, eax
add ebx, ecx
mov eax, ebx
cmp ebx, ebp
jb 0x40a570
jmp 0x40a594
mov ebx, eax
jmp 0x40a5b8
mov ebx, eax
push ebx
push dword [edx + 0xc]
push dword [edx]
mov eax, dword [esp + 0x70]
push dword [eax + 0x34]
call dword [eax + 0x30]
mov edx, dword [esp + 0x10]
add esp, 0x10
test eax, eax
je 0x40a8be
mov dword [edx], eax
mov dword [edx + 8], ebx
mov dword [edx + 4], ebp
cmp word [esp + 0x6c], 0
je 0x40a619
mov eax, dword [edx + 0xc]
mov edx, edi
mov esi, edi
mov ecx, eax
and ecx, edi
or edi, eax
imul edi, ecx
mov ecx, eax
not ecx
and edx, ecx
not esi
and esi, eax
mov ebx, dword [esp]
add edi, dword [ebx]
imul esi, edx
add edi, esi
mov esi, dword [esp + 0x40]
mov edx, esi
not edx
and edx, eax
and ecx, esi
imul ecx, edx
mov edx, eax
and edx, esi
or eax, esi
imul eax, edx
add eax, ecx
push eax
push dword [esp + 0x6c]
push edi
call fcn.0040ca30
mov edx, dword [esp + 0xc]
add esp, 0xc
mov ebp, dword [edx + 4]
mov ebx, dword [edx + 8]
mov eax, dword [esp + 0x3c]
lea edi, [eax + ebp]
cmp ebx, edi
jae 0x40a65e
cmp ebx, 1
adc ebx, 0
cmp edi, 2
jb 0x40a662
mov esi, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, ebx
or eax, 2
and esi, 2
imul eax, esi
and ebx, 0xfffffffd
xor esi, 2
imul esi, ebx
add esi, eax
mov ebx, esi
cmp esi, edi
jb 0x40a640
jmp 0x40a664
mov esi, ebx
jmp 0x40a688
mov esi, ebx
push esi
push dword [edx + 0xc]
push dword [edx]
mov eax, dword [esp + 0x70]
push dword [eax + 0x34]
call dword [eax + 0x30]
mov edx, dword [esp + 0x10]
add esp, 0x10
test eax, eax
je 0x40a8be
mov dword [edx], eax
mov dword [edx + 8], esi
movzx eax, word [esp + 0x74]
mov dword [edx + 4], edi
test ax, ax
je 0x40a6eb
mov eax, dword [edx + 0xc]
mov edx, ebp
mov esi, ebp
mov ecx, eax
and ecx, ebp
or ebp, eax
imul ebp, ecx
mov ecx, eax
not ecx
and edx, ecx
not esi
and esi, eax
mov edi, dword [esp]
add ebp, dword [edi]
imul esi, edx
add ebp, esi
mov esi, dword [esp + 0x3c]
mov edx, esi
not edx
and edx, eax
and ecx, esi
imul ecx, edx
mov edx, eax
and edx, esi
or eax, esi
imul eax, edx
add eax, ecx
push eax
push dword [esp + 0x74]
push ebp
call fcn.0040ca30
mov edx, dword [esp + 0xc]
add esp, 0xc
mov edi, dword [edx + 4]
mov esi, dword [edx + 8]
mov eax, dword [esp + 0xb4]
lea ebp, [edi + eax]
cmp esi, ebp
jae 0x40a72e
cmp esi, 1
adc esi, 0
cmp ebp, 2
jb 0x40a732
mov ebx, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, esi
or eax, 2
and ebx, 2
imul eax, ebx
and esi, 0xfffffffd
xor ebx, 2
imul ebx, esi
add ebx, eax
mov esi, ebx
cmp ebx, ebp
jb 0x40a710
jmp 0x40a734
mov ebx, esi
jmp 0x40a758
mov ebx, esi
push ebx
push dword [edx + 0xc]
push dword [edx]
mov eax, dword [esp + 0x70]
push dword [eax + 0x34]
call dword [eax + 0x30]
mov edx, dword [esp + 0x10]
add esp, 0x10
test eax, eax
je 0x40a8be
mov dword [edx], eax
mov dword [edx + 8], ebx
mov dword [edx + 4], ebp
mov eax, dword [esp + 0xb4]
test eax, eax
je 0x40a7bd
mov ebp, eax
mov eax, dword [edx + 0xc]
mov edx, edi
mov esi, edi
mov ecx, eax
and ecx, edi
or edi, eax
imul edi, ecx
mov ecx, eax
not ecx
and edx, ecx
not esi
and esi, eax
mov ebx, dword [esp]
add edi, dword [ebx]
imul esi, edx
add edi, esi
mov edx, ebp
not edx
and edx, eax
and ecx, ebp
imul ecx, edx
mov edx, eax
and edx, ebp
or eax, ebp
imul eax, edx
add eax, ecx
push eax
push dword [esp + 0xb4]
push edi
call fcn.0040ca30
mov edx, dword [esp + 0xc]
add esp, 0xc
mov ebp, dword [edx + 4]
mov ebx, dword [edx + 8]
mov eax, dword [esp + 0x38]
lea esi, [eax + ebp]
cmp ebx, esi
jae 0x40a7e6
mov ecx, dword [esp + 0x64]
mov edx, dword [esp]
push 1
push esi
call fcn.0040c8e0
mov edx, dword [esp + 8]
add esp, 8
test eax, eax
je 0x40a8be
mov dword [edx + 4], esi
cmp word [esp + 0x7c], 0
je 0x40a841
mov eax, dword [edx + 0xc]
mov edx, ebp
mov esi, ebp
mov ecx, eax
and ecx, ebp
or ebp, eax
imul ebp, ecx
mov ecx, eax
not ecx
and edx, ecx
not esi
and esi, eax
mov edi, dword [esp]
add ebp, dword [edi]
imul esi, edx
add ebp, esi
mov esi, dword [esp + 0x38]
mov edx, esi
not edx
and edx, eax
and ecx, esi
imul ecx, edx
mov edx, eax
and edx, esi
or eax, esi
imul eax, edx
add eax, ecx
push eax
push dword [esp + 0x7c]
push ebp
call fcn.0040ca30
mov edx, dword [esp + 0xc]
add esp, 0xc
mov esi, dword [edx + 0x14]
lea edi, [esi + 1]
cmp dword [edx + 0x18], edi
jae 0x40a869
mov eax, dword [esp]
lea edx, [eax + 0x10]
mov ecx, dword [esp + 0x64]
push 1
push edi
call fcn.0040c8e0
mov edx, dword [esp + 8]
add esp, 8
test eax, eax
je 0x40a8be
mov dword [edx + 0x14], edi
mov eax, dword [edx + 0x1c]
mov ebx, edx
mov edx, esi
mov edi, esi
mov ecx, eax
and ecx, esi
or esi, eax
imul esi, ecx
mov ecx, eax
not ecx
and edx, ecx
not edi
and edi, eax
add esi, dword [ebx + 0x10]
imul edi, edx
add esi, edi
and ecx, 1
neg ecx
and ecx, eax
and ecx, 0xfffffffe
mov edx, eax
or edx, 1
and eax, 1
neg eax
and eax, edx
add eax, ecx
lea ecx, [esp + 0x4c]
push eax
push ecx
push esi
call fcn.0040ca30
add esp, 0xc
mov eax, 1
jmp 0x40a8f3
mov ebx, dword [esp + 4]
cmp dword [edx + 8], ebx
mov edi, dword [esp + 0x64]
jae 0x40a8e7
push ebx
push dword [edx + 0xc]
push dword [edx]
push dword [edi + 0x34]
mov esi, edx
call dword [edi + 0x30]
add esp, 0x10
test eax, eax
je 0x40a8ea
mov dword [esi], eax
mov dword [esi + 8], ebx
mov edx, esi
mov dword [edx + 4], ebx
mov dword [edi + 0x1c], 0x10
xor eax, eax
add esp, 0x50
pop esi
pop edi
pop ebx
pop ebp
ret