How can I recover from flashing broken ROMs on my HTC One X? I am seeking your help to clear up some of my confusion in solving a problem with my HTC ONE X. I tried flashing a custom ROM on my HTC Android phone but all the files and partitions got messed up that every time it boots up, it is on a bootloop. I know the cause to this is due to a mixture of inconsistent (boot, recovery)partitions libraries that I have on the phone. 

Therefore, I want to FULLY WIPE OF ALL the data on the phone's storage and reinstall a clean set of libraries and stock rom. However, before I wipe off all data and install the new stock rom, I want to know all the commands that I can issue to correct this problem but the problem I have is that the stock zip has a boot.img, hboot.img and recovery.img along with a set of folders (System and Meta-inf folders) and I don't know the command that I can issue to push the folders I mentioned in the right partition, "/system" partition. Moreover, I cannot boot into any recovery modes (CWM or TWRP) so everything has to be done via fastboot commands, I think. 

I know I can execute the following commands if everything was an .img file but for the folders I do not know how to push them onto my phones storage. 

For example to push the boot content on the boot partition, I issue the following command to flash the device

fastboot erase boot 
fastboot flash boot boot.img 


and the following for the rest of the partitions:-

fastboot erase recovery 
fastboot flash recovery recovery.img


and so on.. 

So what would be the solution to push those folders that are non image related onto the right partitions?

Lastly, the phone is unlocked, CID: 11111111, Hboot: 1.09 and can only boot into fastboot mode for now. I also tried running the automatic RUU files via zip and exe formats but always fail due to signature or some other missing file error.
Download the latest recovery image for your device:

International HTC One X
AT&amp;T HTC One X

Connect your phone to computer via USB cable. Boot your phone into bootloader and issue:
fastboot flash recovery path/to/your/recovery.img
Boot your phone into recovery. Mount SD Card to USB in TWRP Recovery or use adb push to copy your custom ROM .zip file to phone.
Install your custom ROM from .zip file in TWRP.
Extract boot.img from root of your ROM .zip file to your computer.
Connect your phone to computer via USB cable. Boot your phone into bootloader and issue:
fastboot flash boot path/to/your/boot.img
Restart your phone to see if it can boot okay now.