How do I decrypt messages on my Repetier firmware?
Looking through the source I found Commands.cpp that has a loop.

void Commands::commandLoop() {
    while(true) {
        ...
        Commands::executeGCode(code);
    }
}


If we find the executeGCode method, we see that it calls:

processMCode(com);


And finding the processMCode method, we have the switch case you can add your own logic to.

void Commands::processMCode(GCode *com) {
    switch( com-&gt;M ) {
        case 3: // Spindle/laser on
            ...

        case 999: // Your custom logic


After decoding your encrypted string, I think it would be best to call back into the first method mentioned, and let the process start from the top with the unencrypted command.

case 999:

    // Custom logic
    executeGCode(unencrypted);
    break;