FakeExtension by DF_
Jest to program, który pozwala stworzyć fałszywe rozszerzenie dla pliku EXE.
Działa w systemach Windows 7, Windows 8 i Windows 8.1.
Mając plik test.exe możemy zrobić nazwę testexe.jpg.
Albo mając plik zdjeciemojej.exe zrobić nazwę zdjeciemojejexe.jpg.
Tworzy rozszerzenia JPG, PDF i TXT.
Mogą wystąpić problemy jeśli podamy dłuższą nazwę pliku.
fakeextension.jpg
Kod źródłowy main.cpp
Kod:
#include <Windows.h>
#include <Shlwapi.h>
#include <cstdio>
#pragma comment(lib,"Shlwapi.lib")
wchar_t filePath[MAX_PATH] = L"\0";
void GetFileDialog()
{
OPENFILENAME ofn;
wchar_t szFileName[MAX_PATH];
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.lpstrFile = szFileName;
ofn.lpstrTitle = L"Select file to spoof!";
ofn.lpstrFile[0] = '\0';
ofn.nMaxFile = MAX_PATH;
ofn.lpstrFilter = L"Executable files (*.exe)\0*.exe\0\0";
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_NOCHANGEDIR | OFN_FILEMUSTEXIST |
OFN_PATHMUSTEXIST | OFN_LONGNAMES |
OFN_EXPLORER | OFN_HIDEREADONLY;
if (GetOpenFileName(&ofn) != 0)
{
lstrcpyW(filePath, szFileName);
}
else
{
MessageBox(0, L"No file selected. Terminating...", L"DSpoofer", MB_OK + MB_ICONINFORMATION);
ExitProcess(0);
}
}
int main()
{
wchar_t wch = 8238;
wchar_t szDir[MAX_PATH] = L"\0";
wchar_t exten[8] = L"\0";
wchar_t newName[64] = L"\0";
wchar_t dest[MAX_PATH] = L"\0";
SetConsoleTitle(L"FakeExtension by DF_");
MessageBox(0, L"Welcome in FakeExtension. Select EXE file to spoof.", L"Info", MB_OK + MB_ICONINFORMATION);
GetFileDialog();
lstrcpyW(szDir, filePath);
PathRemoveFileSpecW(szDir);
wprintf(L"Enter the new file name: ");
wscanf_s(L"%s", newName);
int choice = 0;
while (choice != 1 && choice != 2 && choice != 3)
{
wprintf(L"Select extension:\n");
wprintf(L"[1] JPG \n");
wprintf(L"[2] PDF \n");
wprintf(L"[3] TXT \n");
wscanf_s(L"%d", &choice);
switch (choice)
{
case 1:
{
lstrcpyW(exten, L"gpj.");
}
break;
case 2:
{
lstrcpyW(exten, L"fdp.");
}
break;
case 3:
{
lstrcpyW(exten, L"txt.");
}
break;
default:
{
wprintf(L"Wrong input. Enter 1, 2 or 3. \n");
}
break;
}
}
lstrcatW(dest, szDir);
lstrcatW(dest, L"\\");
lstrcatW(dest, newName);
dest[lstrlen(dest)] = wch;
lstrcatW(dest, exten);
lstrcatW(dest, L"exe");
CopyFileW(filePath, dest, FALSE);
MessageBox(0, L"Spoofed file created successfully in current folder.", L"Info", MB_OK+MB_ICONINFORMATION);
return EXIT_SUCCESS;
}