2011年2月24日

利用ELF header保護程式

If you want to prevent your binary program from being executed on other platform, you can try this way.

In kernel/include/linux/elf-em.h


-#define EM_386 3

+#define EM_386 aa55

The  number means architecture, and kernel will parser the ELF header to check if the architecture of the binary program is the same as kernel. If not, you cant not execute this program.


Now, you can use this command to change the ELF head:

echo -en \\0252\\0125 dd of=lsusb bs=2 count=1 seek=9 conv=nocreat,notrunc

You can see what change in the ELF head


沒有留言: