Is it possible to read/execute files/programs using the LBA addressing rather than the file system location
You can read and store data into a second file (based in RAM if you use a
tmpfs) one LBA at a time, turn on the execute bits, and execute what you stored.
dd is not far from
hdparm and will be a bit easier to work with, and you are practically doing the same thing if you use
dd on raw block devices like
For example can I execute /bin/sh using the LBA sector locations of it obtained using hdparm?
You would have to do the same thing the underlying filesystem does. For ext2/3/4, that means parse partition tables, find the superblock, search through inode tables, etc.
This is not typically trivial. You have to know exactly what the filesystem does and how it works. There's the source code for Ext2/3/4 that you could study, or any number of texts on the subject. For NTFS there's lots of similar info, both provided by Microsoft and discovered through reverse engineering as well.
If you are looking for an "easy-to-hack" filesystem, try FAT (not FAT32). It's very old and as a result very well documented.