I need to use this for a Samsung Tablet.
Usually if the device is switched-off and the USB cable is being connected the display will wake up for some seconds showing
The change you'll need to make is in the bootloader.
That's the first thing that's started up, which comes long before the C environment gets initialized, or the kernel gets loaded, or even anything from the user space or from Android...
Bootloaders can vary significantly depending on the hardware they were written for, but there is little that's secret about them and you should be able to find the information you're looking for -- now that you know which keywords to use.