Function at 0x405c40
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 0x405c72
cmp dword [ecx + 0x34], 0
jne 0x405c72
mov dword [edi + 0x1c], 3
jmp 0x4061f4
mov dword [esp + 0x48], ecx
movzx ecx, word [esp + 0x74]
movzx esi, word [esp + 0x6c]
movzx ecx, cx
movzx ebp, word [esp + 0x7c]
mov dword [esp + 0x38], ecx
mov edx, esi
mov dword [esp + 0x3c], 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 0x405cc3
mov dword [edi + 0x1c], 0xf
jmp 0x4061f4
mov dword [esp + 0x34], ebp
mov dword [esp], ebx
mov ebp, dword [esp + 0x8c]
mov ecx, dword [esp + 0x84]
mov dword [esp + 0x40], ecx
mov dword [esp + 0xa], 0
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 word [esp + 0x2a], 0
mov dword [esp + 6], 0x2014b50
movzx edi, word [esp + 0x94]
mov ecx, dword [esp + 0x90]
movzx edx, word [esp + 0x74]
add edx, esi
mov dword [esp + 0x44], edx
xor ebx, ebx
mov edx, 0
mov esi, edi
test di, di
je 0x405d55
mov dl, 0x14
mov byte [esp + 0xc], dl
movzx edx, word [esp + 0x98]
mov byte [esp + 0xe], dl
mov byte [esp + 0xf], dh
mov edx, esi
mov byte [esp + 0x10], dl
mov byte [esp + 0x11], dh
movzx edx, word [esp + 0x9c]
mov byte [esp + 0x12], dl
mov byte [esp + 0x13], dh
movzx edx, word [esp + 0xa0]
mov byte [esp + 0x14], dl
mov byte [esp + 0x15], dh
mov byte [esp + 0x16], cl
mov byte [esp + 0x17], ch
mov edx, ecx
shr edx, 0x10
mov byte [esp + 0x18], dl
shr ecx, 0x18
neg ebp
mov edx, 0
sbb edx, edx
mov byte [esp + 0x19], cl
or edx, dword [esp + 0x88]
mov byte [esp + 0x1a], dl
mov byte [esp + 0x1b], dh
mov ecx, edx
shr ecx, 0x10
mov byte [esp + 0x1c], cl
shr edx, 0x18
neg dword [esp + 0x40]
mov ecx, 0
sbb ecx, ecx
mov byte [esp + 0x1d], dl
or ecx, dword [esp + 0x80]
mov byte [esp + 0x1e], cl
mov byte [esp + 0x1f], ch
mov edx, ecx
shr edx, 0x10
mov byte [esp + 0x20], dl
shr ecx, 0x18
mov byte [esp + 0x21], cl
movzx ecx, word [esp + 0x6c]
mov byte [esp + 0x22], cl
mov byte [esp + 0x23], ch
mov ecx, dword [esp + 0x44]
mov byte [esp + 0x24], cl
mov byte [esp + 0x25], ch
movzx ecx, word [esp + 0x7c]
mov byte [esp + 0x26], cl
mov byte [esp + 0x27], ch
mov edx, dword [esp + 0xac]
mov byte [esp + 0x2c], dl
mov byte [esp + 0x2d], dh
mov ecx, edx
shr ecx, 0x10
mov byte [esp + 0x2e], cl
shr edx, 0x18
neg eax
sbb ebx, ebx
mov byte [esp + 0x2f], dl
or ebx, dword [esp + 0xa4]
mov byte [esp + 0x30], bl
mov byte [esp + 0x31], bh
mov eax, ebx
shr eax, 0x10
mov byte [esp + 0x32], al
shr ebx, 0x18
mov byte [esp + 0x33], bl
mov ebp, dword [esp]
lea edi, [ebp + 0x2e]
mov esi, dword [esp + 0x48]
mov ebx, dword [esi + 8]
cmp ebx, edi
jae 0x405ed1
cmp ebx, 1
adc ebx, 0
cmp edi, 2
jb 0x405eac
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, ebx
and eax, 2
mov ecx, ebx
or ebx, 2
imul ebx, eax
xor eax, 2
and ecx, 0xfffffffd
imul ecx, eax
add ebx, ecx
cmp ebx, edi
jb 0x405e90
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 0x4061c6
mov dword [esi], eax
mov dword [esi + 8], ebx
mov ebp, dword [esp]
jmp 0x405ed3
mov eax, dword [esi]
mov dword [esi + 4], edi
mov edx, dword [esi + 0xc]
mov ecx, edx
imul ecx, ebp
add ecx, eax
mov eax, edx
and eax, 0x2e
mov edi, edx
or edx, 0x2e
imul edx, eax
xor eax, 0x2e
and edi, 0xffffffd1
imul edi, eax
add edx, edi
lea eax, [esp + 6]
push edx
push eax
push ecx
call fcn.00408410
add esp, 0xc
mov ebx, dword [esi + 4]
mov ebp, dword [esi + 8]
mov eax, dword [esp + 0x3c]
lea edi, [ebx + eax]
cmp ebp, edi
jae 0x405f6c
cmp ebp, 1
adc ebp, 0
cmp edi, 2
jb 0x405f4c
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, ebp
and eax, 2
mov ecx, ebp
or ebp, 2
imul ebp, eax
xor eax, 2
and ecx, 0xfffffffd
imul ecx, eax
add ebp, ecx
cmp ebp, edi
jb 0x405f30
push ebp
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 0x4061c6
mov dword [esi], eax
mov dword [esi + 8], ebp
mov dword [esi + 4], edi
cmp word [esp + 0x6c], 0
je 0x405fb1
mov eax, dword [esi + 0xc]
imul ebx, eax
add ebx, dword [esi]
mov ecx, eax
not ecx
mov edi, dword [esp + 0x3c]
and ecx, edi
mov edx, edi
not edx
and edx, eax
imul edx, ecx
mov ecx, eax
and ecx, edi
or eax, edi
imul eax, ecx
add eax, edx
push eax
push dword [esp + 0x6c]
push ebx
call fcn.00408410
add esp, 0xc
mov edi, dword [esi + 4]
mov ebp, dword [esi + 8]
mov eax, dword [esp + 0x38]
lea ebx, [edi + eax]
cmp ebp, ebx
mov edx, dword [esp + 0xb4]
jae 0x406013
cmp ebp, 1
adc ebp, 0
cmp ebx, 2
jb 0x405fec
nop
nop
mov eax, ebp
and eax, 2
mov ecx, ebp
or ebp, 2
imul ebp, eax
xor eax, 2
and ecx, 0xfffffffd
imul ecx, eax
add ebp, ecx
cmp ebp, ebx
jb 0x405fd0
push ebp
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 0x4061c6
mov dword [esi], eax
mov dword [esi + 8], ebp
mov edx, dword [esp + 0xb4]
movzx eax, word [esp + 0x74]
mov dword [esi + 4], ebx
test ax, ax
je 0x406061
mov eax, dword [esi + 0xc]
imul edi, eax
add edi, dword [esi]
mov ecx, eax
not ecx
mov ebx, dword [esp + 0x38]
and ecx, ebx
mov edx, ebx
not edx
and edx, eax
imul edx, ecx
mov ecx, eax
and ecx, ebx
or eax, ebx
imul eax, ecx
add eax, edx
push eax
push dword [esp + 0x74]
push edi
call fcn.00408410
mov edx, dword [esp + 0xc0]
add esp, 0xc
mov ebx, dword [esi + 4]
mov ebp, dword [esi + 8]
lea edi, [ebx + edx]
cmp ebp, edi
jae 0x4060c3
cmp ebp, 1
adc ebp, 0
cmp edi, 2
jb 0x40609c
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, ebp
and eax, 2
mov ecx, ebp
or ebp, 2
imul ebp, eax
xor eax, 2
and ecx, 0xfffffffd
imul ecx, eax
add ebp, ecx
cmp ebp, edi
jb 0x406080
push ebp
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 0x4061c6
mov dword [esi], eax
mov dword [esi + 8], ebp
mov edx, dword [esp + 0xb4]
mov dword [esi + 4], edi
test edx, edx
je 0x406103
mov eax, dword [esi + 0xc]
imul ebx, eax
add ebx, dword [esi]
mov ecx, eax
not ecx
and ecx, edx
mov edi, edx
not edx
and edx, eax
imul edx, ecx
mov ecx, eax
and ecx, edi
or eax, edi
imul eax, ecx
add eax, edx
push eax
push dword [esp + 0xb4]
push ebx
call fcn.00408410
add esp, 0xc
mov edi, dword [esi + 4]
mov ebp, dword [esi + 8]
mov eax, dword [esp + 0x34]
lea ebx, [edi + eax]
cmp ebp, ebx
jae 0x406127
mov ecx, dword [esp + 0x64]
mov edx, esi
push 1
push ebx
call fcn.00408240
add esp, 8
test eax, eax
je 0x4061c6
mov dword [esi + 4], ebx
cmp word [esp + 0x7c], 0
je 0x406166
mov eax, dword [esi + 0xc]
imul edi, eax
add edi, dword [esi]
mov ecx, eax
not ecx
mov ebx, dword [esp + 0x34]
and ecx, ebx
mov edx, ebx
not edx
and edx, eax
imul edx, ecx
mov ecx, eax
and ecx, ebx
or eax, ebx
imul eax, ecx
add eax, edx
push eax
push dword [esp + 0x7c]
push edi
call fcn.00408410
add esp, 0xc
mov edi, dword [esi + 0x14]
lea ebx, [edi + 1]
cmp dword [esi + 0x18], ebx
jae 0x406187
lea edx, [esi + 0x10]
mov ecx, dword [esp + 0x64]
push 1
push ebx
call fcn.00408240
add esp, 8
test eax, eax
je 0x4061c6
mov dword [esi + 0x14], ebx
mov eax, dword [esi + 0x1c]
mov ecx, eax
not ecx
imul edi, eax
add edi, dword [esi + 0x10]
mov edx, eax
and edx, 1
neg edx
and ecx, 1
mov esi, eax
and esi, 0xfffffffe
imul esi, ecx
or eax, 1
and eax, edx
add eax, esi
lea ecx, [esp + 0x4c]
push eax
push ecx
push edi
call fcn.00408410
add esp, 0xc
mov eax, 1
jmp 0x4061f6
mov ebx, dword [esp]
cmp dword [esi + 8], ebx
mov edi, dword [esp + 0x64]
jae 0x4061ea
push ebx
push dword [esi + 0xc]
push dword [esi]
push dword [edi + 0x34]
call dword [edi + 0x30]
add esp, 0x10
test eax, eax
je 0x4061ed
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