On Tuesday, January 6, 2015 10:36:29 AM UTC+1, dottor Piergiorgio M. d' Errico wrote:
> if one can explain how to camouflage x86/x86-64 binaries as 8080/z80
> binaries...
This is easy, for the 8080 the instructions c3 xx yy is a jump instruction,
the usual start of a CP/M program. For the x86 this is not a jump
instruction, c3 is a return from call instruction, so a CP/M program
executed on DOS does nothing. By using the instructions sets in some
more creative way you can write a program that branches to label_a on a
8080, but branches to label_b on a x86. If I remember right even Intel
published an example how to do this.
But this is not necessary if I know that a CP/M emulation has an
interface to the hosts filesystem, that allows to write bytes into
a file there. So I can write a CP/M program that does what it promises
to do, but has an additional payload, that also writes another valid
x86 program via the interface to the host. One has to hope of course
that it will get executed sometimes by someone, but there are ways
for that ;-)
> I surely will be very careful in handling dosbox & dosemu, but generally
> the entire reason dì etre of emulators (re. virtual machines) is that
> the binaries are mutually incompatible...
That is is primary reason for writing an emulator, yes.
> if your rationale is mispelling the filenames, let's give a look to the
> list of cpmtools's disk definitions:
>
> > diskdef ibm-3740
...
> guess how many mispelling after -f is possible... all potentially
> screwing a diskimage.
It was an example only, a well known one anyway. Destroying the images
is fine with me, guess how often I have destroyed an images my self
with buggy code ;-) That is why we have backups of the images.
But with the possibility to destroy the hosts UNIX or Windows filesystem
from running a CP/M program in an emulation with leaks, a whole other
class of treats is created.
> but it's your source code, and I don't push my disagreement into the
> extreme consequences (a forking), so let's close this point with an
> "agreement to disagree" :)
No problem, this is a valid request for a feature, I don't want to
implement it because of the implications with this. I am aware that
some of you want it, I have explained the implications. So please use
cpmtools to manage your disk images, because it won't have unwanted
side effects that are difficult to detect.