Can I encrypt c source code at compile time?

110 views Asked by At

I want to encode some part of the source code at compile time.

The goal is that calls/references to the protected function/library do not show up in disassemblers like IDA Pro or Ghidra.

Eg.:

void ImportantFunction() {

    ENCODE_START(134);
    ...
    Code to encode
    ...
    ENCODE_END(0);

}

Here, 134 is encode key.

Is this possible? Does anyone know?

1

There are 1 answers

0
Kaz On

The goal is that calls/references to the protected function/library do not show up in disassemblers like IDA Pro or Ghidra.

Compile or hand translate the function to a custom byte code, which appears as just an array of data.

Off-the-shelf disassemblers won't know what that is.