In order to protect the target codes generated by compiler, this paper puts forward a scheme combining compiler with hardware platform on the base of the existing protection method of executable code First, classify codes of C Language into four security levels to determine the protection strategies for different codes. Secondly, design and implement the corresponding encryption module ,decryption module and decompression module in VHDL Language after studying the structure and the principle of FPGA and the method of development software Thirdly, decompress and decode the target codes through FPGA modules when target codes is being executed. Run the target codes only when they are qualified. Finally, implement and simulate the scheme through FPGA. The simulation experiment verifies the correctness and effectiveness of encryption module, decryption module and decompression module.