Expanding and reprogramming diesel engine for machine

Does anyone have any experience with: I would like to extend a diesel engine with ecu from a car (not yet defined) to use the motor with ecu for an own construction in order to drive the hydraulic pumps. does anyone have experience with it? can I reprogram the ecu myself? to release sensors/actors which then no longer exist (brake/gear etc.) to operate the motor with exhaust train only on their own? would be happy to receive any info.