communication.zip
Client.exe
Client
Client
release
Client.exe
Server.exe
Server
release
Server.exe
Server
x64
release
Server.exe
myregfilter.zip
makefile
objchk_wlh_x86
i386
MyRegFilter.sys
objchk_wxp_x86
i386
MyRegFilter.sys
objfre_wlh_amd64
amd64
MyRegFilter.sys
objfre_wxp_x86
i386
MyRegFilter.sys
sources
privileges.zip
privileges
privileges.exe.manifest
release
privileges.exe
randtest.zip
DynBaseApp
DynBaseApp.suo
DynBaseApp
RandTest
RandTest.suo
RandTest
x64
release
DynBaseApp.exe
RandTest.exe
x86
DynBaseApp.exe
RandTest.exe
smallwpf.zip
SmallWPF
bin
Release
Draft.PresentationDesignMarkup.dll
PresentationDesignCore.dll
PresentationDesignDeveloper.DLL
PresentationDesignFramework.dll
SmallWPF.exe
Properties
Settings.settings
test.zip
test
test.res
|
#include <Windows.h>
#include <tchar.h>
#define BUF_SIZE 256 * sizeof (TCHAR)
TCHAR MyEvent[] = _T("Global\\SharedMemoryEvent");
TCHAR szName[]= _T("Global\\MyFileMappingObject");
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLine, int iCmdShow)
{
//
// Create the event to communicate between server and client
//
HANDLE hEvent = CreateEvent(NULL, FALSE, FALSE, MyEvent);
//
// Start server process
//
PROCESS_INFORMATION pi = { 0 };
STARTUPINFO si = { 0 };
if (!CreateProcess(_T("Server.exe"), NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
return 1;
//
// Wait for the server to complete the job
//
WaitForSingleObject(hEvent, INFINITE);
//
// Access shared memory object
//
HANDLE hMapFile = OpenFileMapping(
FILE_MAP_ALL_ACCESS, // read/write access
FALSE, // do not inherit the name
szName); // name of mapping object
if (hMapFile == NULL) return 1;
LPCTSTR pBuf = (LPTSTR) MapViewOfFile(
hMapFile, // handle to map object
FILE_MAP_ALL_ACCESS, // read/write permission
0,
0,
BUF_SIZE);
if (pBuf == NULL) return 1;
//
// Shows Server Output
//
MessageBox(NULL, pBuf, _T("Server Output"), MB_OK);
UnmapViewOfFile(pBuf);
CloseHandle(hMapFile);
//
// Tell the server that the object isn't used any longer
//
SetEvent(hEvent);
return 0;
}
|
By viewing downloads associated with this article you agree to the Terms of use and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
The languages I know best are: C, C++, C#, Assembly (x86, x64, ARM), MSIL, Python, Lua. The environments I frequently use are: Qt, Win32, MFC, .NET, WDK. I'm a developer and a reverse engineer and I like playing around with internals.
You can find most of my work at
http://ntcore.com.