Function at 0x409e80
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 dword [esp], ecx
mov ebx, dword [ecx + 4]
mov dword [esp + 0x4c], ebx
test eax, eax
je 0x409eb8
mov ecx, dword [esp]
cmp dword [ecx + 0x34], 0
jne 0x409eb8
mov dword [edi + 0x1c], 3
jmp 0x40a50f
movzx ecx, word [esp + 0x74]
movzx esi, word [esp + 0x6c]
movzx ecx, cx
movzx ebp, word [esp + 0x7c]
mov dword [esp + 0x40], ecx
mov edx, esi
mov dword [esp + 0x44], 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 0x409f05
mov dword [edi + 0x1c], 0xf
jmp 0x40a50f
mov dword [esp + 0x3c], ebp
mov dword [esp + 8], ebx
mov ebp, dword [esp + 0x8c]
mov ecx, dword [esp + 0x84]
mov dword [esp + 0x48], ecx
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 dword [esp + 0x2e], 0
mov word [esp + 0x32], 0
mov dword [esp + 0xe], 0x2014b50
movzx edi, word [esp + 0x94]
mov ecx, dword [esp + 0x90]
movzx edx, word [esp + 0x74]
add edx, esi
mov dword [esp + 4], edx
xor ebx, ebx
mov edx, 0
mov esi, edi
test di, di
je 0x409f98
mov dl, 0x14
mov byte [esp + 0x14], dl
movzx edx, word [esp + 0x98]
mov byte [esp + 0x16], dl
mov byte [esp + 0x17], dh
mov edx, esi
mov byte [esp + 0x18], dl
mov byte [esp + 0x19], dh
movzx edx, word [esp + 0x9c]
mov byte [esp + 0x1a], dl
mov byte [esp + 0x1b], dh
movzx edx, word [esp + 0xa0]
mov byte [esp + 0x1c], dl
mov byte [esp + 0x1d], dh
mov byte [esp + 0x1e], cl
mov byte [esp + 0x1f], ch
mov edx, ecx
shr edx, 0x10
mov byte [esp + 0x20], dl
shr ecx, 0x18
neg ebp
mov edx, 0
sbb edx, edx
mov byte [esp + 0x21], cl
or edx, dword [esp + 0x88]
mov byte [esp + 0x22], dl
mov byte [esp + 0x23], dh
mov ecx, edx
shr ecx, 0x10
mov byte [esp + 0x24], cl
shr edx, 0x18
neg dword [esp + 0x48]
mov ecx, 0
sbb ecx, ecx
mov byte [esp + 0x25], dl
or ecx, dword [esp + 0x80]
mov byte [esp + 0x26], cl
mov byte [esp + 0x27], ch
mov edx, ecx
shr edx, 0x10
mov byte [esp + 0x28], dl
shr ecx, 0x18
mov byte [esp + 0x29], cl
movzx ecx, word [esp + 0x6c]
mov byte [esp + 0x2a], cl
mov byte [esp + 0x2b], ch
mov ecx, dword [esp + 4]
mov byte [esp + 0x2c], cl
mov byte [esp + 0x2d], ch
movzx ecx, word [esp + 0x7c]
mov byte [esp + 0x2e], cl
mov byte [esp + 0x2f], ch
mov edx, dword [esp + 0xac]
mov byte [esp + 0x34], dl
mov byte [esp + 0x35], dh
mov ecx, edx
shr ecx, 0x10
mov byte [esp + 0x36], cl
shr edx, 0x18
neg eax
sbb ebx, ebx
mov byte [esp + 0x37], dl
or ebx, dword [esp + 0xa4]
mov byte [esp + 0x38], bl
mov byte [esp + 0x39], bh
mov eax, ebx
shr eax, 0x10
mov byte [esp + 0x3a], al
shr ebx, 0x18
mov byte [esp + 0x3b], bl
mov esi, dword [esp + 8]
lea edi, [esi + 0x2e]
mov eax, dword [esp]
mov ebx, dword [eax + 8]
cmp ebx, edi
jae 0x40a11d
cmp ebx, 1
adc ebx, 0
cmp edi, 2
jb 0x40a0ec
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 0x40a0d0
push ebx
mov eax, dword [esp + 4]
push dword [eax + 0xc]
push dword [eax]
mov eax, dword [esp + 0x70]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
je 0x40a4d3
mov ecx, dword [esp]
mov dword [esp + 4], eax
mov dword [ecx], eax
mov dword [ecx + 8], ebx
mov esi, dword [esp + 8]
jmp 0x40a126
mov eax, dword [esp]
mov eax, dword [eax]
mov dword [esp + 4], eax
mov eax, dword [esp]
mov dword [eax + 4], edi
mov ecx, dword [eax + 0xc]
mov edx, esi
not edx
and edx, ecx
mov edi, ecx
not edi
mov ebx, esi
and ebx, edi
imul ebx, edx
mov ebp, ecx
or ebp, esi
mov edx, ecx
and edx, esi
mov esi, eax
imul edx, ebp
add edx, dword [esp + 4]
add edx, ebx
and edi, 0x2e
mov eax, ecx
and eax, 0xffffffd1
imul eax, edi
mov edi, ecx
and edi, 0x2e
or ecx, 0x2e
imul ecx, edi
add ecx, eax
lea eax, [esp + 0xe]
push ecx
push eax
push edx
call fcn.0040c6c0
add esp, 0xc
mov ebx, dword [esi + 4]
mov ebp, dword [esi + 8]
mov eax, dword [esp + 0x44]
lea edi, [ebx + eax]
cmp ebp, edi
jae 0x40a1e5
cmp ebp, 1
adc ebp, 0
movzx esi, word [esp + 0x74]
cmp edi, 2
jb 0x40a1bc
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 0x40a1a0
push ebp
mov eax, dword [esp + 4]
push dword [eax + 0xc]
push dword [eax]
mov eax, dword [esp + 0x70]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
je 0x40a4d3
mov ecx, dword [esp]
mov dword [ecx], eax
mov dword [ecx + 8], ebp
jmp 0x40a1ea
movzx esi, word [esp + 0x74]
mov eax, dword [esp]
mov dword [eax + 4], edi
cmp word [esp + 0x6c], 0
je 0x40a24f
mov esi, dword [esp]
mov eax, dword [esi + 0xc]
mov ecx, ebx
not ecx
and ecx, eax
mov edx, ebx
mov edi, eax
or edi, ebx
and ebx, eax
imul ebx, edi
mov edi, eax
not edi
and edx, edi
add ebx, dword [esi]
imul edx, ecx
add ebx, edx
mov ebp, dword [esp + 0x44]
and edi, ebp
mov ecx, ebp
not ecx
and ecx, eax
imul ecx, edi
mov edx, eax
and edx, ebp
or eax, ebp
imul eax, edx
add eax, ecx
push eax
push dword [esp + 0x6c]
push ebx
call fcn.0040c6c0
add esp, 0xc
mov edi, dword [esi + 4]
mov ebp, dword [esi + 8]
movzx esi, word [esp + 0x74]
mov eax, dword [esp + 0x40]
lea ebx, [edi + eax]
cmp ebp, ebx
mov ecx, dword [esp + 0xb4]
jae 0x40a2ba
cmp ebp, 1
adc ebp, 0
cmp ebx, 2
jb 0x40a28c
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, ebx
jb 0x40a270
push ebp
mov eax, dword [esp + 4]
push dword [eax + 0xc]
push dword [eax]
mov eax, dword [esp + 0x70]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
je 0x40a4d3
mov ecx, dword [esp]
mov dword [ecx], eax
mov dword [ecx + 8], ebp
mov ecx, dword [esp + 0xb4]
mov eax, dword [esp]
mov dword [eax + 4], ebx
test si, si
je 0x40a31e
mov esi, dword [esp]
mov eax, dword [esi + 0xc]
mov ecx, edi
not ecx
and ecx, eax
mov edx, edi
mov ebx, eax
or ebx, edi
and edi, eax
imul edi, ebx
mov ebx, eax
not ebx
and edx, ebx
add edi, dword [esi]
imul edx, ecx
add edi, edx
mov ebp, dword [esp + 0x40]
and ebx, ebp
mov ecx, ebp
not ecx
and ecx, eax
imul ecx, ebx
mov edx, eax
and edx, ebp
or eax, ebp
imul eax, edx
add eax, ecx
push eax
push dword [esp + 0x74]
push edi
call fcn.0040c6c0
mov ecx, dword [esp + 0xc0]
add esp, 0xc
mov ebx, dword [esi + 4]
mov ebp, dword [esi + 8]
lea edi, [ebx + ecx]
cmp ebp, edi
jae 0x40a37a
cmp ebp, 1
adc ebp, 0
cmp edi, 2
jb 0x40a34c
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 0x40a330
push ebp
mov eax, dword [esp + 4]
push dword [eax + 0xc]
push dword [eax]
mov eax, dword [esp + 0x70]
push dword [eax + 0x34]
call dword [eax + 0x30]
add esp, 0x10
test eax, eax
je 0x40a4d3
mov ecx, dword [esp]
mov dword [ecx], eax
mov dword [ecx + 8], ebp
mov ecx, dword [esp + 0xb4]
mov eax, dword [esp]
mov dword [eax + 4], edi
test ecx, ecx
je 0x40a3d7
mov esi, dword [esp]
mov eax, dword [esi + 0xc]
mov ebp, ecx
mov ecx, ebx
not ecx
and ecx, eax
mov edx, ebx
mov edi, eax
or edi, ebx
and ebx, eax
imul ebx, edi
mov edi, eax
not edi
and edx, edi
add ebx, dword [esi]
imul edx, ecx
add ebx, edx
and edi, ebp
mov ecx, ebp
not ecx
and ecx, eax
imul ecx, edi
mov edx, eax
and edx, ebp
or eax, ebp
imul eax, edx
add eax, ecx
push eax
push dword [esp + 0xb4]
push ebx
call fcn.0040c6c0
add esp, 0xc
mov edi, dword [esi + 4]
mov ebp, dword [esi + 8]
mov eax, dword [esp + 0x3c]
lea ebx, [edi + eax]
cmp ebp, ebx
jae 0x40a3fc
mov ecx, dword [esp + 0x64]
mov edx, dword [esp]
push 1
push ebx
call fcn.0040c570
add esp, 8
test eax, eax
je 0x40a4d3
mov eax, dword [esp]
mov dword [eax + 4], ebx
cmp word [esp + 0x7c], 0
je 0x40a456
mov esi, dword [esp]
mov eax, dword [esi + 0xc]
mov ecx, edi
not ecx
and ecx, eax
mov edx, edi
mov ebx, eax
or ebx, edi
and edi, eax
imul edi, ebx
mov ebx, eax
not ebx
and edx, ebx
add edi, dword [esi]
imul edx, ecx
add edi, edx
mov ebp, dword [esp + 0x3c]
and ebx, ebp
mov ecx, ebp
not ecx
and ecx, eax
imul ecx, ebx
mov edx, eax
and edx, ebp
or eax, ebp
imul eax, edx
add eax, ecx
push eax
push dword [esp + 0x7c]
push edi
call fcn.0040c6c0
add esp, 0xc
mov eax, dword [esp]
mov edi, dword [eax + 0x14]
lea ebx, [edi + 1]
cmp dword [eax + 0x18], ebx
jae 0x40a47d
mov eax, dword [esp]
lea edx, [eax + 0x10]
mov ecx, dword [esp + 0x64]
push 1
push ebx
call fcn.0040c570
add esp, 8
test eax, eax
je 0x40a4d3
mov esi, dword [esp]
mov dword [esi + 0x14], ebx
mov eax, dword [esi + 0x1c]
mov edx, edi
not edx
and edx, eax
mov ebx, edi
mov ecx, eax
or ecx, edi
and edi, eax
imul edi, ecx
mov ecx, eax
not ecx
and ebx, ecx
add edi, dword [esi + 0x10]
imul ebx, edx
add edi, ebx
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 edi
call fcn.0040c6c0
add esp, 0xc
mov eax, 1
jmp 0x40a511
mov ebx, dword [esp + 8]
mov eax, dword [esp]
cmp dword [eax + 8], ebx
mov edi, dword [esp + 0x64]
jae 0x40a502
push ebx
mov eax, dword [esp + 4]
push dword [eax + 0xc]
push dword [eax]
push dword [edi + 0x34]
call dword [edi + 0x30]
add esp, 0x10
test eax, eax
je 0x40a508
mov ecx, dword [esp]
mov dword [ecx], eax
mov dword [ecx + 8], ebx
mov eax, dword [esp]
mov dword [eax + 4], ebx
mov dword [edi + 0x1c], 0x10
xor eax, eax
add esp, 0x50
pop esi
pop edi
pop ebx
pop ebp
ret