@LHYX1,

First of all, I have tried to bind your script generated payload with other executable file. However, I do not like the result of the new binded executable file as the file description is missing.

If it is possible to inject your script generated payload (which is before compiled with gcc) to the executable file with msfencode with -k switch? I think that the msfencode method is the most perfect one. Or, can we make change to the msfencode template for that purpose? I have no idea on msfencode, so that I raise the question here.

Samiux