Function at 0x40e6d0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x14
mov edx, dword [ebp + 8]
push ebx
xor ebx, ebx
mov dword [esp + 4], ebx
push esi
push edi
test edx, edx
jne 0x40e6f5
mov eax, 0xffffff9a
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [edx + 0xe0]
test esi, esi
je 0x40e6e9
cmp dword [esi], ebx
jne 0x40e70f
mov eax, 0xffffff9c
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 0x10]
test ecx, ecx
jne 0x40e71f
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0xc]
mov dword [esi + 0x10], eax
xor eax, eax
mov dword [esi + 0x14], ecx
cmp eax, dword [esi + 0x84]
jb 0x40e74d
ja 0x40e73c
cmp ecx, dword [esi + 0x80]
jbe 0x40e74d
cmp dword [esi + 0xc8], eax
jne 0x40e74d
mov eax, dword [esi + 0x80]
mov dword [esi + 0x14], eax
mov edi, dword [esi + 8]
xor eax, eax
mov edx, edi
add edx, dword [esi + 0x78]
adc eax, dword [esi + 0x7c]
cmp ebx, eax
jb 0x40e774
ja 0x40e764
cmp ecx, edx
jbe 0x40e774
cmp dword [esi + 0xc8], ebx
je 0x40e774
mov eax, dword [esi + 0x78]
add eax, edi
mov dword [esi + 0x14], eax
cmp dword [esi + 0x14], ebx
jbe 0x40e9cb
nop dword [eax]
cmp dword [esi + 8], 0
jne 0x40e88a
mov ecx, dword [esi + 0x7c]
mov eax, dword [esi + 0x78]
test ecx, ecx
jne 0x40e79c
test eax, eax
je 0x40e88a
mov edi, 0x4000
test ecx, ecx
ja 0x40e7b6
jb 0x40e7ab
cmp eax, edi
jae 0x40e7b6
mov edi, dword [esi + 0x78]
test edi, edi
je 0x40e716
mov ecx, dword [esi + 0xc0]
add ecx, dword [esi + 0x40]
mov eax, dword [esi + 0xc4]
adc eax, dword [esi + 0x44]
mov edx, dword [esi + 0xb4]
push 0
push eax
push ecx
lea ecx, [esi + 0x88]
call fcn.00407370
add esp, 0xc
test eax, eax
jne 0x40e9d4
mov eax, dword [esi + 0x8c]
push edi
push dword [esi]
push dword [esi + 0xb4]
push dword [esi + 0xa4]
call eax
add esp, 0x10
cmp eax, edi
jne 0x40e9d4
mov edx, dword [ebp + 8]
cmp dword [edx + 0xe4], 0
je 0x40e874
xor ebx, ebx
test edi, edi
je 0x40e870
nop dword [eax]
mov ecx, dword [edx + 0xf4]
mov edx, dword [esi]
and ecx, 0xfffd
or ecx, 2
mov eax, ecx
xor eax, 1
imul eax, ecx
shr eax, 8
movzx ecx, al
movsx eax, byte [edx + ebx]
xor ecx, eax
mov byte [edx + ebx], cl
movsx eax, cl
mov ecx, dword [ebp + 8]
push eax
mov edx, dword [ecx + 0xf8]
lea ecx, [ecx + 0xec]
call fcn.0040c260
mov ecx, dword [esi]
add esp, 4
mov edx, dword [ebp + 8]
mov byte [ebx + ecx], al
inc ebx
cmp ebx, edi
jb 0x40e820
mov ebx, dword [esp + 0xc]
add dword [esi + 0x40], edi
mov eax, dword [esi]
adc dword [esi + 0x44], 0
sub dword [esi + 0x78], edi
mov dword [esi + 4], eax
sbb dword [esi + 0x7c], 0
mov dword [esi + 8], edi
mov eax, dword [esi + 0xb8]
test eax, eax
je 0x40e948
cmp dword [esi + 0xc8], 0
jne 0x40e948
cmp eax, 0xc
je 0x40e9c1
mov eax, dword [esi + 0x18]
lea ecx, [esi + 4]
mov dword [esp + 0x10], eax
mov eax, dword [esi + 0x10]
mov dword [esp + 0x14], eax
call fcn.0040f800
mov edi, eax
test edi, edi
js 0x40e8d6
cmp dword [esi + 0x1c], 0
mov eax, 0xfffffffd
cmovne edi, eax
mov ebx, dword [esi + 0x18]
xor ecx, ecx
mov edx, dword [esp + 0x14]
mov eax, ebx
sub eax, dword [esp + 0x10]
mov dword [esp + 0x18], eax
sbb ecx, ecx
add dword [esi + 0x68], eax
mov dword [esp + 0x1c], ecx
adc dword [esi + 0x6c], ecx
test edx, edx
jne 0x40e8fd
xor ecx, ecx
jmp 0x40e90f
mov ecx, dword [esi + 0x70]
push eax
call fcn.004076b0
mov ecx, eax
add esp, 4
mov eax, dword [esp + 0x18]
sub dword [esi + 0x80], eax
mov eax, dword [esp + 0x1c]
sbb dword [esi + 0x84], eax
sub ebx, dword [esp + 0x10]
mov eax, dword [esp + 0xc]
add eax, ebx
mov dword [esi + 0x70], ecx
mov dword [esp + 0xc], eax
cmp edi, 1
je 0x40e9cd
test edi, edi
jne 0x40e9de
mov ebx, eax
jmp 0x40e9c1
mov edi, dword [esi + 8]
test edi, edi
jne 0x40e957
mov eax, dword [esi + 0x78]
or eax, dword [esi + 0x7c]
je 0x40e9cb
cmp dword [esi + 0x14], edi
cmovb edi, dword [esi + 0x14]
xor edx, edx
test edi, edi
je 0x40e975
mov eax, dword [esi + 4]
mov ecx, dword [esi + 0x10]
mov al, byte [edx + eax]
mov byte [edx + ecx], al
inc edx
cmp edx, edi
jb 0x40e964
add dword [esi + 0x68], edi
mov ebx, dword [esi + 0x10]
adc dword [esi + 0x6c], 0
test ebx, ebx
jne 0x40e987
xor eax, eax
jmp 0x40e995
mov ecx, dword [esi + 0x70]
mov edx, ebx
push edi
call fcn.004076b0
add esp, 4
sub dword [esi + 0x80], edi
mov dword [esi + 0x70], eax
lea eax, [ebx + edi]
sbb dword [esi + 0x84], 0
mov ebx, dword [esp + 0xc]
sub dword [esi + 8], edi
sub dword [esi + 0x14], edi
add dword [esi + 4], edi
add dword [esi + 0x18], edi
add ebx, edi
mov dword [esi + 0x10], eax
mov dword [esp + 0xc], ebx
cmp dword [esi + 0x14], 0
ja 0x40e780
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret