Function at 0x40e880
Capabilities:
Encode data using xor

Disassembly:
push ebp
push edi
push esi
push ebx
mov ebx, eax
sub esp, 0x5c
fld xword [esp + 0x70]
fld st(0)
fstp xword [esp + 0x40]
fxam
wait
fnstsw ax
and eax, 0x4500
cmp eax, 0x100
je 0x40ed15
movzx edx, word [esp + 0x48]
mov esi, edx
and esi, 0x8000
jne 0x40ea10
fxam
wait
fnstsw ax
fstp st(0)
and eax, 0x4500
cmp eax, 0x500
je 0x40ed2b
and dx, 0x7fff
je 0x40ea90
sub dx, 0x3fff
mov eax, dword [esp + 0x40]
mov word [esp + 0x1a], dx
mov edx, dword [esp + 0x44]
mov ebp, dword [ebx + 0xc]
cmp ebp, 0xe
jbe 0x40ea26
mov esi, edx
or esi, eax
je 0x40ed3e
mov ecx, dword [ebx + 4]
lea esi, [esp + 0x2e]
mov dword [esp + 4], ebx
movzx ebx, word [esp + 0x1a]
mov dword [esp + 0x10], esi
mov edi, ecx
mov dword [esp + 8], ecx
and edi, 0x800
mov dword [esp + 0xc], ecx
movzx ecx, byte [esp + 8]
mov dword [esp + 0x1c], edi
and ecx, 0x20
mov byte [esp + 0x14], cl
jmp 0x40e98b
mov ebp, dword [esp + 4]
mov edi, dword [ebp + 0xc]
test edi, edi
jle 0x40e955
mov ebp, dword [esp + 4]
sub edi, 1
mov dword [ebp + 0xc], edi
mov edi, dword [esp + 8]
shrd eax, edx, 4
shr edx, 4
test ecx, ecx
mov dword [esp + 0xc], edi
je 0x40e9ee
cmp ecx, 9
jle 0x40ea03
add ecx, 0x37
or cl, byte [esp + 0x14]
mov byte [esi], cl
add esi, 1
mov ecx, edx
or ecx, eax
je 0x40eae0
mov ecx, eax
mov edi, eax
and ecx, 0xf
mov ebp, ecx
xor edi, ecx
sar ebp, 0x1f
xor ebp, edx
or ebp, edi
jne 0x40e940
cmp esi, dword [esp + 0x10]
ja 0x40e9b8
mov edi, dword [esp + 0x1c]
test edi, edi
jne 0x40e9b8
mov edi, dword [esp + 4]
mov ebp, dword [edi + 0xc]
test ebp, ebp
jle 0x40e9c6
mov byte [esi], 0x2e
mov ebp, dword [esp + 8]
add esi, 1
mov dword [esp + 0xc], ebp
mov edi, eax
xor edi, 1
or edi, edx
je 0x40e9e2
nop
shrd eax, edx, 1
sub ebx, 1
mov edi, eax
shr edx, 1
xor edi, 1
or edi, edx
jne 0x40e9d0
xor eax, eax
xor edx, edx
test ecx, ecx
jne 0x40e96c
cmp esi, dword [esp + 0x10]
ja 0x40ea03
mov ebp, dword [esp + 4]
mov edi, dword [ebp + 0xc]
test edi, edi
js 0x40e981
add ecx, 0x30
jmp 0x40e97c
or dword [ebx + 4], 0x80
jmp 0x40e8bb
shld edx, eax, 1
add eax, eax
cmp edx, 0x7fffffff
jbe 0x40ea20
mov ecx, 0xe
mov esi, eax
sub ecx, ebp
mov edi, edx
shl ecx, 2
mov eax, 4
shrd esi, edx, 1
xor edx, edx
shld edx, eax, cl
shr edi, 1
shl eax, cl
test cl, 0x20
je 0x40ea57
mov edx, eax
xor eax, eax
add esi, eax
adc edi, edx
test edi, edi
js 0x40ed0a
shld edi, esi, 1
add esi, esi
mov eax, 0xf
mov edx, edi
sub eax, ebp
lea ecx, [eax*4]
mov eax, esi
shr edx, cl
xor esi, esi
shrd eax, edi, cl
test cl, 0x20
cmovne eax, edx
cmovne edx, esi
jmp 0x40e8fb
mov edx, dword [esp + 0x44]
mov eax, dword [esp + 0x40]
mov word [esp + 0x1a], 0
mov ecx, edx
or ecx, eax
je 0x40e8ef
test edx, edx
mov word [esp + 0x1a], 0xc002
js 0x40e8ef
mov ecx, 0xffffc001
lea esi, [esi]
shld edx, eax, 1
mov esi, ecx
add eax, eax
sub ecx, 1
test edx, edx
jns 0x40eac0
mov word [esp + 0x1a], si
jmp 0x40e8ef
cmp esi, dword [esp + 0x10]
mov word [esp + 0x1a], bx
mov ebx, dword [esp + 4]
je 0x40ed6e
mov ebp, dword [ebx + 8]
test ebp, ebp
mov dword [esp + 0x14], ebp
jle 0x40ec91
mov edx, dword [ebx + 0xc]
mov eax, esi
mov ebp, 2
movsx ecx, word [esp + 0x1a]
sub eax, dword [esp + 0x10]
test edx, edx
mov dword [esp + 4], ecx
lea ecx, [eax + edx]
mov edx, dword [esp + 8]
cmovg eax, ecx
mov ecx, 0x66666667
and edx, 0x1c0
cmp edx, 1
sbb edx, edx
lea edi, [eax + edx + 6]
mov eax, dword [esp + 4]
imul ecx
mov eax, dword [esp + 4]
mov ecx, edx
sar ecx, 2
sar eax, 0x1f
sub ecx, eax
je 0x40eb69
nop
mov eax, 0x66666667
add edi, 1
imul ecx
add ebp, 1
sar ecx, 0x1f
sar edx, 2
sub edx, ecx
mov ecx, edx
jne 0x40eb50
cmp edi, dword [esp + 0x14]
jge 0x40ec73
mov eax, dword [esp + 0x14]
sub eax, edi
test dword [esp + 8], 0x600
mov dword [ebx + 8], eax
je 0x40ecac
movsx ebp, bp
test byte [esp + 0xc], 0x80
jne 0x40ec80
test dword [esp + 0xc], 0x100
jne 0x40ece8
test byte [esp + 0xc], 0x40
jne 0x40ecf9
mov edx, ebx
mov eax, 0x30
call fcn.0040d9c0
mov eax, dword [ebx + 4]
mov edx, ebx
and eax, 0x20
or eax, 0x58
call fcn.0040d9c0
mov eax, dword [ebx + 8]
test eax, eax
jle 0x40ebf9
test byte [ebx + 5], 2
je 0x40ebf9
sub eax, 1
mov dword [ebx + 8], eax
mov edx, ebx
mov eax, 0x30
call fcn.0040d9c0
mov eax, dword [ebx + 8]
lea edx, [eax - 1]
test eax, eax
mov dword [ebx + 8], edx
jg 0x40ebe0
cmp esi, dword [esp + 0x10]
jbe 0x40ec30
mov edi, dword [esp + 0x10]
jmp 0x40ec10
mov edx, ebx
call fcn.0040d9c0
cmp esi, edi
jbe 0x40ec30
sub esi, 1
movsx eax, byte [esi]
cmp eax, 0x2e
jne 0x40ec05
mov eax, ebx
call fcn.0040e150
jmp 0x40ec0c
mov edx, ebx
mov eax, 0x30
call fcn.0040d9c0
mov eax, dword [ebx + 0xc]
lea edx, [eax - 1]
test eax, eax
mov dword [ebx + 0xc], edx
jg 0x40ec24
mov eax, dword [ebx + 4]
mov edx, ebx
and eax, 0x20
or eax, 0x50
call fcn.0040d9c0
mov esi, dword [esp + 4]
mov ecx, ebx
add dword [ebx + 8], ebp
or dword [ebx + 4], 0x1c0
mov edi, esi
mov eax, esi
sar edi, 0x1f
mov edx, edi
call fcn.0040dc80
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebx + 8], 0xffffffff
jmp 0x40eb8a
mov edx, ebx
mov eax, 0x2d
call fcn.0040d9c0
jmp 0x40ebb1
mov eax, dword [esp + 8]
mov ebp, 2
movsx edx, word [esp + 0x1a]
mov dword [esp + 0xc], eax
mov dword [esp + 4], edx
jmp 0x40eb8d
lea edx, [eax - 1]
test eax, eax
mov dword [ebx + 8], edx
jle 0x40eb8a
lea esi, [esi]
mov edx, ebx
mov eax, 0x20
call fcn.0040d9c0
mov eax, dword [ebx + 8]
lea edx, [eax - 1]
test eax, eax
mov dword [ebx + 8], edx
jg 0x40ecc0
mov edx, dword [ebx + 4]
movsx ebp, bp
mov dword [esp + 0xc], edx
jmp 0x40eb8d
mov edx, ebx
mov eax, 0x2b
call fcn.0040d9c0
jmp 0x40ebb1
mov edx, ebx
mov eax, 0x20
call fcn.0040d9c0
jmp 0x40ebb1
add word [esp + 0x1a], 1
jmp 0x40ea69
fstp st(0)
mov ecx, ebx
mov edx, 0x42a0e0
xor ax, ax
call fcn.0040dbe0
jmp 0x40ec6b
mov ecx, ebx
mov edx, 0x42a0e4
mov eax, esi
call fcn.0040dbe0
jmp 0x40ec6b
mov edi, dword [ebx + 4]
lea eax, [esp + 0x2e]
mov dword [esp + 0x10], eax
mov dword [esp + 8], edi
test ebp, ebp
jle 0x40ed73
mov byte [esp + 0x2e], 0x2e
lea esi, [esp + 0x30]
lea eax, [esp + 0x2f]
mov byte [eax], 0x30
mov edi, dword [esp + 8]
mov dword [esp + 0xc], edi
jmp 0x40eaf3
mov ebp, dword [ebx + 0xc]
jmp 0x40ed4d
test dword [esp + 8], 0x800
jne 0x40ed51
lea esi, [esp + 0x2f]
mov eax, dword [esp + 0x10]
jmp 0x40ed5e