Remapping is EXACTLY akin to flashing the BIOS on a computer or flashing the OS on a firewall/hub/router.
Google "checksum", the easiest task of all is detecting if the code has been changed, and for many purposes that is sufficient, it is not necessary to know how the code has been changed, merely that it has.
Quite frankly, how a gen u wine Brabus remap is allegedly worth a grand plus, while an updated driver for my colour laser printer is free, speaks volumes about the motor industry in general and so-called prestige marques and aficionados in particular.
The fact is that all the ECU's make a 1995 E-class significantly cheaper to manufacture than a 1985 E-class (for example) while also locking the customer in to a lifetime of maintenance.
If they don't already, expect the "limp home" mode to trigger automatically 14 days or 500 miles after a scheduled service.
The beauty of a CANbus based vehicle is that I can stick a device ANYWHERE on the "vehicle LAN" which does nothing but periodically check every other device to determine by checksum if the software has been altered... it could be literally embedded within an engine sub loom, or inside a rear passenger door loom, anywhere.
Those old jokes about "If Microsoft made cars" are pushing up the daisies, in effect MS do make cars, they changed the name to MB, and everyone else is following suit.
Now the whole idea of Open Source really starts to hit you in the pocket.
What does the Mercedes Benz Bosch engine management system do, that Megasquirt (do a google) doesn't?
http://classicmotorsports.net/project-cars/1969-volvo-142/megasquirt-installation/