I've converted a very simple bat file to an EXE.
my C file looks like this:
#include <stdlib.h>
int main(int argc, char const *argv[]) {
system("set PATH=%PATH%;%CD%\bin\ffmpeg");
system("node server.js");
return 0;
}
My resources.rc looks like this:
#include <windows.h>
A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "favicon.ico"
I compile it using:
windres -i resource.rc -o resource.o
tcc-o mediacenterjs.exe main.c resource.o
This works great! But Avast and several other anti-virus scanners are seeing my EXE as a threat. A "I-Worm/Nuwar.L" Trojan to be precise.
What can I change or add to the code so it won't get picked up as a virus.
One way to find out is to simply omit one of the lines to find out which one is triggering (or if it's both). With that said, your code isn't really very safe because it relies on the path settings of the computer to point to the correct
nodeexecutable.Also, you might want to check to see if your path settings actually persist after the first call to
systemruns.