Welcome to the Linux Foundation Forum!

Hide C code from "strings"

Hi,

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?

thx

Comments

  • woboyle
    woboyle Posts: 501
    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.
  • atreyu
    atreyu Posts: 216
    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!

Categories

Upcoming Training