GetModuleFileName Antivirus False Detection ??? Get current process PATH

969 views Asked by At

Hellow I am trying to retrive path off current process... here is my first code:

#include <windows.h>
#include <iostream>
using namespace std;
int CALLBACK WinMain(
    HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpCmdLine,
    int nCmdShow
)
{
  char loaded_file_name[MAX_PATH];
    GetModuleFileName(NULL, loaded_file_name, MAX_PATH);
    cout<<endl<<loaded_file_name<<endl;
    system("PAUSE");

}

But when I am tring to run it Avira antivir Detects it as : TR/Dropper.Gen :D I have no Idea why :D Here is a another code :

  #include <windows.h>
  #include <iostream>
  using namespace std;
   int main(int argc,char * argv[])
    {
        cout<<endl
            <<argv[0];  

        system("PAUSE>0");
    }

In that version TR/Dropper.Gen problem is fixed but ... i wan´t to use WinMain () so there is no argv[0] Can anyone know another method or function to retrive path ? without conflict with antivirus ?

1

There are 1 answers

1
orlp On BEST ANSWER

Your code was fine, you aren't the problem.

Antivirus software sucks, period.