Function at 0x40ddc0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push edi
push esi
push ebx
mov ebx, eax
sub esp, 0x7c
fld xword [esp + 0x90]
fld st(0)
fstp xword [esp + 0x48]
fxam
wait
fnstsw ax
and ax, 0x4500
cmp ax, 0x100
je 0x40e1b1
fld st(0)
fstp xword [esp + 0x30]
movzx edx, word [esp + 0x38]
test dx, dx
js 0x40df20
fxam
wait
fnstsw ax
fstp st(0)
and ax, 0x4500
cmp ax, 0x500
je 0x40e2c0
mov edi, dword [esp + 0x48]
mov ebp, dword [esp + 0x4c]
and dx, 0x7fff
mov word [esp + 0x18], dx
mov dword [esp + 0x10], edi
mov dword [esp + 0x14], ebp
jne 0x40df30
mov edx, ebp
or edx, edi
je 0x40e270
test ebp, ebp
js 0x40e380
mov esi, edi
mov eax, 0xffffc001
mov edi, ebp
lea esi, [esi]
shld edi, esi, 1
mov edx, eax
add esi, esi
lea eax, [edx - 1]
test edi, edi
jns 0x40de50
mov dword [esp + 0x10], esi
mov ebp, dword [ebx + 0xc]
mov dword [esp + 0x14], edi
mov word [esp + 0x18], dx
cmp ebp, 0xe
jbe 0x40e1e0
mov eax, dword [ebx + 4]
lea edi, [esp + 0x5e]
mov esi, dword [esp + 0x10]
mov edx, ebx
mov dword [esp + 0xc], edi
mov ebp, edi
mov edi, eax
mov dword [esp + 0x24], eax
and edi, 0x800
mov dword [esp + 0x1c], eax
and eax, 0x20
mov dword [esp + 0x2c], edi
mov edi, dword [esp + 0x14]
mov byte [esp + 0x20], al
jmp 0x40dece
mov ecx, eax
cmp eax, 9
jle 0x40df19
add eax, 0x37
or al, byte [esp + 0x20]
mov byte [ebp], al
add ebp, 1
mov ecx, edi
or ecx, esi
je 0x40e070
mov eax, esi
and eax, 0xf
mov ebx, eax
mov ecx, eax
mov dword [esp + 0x10], eax
sar ebx, 0x1f
xor ecx, esi
mov dword [esp + 0x14], ebx
mov ebx, dword [esp + 0x14]
xor ebx, edi
or ebx, ecx
je 0x40e125
mov ecx, dword [edx + 0xc]
shrd esi, edi, 4
shr edi, 4
test ecx, ecx
jle 0x40df06
sub ecx, 1
mov dword [edx + 0xc], ecx
test eax, eax
jne 0x40deb0
xor ecx, ecx
cmp ebp, dword [esp + 0xc]
ja 0x40df19
mov ebx, dword [edx + 0xc]
test ebx, ebx
js 0x40dec4
lea eax, [ecx + 0x30]
jmp 0x40debe
or dword [ebx + 4], 0x80
jmp 0x40ddfd
mov edi, dword [esp + 0x14]
mov esi, dword [esp + 0x10]
sub word [esp + 0x18], 0x3fff
mov ebp, dword [ebx + 0xc]
mov edx, edi
or edx, esi
jne 0x40de6f
mov eax, dword [ebx + 4]
mov dword [esp + 0x24], eax
lea eax, [esp + 0x5e]
mov dword [esp + 0xc], eax
mov edi, dword [esp + 0x24]
mov dword [esp + 0x1c], edi
test ebp, ebp
jle 0x40e2a1
mov byte [esp + 0x5e], 0x2e
lea eax, [esp + 0x5f]
lea ebp, [eax + 1]
mov byte [eax], 0x30
mov eax, dword [ebx + 8]
mov dword [esp + 0x20], eax
test eax, eax
jg 0x40e08b
movsx eax, word [esp + 0x18]
mov esi, 2
mov dword [esp + 0x10], eax
test byte [esp + 0x1c], 0x80
jne 0x40e1a0
test dword [esp + 0x1c], 0x100
jne 0x40e2e0
test byte [esp + 0x1c], 0x40
jne 0x40e290
mov edx, ebx
mov eax, 0x30
call fcn.0040cdd0
mov eax, dword [ebx + 4]
mov edx, ebx
and eax, 0x20
or eax, 0x58
call fcn.0040cdd0
mov eax, dword [ebx + 8]
test eax, eax
jle 0x40dff3
mov edx, dword [ebx + 4]
and edx, 0x600
cmp edx, 0x200
je 0x40e2f1
mov edi, dword [esp + 0xc]
cmp ebp, dword [esp + 0xc]
jbe 0x40e02c
lea esi, [esi]
sub ebp, 1
movsx eax, byte [ebp]
mov edx, ebx
call fcn.0040d270
cmp ebp, edi
jne 0x40e000
mov eax, dword [ebx + 0xc]
lea edx, [eax - 1]
mov dword [ebx + 0xc], edx
test eax, eax
jle 0x40e039
nop
mov edx, ebx
mov eax, 0x30
call fcn.0040cdd0
mov eax, dword [ebx + 0xc]
lea edx, [eax - 1]
mov dword [ebx + 0xc], edx
test eax, eax
jg 0x40e020
mov eax, dword [ebx + 4]
mov edx, ebx
and eax, 0x20
or eax, 0x50
call fcn.0040cdd0
add dword [ebx + 8], esi
mov eax, dword [esp + 0x10]
mov ecx, ebx
or dword [ebx + 4], 0x1c0
cdq
call fcn.0040d320
add esp, 0x7c
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, edx
cmp ebp, dword [esp + 0xc]
je 0x40e392
mov eax, dword [ebx + 8]
mov dword [esp + 0x20], eax
test eax, eax
jle 0x40df89
movsx edi, word [esp + 0x18]
mov edx, dword [ebx + 0xc]
mov eax, ebp
sub eax, dword [esp + 0xc]
mov dword [esp + 0x10], edi
test edx, edx
jle 0x40e0a3
add eax, edx
xor edx, edx
test dword [esp + 0x24], 0x1c0
mov ecx, 0x66666667
setne dl
lea edi, [eax + edx + 5]
mov eax, dword [esp + 0x10]
mov dword [esp + 0x18], edi
imul ecx
mov eax, dword [esp + 0x10]
sar eax, 0x1f
mov ecx, edx
sar ecx, 2
sub ecx, eax
je 0x40e370
lea esi, [esi]
nop
mov eax, 0x66666667
add edi, 1
imul ecx
sar ecx, 0x1f
lea esi, [edi + 2]
sub si, word [esp + 0x18]
sar edx, 2
sub edx, ecx
mov ecx, edx
jne 0x40e0e0
movsx esi, si
mov eax, dword [esp + 0x20]
cmp eax, edi
jle 0x40e1d0
sub eax, edi
test dword [esp + 0x24], 0x600
je 0x40e320
mov dword [ebx + 8], eax
jmp 0x40df97
cmp ebp, dword [esp + 0xc]
ja 0x40e137
mov ebx, dword [esp + 0x2c]
test ebx, ebx
je 0x40e280
mov byte [ebp], 0x2e
add ebp, 1
mov ecx, esi
xor ecx, 1
mov dword [esp + 0x10], ecx
movzx ecx, word [esp + 0x18]
sub ecx, 1
mov word [esp + 0x28], cx
mov ecx, dword [esp + 0x10]
or ecx, edi
je 0x40e360
movzx ecx, word [esp + 0x28]
mov dword [esp + 0x10], eax
mov dword [esp + 0x28], edx
lea esi, [esi]
shrd esi, edi, 1
shr edi, 1
mov eax, ecx
mov ebx, esi
mov edx, edi
lea ecx, [eax - 1]
xor ebx, 1
or edx, ebx
jne 0x40e170
mov word [esp + 0x18], ax
mov edx, dword [esp + 0x28]
xor esi, esi
xor edi, edi
mov eax, dword [esp + 0x10]
jmp 0x40df06
mov edx, ebx
mov eax, 0x2d
call fcn.0040cdd0
jmp 0x40dfbb
fstp st(0)
mov ecx, ebx
mov edx, 0x416819
xor eax, eax
call fcn.0040d010
add esp, 0x7c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebx + 8], 0xffffffff
jmp 0x40df97
mov edi, dword [esp + 0x14]
mov esi, dword [esp + 0x10]
test edi, edi
js 0x40e202
lea esi, [esi]
shld edi, esi, 1
add esi, esi
test edi, edi
jns 0x40e1f0
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], edi
mov ecx, 0xe
mov eax, 4
xor edx, edx
sub ecx, ebp
shl ecx, 2
shld edx, eax, cl
shl eax, cl
test cl, 0x20
je 0x40e221
mov edx, eax
xor eax, eax
mov edi, dword [esp + 0x14]
mov esi, dword [esp + 0x10]
shrd esi, edi, 1
shr edi, 1
add esi, eax
adc edi, edx
test edi, edi
js 0x40e355
shld edi, esi, 1
add esi, esi
mov ecx, 0xf
sub ecx, ebp
shl ecx, 2
shrd esi, edi, cl
shr edi, cl
test cl, 0x20
je 0x40e259
mov esi, edi
xor edi, edi
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], edi
jmp 0x40de78
mov ebp, dword [ebx + 0xc]
jmp 0x40df4c
mov ecx, dword [edx + 0xc]
test ecx, ecx
jg 0x40e137
jmp 0x40e13e
mov edx, ebx
mov eax, 0x20
call fcn.0040cdd0
jmp 0x40dfbb
and edi, 0x800
mov eax, dword [esp + 0xc]
je 0x40df74
jmp 0x40df6b
mov eax, edx
mov ecx, ebx
mov edx, 0x41681d
and eax, 0x8000
call fcn.0040d010
add esp, 0x7c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, ebx
mov eax, 0x2b
call fcn.0040cdd0
jmp 0x40dfbb
sub eax, 1
mov dword [ebx + 8], eax
lea esi, [esi]
nop
mov edx, ebx
mov eax, 0x30
call fcn.0040cdd0
mov eax, dword [ebx + 8]
lea edx, [eax - 1]
mov dword [ebx + 8], edx
test eax, eax
jg 0x40e300
jmp 0x40dff3
lea edx, [eax - 1]
mov dword [ebx + 8], edx
test eax, eax
jle 0x40df97
nop
mov edx, ebx
mov eax, 0x20
call fcn.0040cdd0
mov eax, dword [ebx + 8]
lea edx, [eax - 1]
mov dword [ebx + 8], edx
test eax, eax
jg 0x40e330
mov eax, dword [ebx + 4]
mov dword [esp + 0x1c], eax
jmp 0x40df97
add word [esp + 0x18], 1
jmp 0x40e241
xor esi, esi
xor edi, edi
jmp 0x40df06
mov edi, dword [esp + 0x18]
mov esi, 2
jmp 0x40e101
mov eax, 0xffffc002
mov ebp, dword [ebx + 0xc]
mov word [esp + 0x18], ax
jmp 0x40de6f
mov ebp, dword [edx + 0xc]
jmp 0x40df5b