Hide C code from "strings"

Link to this post 21 Oct 09


I have some C code that uses system calls (that cannot be done in native C) to get the job done. When you run "strings" on the code, those commands are displayed. Does anyone know how to get around this?


Link to this post 23 Oct 09

I presume you mean that you execute system() calls, or exec...() calls with command strings? No, you cannot hide them from the "strings" command unless you obfuscate them internally, then decode and execute them dynamically at runtime.

Link to this post 23 Oct 09

Yeah, that's what I meant. I didn't really state the question properly, though. Of course, the calls could be done in C (they already were, I'm just running the binaries), but I didn't want to re-use a bunch of someone's code in mine, if there was a quick and dirty way to do this. Someone else also mentioned the idea of encrypting the string first, similar to your idea - so i may go that route. Thanks!

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Linux Training / Board