hi mk14882, Thanks a lot.. I think this would help me.. thank you once again.. I will check it and let you know. Regards 0x8085
0x8085
Posts
-
wrong output ,error in my program -
wrong output ,error in my programhi, Kill.exe is a small PE file with a function to display message box hello world. i want to create a file to an application to check whether the file is a pe file or not. for that i started with a first step of verifying the dos signature. you change the path "e:\\kill.exe" to any pe file it will compile. regards 0x8085
-
wrong output ,error in my programHi mk14882, thanks for replying. yes that was the mistake i think .. but i dint know how to fix it..still i am going googling for it. Regards 0x8085
-
wrong output ,error in my programhi to everyone here is my code below and i am newbie to programming
#include"stdafx.h"
#include"windows.h"
#include"winnt.h"int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int ncmdShow)
{
HANDLE hImage;
DWORD dwExitCode = 0;
IMAGE_DOS_HEADER imgdosh={0};
hImage = CreateFileA("E:\\kill.exe",GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);if (INVALID\_HANDLE\_VALUE == hImage) { MessageBoxA(NULL,"invalid file","err",MB\_OK); } HANDLE hfilemaping = CreateFileMapping(hImage,NULL,PAGE\_READONLY,0,0,0); { if(!hfilemaping) { MessageBoxA(NULL,"Mapping Fails","err",MB\_OK); }
HANDLE ndmapview = MapViewOfFile(hfilemaping,FILE_MAP_READ,0,0,0);
if(!ndmapview)
{
MessageBoxA(NULL,"Mapping Fails","err",MB_OK);
}if (IMAGE_DOS_SIGNATURE != imgdosh.e_magic)
{
MessageBoxA(NULL,"not a dos file","Suuc",MB_OK);
}
if (IMAGE_DOS_SIGNATURE == imgdosh.e_magic)
{
MessageBoxA(NULL,"dos file","Suuc",MB_OK);
}return 0;
}}
Question - Test.exe is a PE file but my program returns me a msgbox that "it is not a dos file".? what is the mistake i have done please can anyone help me to figure out.? Regards 0x8085
-
How to delete a file in AlluserProfile directory?hi i am very sorry for my bad englsih...
-
How to delete a file in AlluserProfile directory?Hi, I am newbie to vc++,So kindly bare with me. Some malicious exe file running in a folder c:\documentsandsetting\alluser\globel\phunk.exe I have killed the phunk.exe from the process and now i want to delete the file phunk.exe from the folder. how can i implement GetAllUsersProfileDirectory() APi to delete the file please can anyone put the same code for the above scenario.