This commit is contained in:
2024-08-07 09:16:27 -04:00
parent fdfadd5c7e
commit 5f971cf684
5200 changed files with 731717 additions and 0 deletions

BIN
remoteps/APISPY.BMP Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@@ -0,0 +1 @@
regsvr32 exec. time

BIN
remoteps/Debug/remoteps.exe Normal file

Binary file not shown.

BIN
remoteps/Debug/remoteps.exp Normal file

Binary file not shown.

BIN
remoteps/Debug/remoteps.lib Normal file

Binary file not shown.

BIN
remoteps/Debug/remoteps.res Normal file

Binary file not shown.

BIN
remoteps/Debug/vc60.idb Normal file

Binary file not shown.

BIN
remoteps/Debug/vc60.pdb Normal file

Binary file not shown.

View File

@@ -0,0 +1,48 @@
#include "stdafx.h"
#include "remoteps.h"
#include "RemoteProcess.hpp"
#include <com/result.hpp>
RemoteProcess::RemoteProcess(void)
{
}
HRESULT RemoteProcess::Snapshot(VARIANT *pVariant)
{
return mRemoteProcessImpl.snapshot(pVariant).result();
}
HRESULT RemoteProcess::GetProcessFirst(VARIANT *pVariant)
{
return mRemoteProcessImpl.getProcessFirst(pVariant).result();
}
HRESULT RemoteProcess::GetProcessNext(VARIANT *pVariant)
{
return mRemoteProcessImpl.getProcessNext(pVariant).result();
}
HRESULT RemoteProcess::GetModuleFirst(VARIANT *pVariant)
{
return mRemoteProcessImpl.getModuleFirst(pVariant).result();
}
HRESULT RemoteProcess::GetModuleNext(VARIANT *pVariant)
{
return mRemoteProcessImpl.getModuleNext(pVariant).result();
}
STDMETHODIMP RemoteProcess::GetProcessTimes(VARIANT *pVariant,DATE *pCreationTime,DATE *pExitTime,DATE *pKernelTime,DATE *pUserTime)
{
return mRemoteProcessImpl.getProcessTimes(pVariant,pCreationTime,pExitTime,pKernelTime,pUserTime).result();
}
HRESULT RemoteProcess::GetDesktopWindow(VARIANT *pVariant)
{
return mRemoteProcessImpl.getDesktopWindow(pVariant).result();
}
HRESULT RemoteProcess::Kill(VARIANT *pVariant)
{
return mRemoteProcessImpl.kill(pVariant).result();
}

View File

@@ -0,0 +1,31 @@
#ifndef __REMOTEPROCESS_H_
#define __REMOTEPROCESS_H_
#include <remoteps/resource.h>
#ifndef _REMOTEPS_REMOTEPROCESSIMPL_HPP_
#include <remoteps/remoteprocessimpl.hpp>
#endif
class ATL_NO_VTABLE RemoteProcess :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<RemoteProcess,&CLSID_CoRemoteProcess>,
public IRemoteProcess
{
public:
RemoteProcess(void);
virtual HRESULT __stdcall Snapshot(VARIANT *pVariant);
virtual HRESULT __stdcall GetProcessFirst(VARIANT *pVariant);
virtual HRESULT __stdcall GetProcessNext(VARIANT *pVariant);
virtual HRESULT __stdcall GetModuleFirst(VARIANT *pVariant);
virtual HRESULT __stdcall GetModuleNext(VARIANT *pVariant);
virtual HRESULT __stdcall GetDesktopWindow(VARIANT *pVariant);
virtual HRESULT __stdcall GetProcessTimes(VARIANT *pVariant,DATE *pCreationTime,DATE *pExitTime,DATE *pKernelTime,DATE *pUserTime);
virtual HRESULT __stdcall Kill(VARIANT *pVariant);
DECLARE_REGISTRY_RESOURCEID(IDR_REMOTEPROCESS)
BEGIN_COM_MAP(RemoteProcess)
COM_INTERFACE_ENTRY(IRemoteProcess)
END_COM_MAP()
private:
RemoteProcessImpl mRemoteProcessImpl;
};
#endif //__REMOTEPROCESS_H_

View File

@@ -0,0 +1,21 @@
HKCR
{
RemoteProcess.RemoteProcess.1 = s 'RemoteProcess Class'
{
CLSID = s '{BD20693F-8D8A-11D3-B2F0-0050043ED4DB}'
}
RemoteProcess.RemoteProcess = s 'RemoteProcess Class'
{
CurVer = s 'RemoteProcess.RemoteProcess.1'
}
NoRemove CLSID
{
ForceRemove {BD20693F-8D8A-11D3-B2F0-0050043ED4DB} = s 'RemoteProcess Class'
{
ProgID = s 'RemoteProcess.RemoteProcess.1'
VersionIndependentProgID = s 'RemoteProcess.RemoteProcess'
LocalServer32 = s '%MODULE%'
val AppID = s '{BD206932-8D8A-11D3-B2F0-0050043ED4DB}'
}
}
}

View File

@@ -0,0 +1,186 @@
#include <remoteps/remoteprocessimpl.hpp>
#include <psapint/psapi.hpp>
#include <psapint/psapi95.hpp>
#include <com/result.hpp>
#include <com/safearray.hpp>
#include <common/widestr.hpp>
#include <common/version.hpp>
#include <common/process.hpp>
#include <common/systime.hpp>
#include <common/purebmp.hpp>
#include <common/gdata.hpp>
#include <common/bitmap.hpp>
#include <common/pathfnd.hpp>
#include <common/version.hpp>
#include <common/openfile.hpp>
#include <jpeg-6b/bmpjpg.hpp>
RemoteProcessImpl::RemoteProcessImpl(void)
: mCurrProcessIndex(0), mCurrModuleIndex(0)
{
}
RemoteProcessImpl::~RemoteProcessImpl()
{
}
ComResult RemoteProcessImpl::snapshot(VARIANT *pVariant)
{
WinVersionInfo versionInfo;
if(versionInfo.isWinNT())mProcessAPI.enumProcesses(mProcessInfoList);
else mProcessAPI95.enumProcesses(mProcessInfoList);
::VariantInit(pVariant);
pVariant->vt=VT_I4;
pVariant->lVal=mProcessInfoList.size();
return ComResult::Success;
}
ComResult RemoteProcessImpl::getProcessFirst(VARIANT *pVariant)
{
mCurrProcessIndex=0;
::VariantInit(pVariant);
pVariant->vt=VT_I4;
if(mProcessInfoList.size()<=mCurrProcessIndex)pVariant->lVal=-1;
else pVariant->lVal=mProcessInfoList[mCurrProcessIndex].processID().processID();
return ComResult::Success;
}
ComResult RemoteProcessImpl::getProcessNext(VARIANT *pVariant)
{
::VariantInit(pVariant);
pVariant->vt=VT_I4;
if((mCurrProcessIndex+1)>=mProcessInfoList.size())pVariant->lVal=-1;
else pVariant->lVal=mProcessInfoList[++mCurrProcessIndex].processID().processID();
return ComResult::Success;
}
ComResult RemoteProcessImpl::getModuleFirst(VARIANT *pVariant)
{
mCurrModuleIndex=0;
::VariantInit(pVariant);
if(mCurrProcessIndex>=mProcessInfoList.size()||mCurrModuleIndex>=mProcessInfoList[mCurrProcessIndex].size())
{
pVariant->vt=VT_I4;
pVariant->lVal=-1;
}
else
{
WideString wideString((mProcessInfoList[mCurrProcessIndex])[mCurrModuleIndex].moduleFileName());
pVariant->vt=VT_BSTR;
pVariant->bstrVal=::SysAllocString(&wideString[0]);
}
return ComResult::Success;
}
ComResult RemoteProcessImpl::getModuleNext(VARIANT *pVariant)
{
::VariantInit(pVariant);
if(mCurrProcessIndex>=mProcessInfoList.size()||(mCurrModuleIndex+1)>=mProcessInfoList[mCurrProcessIndex].size())
{
pVariant->vt=VT_I4;
pVariant->lVal=-1;
}
else
{
WideString wideString((mProcessInfoList[mCurrProcessIndex])[++mCurrModuleIndex].moduleFileName());
pVariant->vt=VT_BSTR;
pVariant->bstrVal=::SysAllocString(&wideString[0]);
}
return ComResult::Success;
}
ComResult RemoteProcessImpl::getProcessTimes(VARIANT *pVariant,DATE *pCreationTime,DATE *pExitTime,DATE *pKernelTime,DATE *pUserTime)
{
SystemTime sysCreationTime;
SystemTime sysExitTime;
SystemTime sysKernelTime;
SystemTime sysUserTime;
FILETIME creationTime;
FILETIME exitTime;
FILETIME kernelTime;
FILETIME userTime;
DWORD processID;
Process process;
if(!pVariant||pVariant->vt!=VT_I4)return ComResult::Error;
processID=pVariant->lVal;
if(!process.openProcess(processID))return ComResult::Error;
if(!::GetProcessTimes(process.getProcess(),&creationTime,&exitTime,&kernelTime,&userTime))return ComResult::Error;
::FileTimeToSystemTime(&creationTime,&sysCreationTime.getSYSTEMTIME());
::FileTimeToSystemTime(&exitTime,&sysExitTime.getSYSTEMTIME());
::FileTimeToSystemTime(&kernelTime,&sysKernelTime.getSYSTEMTIME());
::FileTimeToSystemTime(&userTime,&sysUserTime.getSYSTEMTIME());
::SystemTimeToVariantTime(&sysCreationTime.getSYSTEMTIME(),pCreationTime);
::SystemTimeToVariantTime(&sysExitTime.getSYSTEMTIME(),pExitTime);
::SystemTimeToVariantTime(&sysKernelTime.getSYSTEMTIME(),pKernelTime);
::SystemTimeToVariantTime(&sysUserTime.getSYSTEMTIME(),pUserTime);
return ComResult::Success;
}
ComResult RemoteProcessImpl::getDesktopWindow(VARIANT *pVariant)
{
FileHandle inFile;
PureBitmap pureBitmap;
SafeArray safeArray;
ArrayBound arrayBound;
GlobalData<BYTE> bitmapBytes;
BYTE *pData;
HWND hDesktopWindow;
String strPathFileName;
hDesktopWindow=::GetDesktopWindow();
if(!hDesktopWindow)return ComResult::Fail;
pureBitmap.windowBitmap(hDesktopWindow);
if(!pureBitmap.isOkay())return ComResult::Fail;
saveBitmap(pureBitmap,strPathFileName);
inFile.open(strPathFileName,FileHandle::Read);
if(!inFile.isOkay())return ComResult::Fail;
bitmapBytes.size(inFile.size()+sizeof(DWORD));
arrayBound.elements(bitmapBytes.size());
safeArray.create(VTUChar,arrayBound);
safeArray.accessData((void**)&pData);
*((DWORD*)pData)=bitmapBytes.size();
inFile.read(pData+sizeof(DWORD),inFile.size());
inFile.close();
::unlink(strPathFileName);
safeArray.unaccessData();
safeArray.disposition(SafeArray::Assume);
::VariantInit(pVariant);
pVariant->vt=VT_ARRAY;
pVariant->parray=safeArray.getSAFEARRAY();
return ComResult::Success;
}
ComResult RemoteProcessImpl::kill(VARIANT *pVariant)
{
return ComResult::Success;
}
void RemoteProcessImpl::saveBitmap(PureBitmap &pureBitmap,String &strPathFileName)
{
String strBitmapName("image000.bmp");
String strPathBitmapName;
BitmapInfo bmInfo;
PathFind pathFind;
PurePalette purePalette;
GlobalData<BYTE> bmBits;
WinVersionInfo versionInfo;
pathFind.getWindowsTempDirectory(strPathBitmapName);
strPathBitmapName+=strBitmapName;
strPathFileName=strPathBitmapName.betweenString(0,'.')+String(".tmp");
bmInfo.width(pureBitmap.width());
bmInfo.height(pureBitmap.height());
bmInfo.planes(1);
bmInfo.compression(BI_RGB);
bmInfo.bitCount(BitmapInfo::Bit24);
bmInfo.colorUsed(0);
bmInfo.colorImportant(0);
pureBitmap.getBitmapBits(bmBits,BitmapInfo::Bit24,true);
Bitmap bitmap(strPathBitmapName,bmInfo,bmBits);
bitmap.setPalette(purePalette.getPalette(),false);
bitmap.saveBitmap();
ImageConverter::convert(strPathBitmapName,strPathFileName,80);
}

View File

@@ -0,0 +1,38 @@
#ifndef _REMOTEPS_REMOTEPROCESSIMPL_HPP_
#define _REMOTEPS_REMOTEPROCESSIMPL_HPP_
#ifndef _COM_VARIANT_HPP_
#include <com/variant.hpp>
#endif
#ifndef _PSAPINT_PSAPI_HPP_
#include <psapint/psapi.hpp>
#endif
#ifndef _PSAPINT_PSAPI95_HPP_
#include <psapint/psapi95.hpp>
#endif
class String;
class PureBitmap;
class RemoteProcessImpl
{
public:
RemoteProcessImpl(void);
virtual ~RemoteProcessImpl();
ComResult snapshot(VARIANT *pVariant);
ComResult getProcessFirst(VARIANT *pVariant);
ComResult getProcessNext(VARIANT *pVariant);
ComResult getModuleFirst(VARIANT *pVariant);
ComResult getModuleNext(VARIANT *pVariant);
ComResult getDesktopWindow(VARIANT *pVariant);
ComResult getProcessTimes(VARIANT *pVariant,DATE *pCreationTime,DATE *pExitTime,DATE *pKernelTime,DATE *pUserTime);
ComResult kill(VARIANT *pVariant);
private:
void saveBitmap(PureBitmap &pureBitmap,String &strPathFileName);
ProcessAPI mProcessAPI;
ProcessAPI95 mProcessAPI95;
ProcessInfoList mProcessInfoList;
int mCurrProcessIndex;
int mCurrModuleIndex;
};
#endif

18
remoteps/Resource.h Normal file
View File

@@ -0,0 +1,18 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by remoteps.rc
//
#define IDS_PROJNAME 100
#define IDR_Remoteps 100
#define IDR_REMOTEPROCESS 101
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 201
#define _APS_NEXT_COMMAND_VALUE 32768
#define _APS_NEXT_CONTROL_VALUE 201
#define _APS_NEXT_SYMED_VALUE 102
#endif
#endif

10
remoteps/StdAfx.cpp Normal file
View File

@@ -0,0 +1,10 @@
// stdafx.cpp : source file that includes just the standard includes
// stdafx.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
#ifdef _ATL_STATIC_REGISTRY
#include <statreg.h>
#include <statreg.cpp>
#endif
#include <atlimpl.cpp>

32
remoteps/StdAfx.h Normal file
View File

@@ -0,0 +1,32 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently
#if !defined(AFX_STDAFX_H__BD206935_8D8A_11D3_B2F0_0050043ED4DB__INCLUDED_)
#define AFX_STDAFX_H__BD206935_8D8A_11D3_B2F0_0050043ED4DB__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#define _WIN32_WINNT 0x0400
#define _ATL_APARTMENT_THREADED
#include <atlbase.h>
//You may derive a class from CComModule and use it if you want to override
//something, but do not change the name of _Module
class CExeModule : public CComModule
{
public:
LONG Unlock();
DWORD dwThreadID;
};
extern CExeModule _Module;
#include <atlcom.h>
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__BD206935_8D8A_11D3_B2F0_0050043ED4DB__INCLUDED)

37
remoteps/dlldata.c Normal file
View File

@@ -0,0 +1,37 @@
/*********************************************************
DllData file -- generated by MIDL compiler
DO NOT ALTER THIS FILE
This file is regenerated by MIDL on every IDL file compile.
To completely reconstruct this file, delete it and rerun MIDL
on all the IDL files in this DLL, specifying this file for the
/dlldata command line option
*********************************************************/
#include <rpcproxy.h>
#ifdef __cplusplus
extern "C" {
#endif
EXTERN_PROXY_FILE( remoteps )
PROXYFILE_LIST_START
/* Start of list */
REFERENCE_PROXY_FILE( remoteps ),
/* End of list */
PROXYFILE_LIST_END
DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
#ifdef __cplusplus
} /*extern "C" */
#endif
/* end of generated dlldata file */

View File

@@ -0,0 +1,17 @@
:776D4A54 7773 :ja 776d4ac9
:776D4A56 325F33 :xor bl,byte ptr ds:[edi+33h]
:776D4A59 322E :xor ch,byte ptr ds:[esi]
:776D4A5B 67657468 :je 776d4ac7
:776D4A5F 6F :outsd
:776D4A60 7374 :jnb 776d4ad6
:776D4A62 62796E :bound edi,dword ptr ds:[ecx+6eh]
:776D4A65 61 :popad
:776D4A66 6D :insd
:776D4A67 65006765 :add byte ptr gs:[edi+65h],ah
:776D4A6B 7468 :je 776d4ad5
:776D4A6D 6F :outsd
:776D4A6E 7374 :jnb 776d4ae4
:776D4A70 6E :outsb
:776D4A71 61 :popad
:776D4A72 6D :insd
:776D4A73 6500 :add byte ptr gs:[eax],bl

BIN
remoteps/image000.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

202
remoteps/intercpt.cpp Normal file
View File

@@ -0,0 +1,202 @@
#include <remoteps/intercpt.hpp>
#include <bsptree/bintree.hpp>
#include <bsptree/iteratei.hpp>
WORD Intercept::performIntercept(Array<PureImport> &pureImports,DWORD baseAddress)
{
mBaseAddress=baseAddress;
loadImportDescriptors(pureImports);
moduleEntryPoints();
resolveImportNames(pureImports);
mImportModuleNames.remove();
size(0);
return TRUE;
}
void Intercept::loadImportDescriptors(Array<PureImport> &pureImports)
{
DWORD importCount(pureImports.size());
loadImportModuleNames();
for(long importIndex=0;importIndex<importCount;importIndex++)importEntryPoint(pureImports[importIndex]);
}
void Intercept::loadImportModuleNames(void)
{
loadImportModuleNamesEx();
}
void Intercept::loadImportModuleNamesEx(void)
{
mImportModuleNames.remove();
loadImportModuleNames(mImportModuleNames,baseAddress());
for(int index=0;index<mImportModuleNames.size();index++)
loadImportModuleNames(mImportModuleNames,(DWORD)::GetModuleHandle(mImportModuleNames[index]));
}
void Intercept::loadImportModuleNames(Block<String> &importModuleNames,DWORD baseAddress)
{
PIMAGE_DOS_HEADER npImageDosHeader;
PIMAGE_NT_HEADERS npImageNTHeader;
PIMAGE_IMPORT_DESCRIPTOR npImageImportDescriptor;
String strModuleName;
if(!baseAddress)return;
npImageDosHeader=(PIMAGE_DOS_HEADER)baseAddress;
if(::IsBadReadPtr((void*)baseAddress,sizeof(PIMAGE_NT_HEADERS)))return;
if(npImageDosHeader->e_magic!=IMAGE_DOS_SIGNATURE)return;
npImageNTHeader=(PIMAGE_NT_HEADERS)((char*)npImageDosHeader+npImageDosHeader->e_lfanew);
if(npImageNTHeader->Signature!=IMAGE_NT_SIGNATURE)return;
npImageImportDescriptor=(PIMAGE_IMPORT_DESCRIPTOR)((char*)baseAddress+npImageNTHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
if((char*)npImageImportDescriptor==(char*)npImageNTHeader)return;
while(npImageImportDescriptor->Name)
{
strModuleName=(char*)(baseAddress+npImageImportDescriptor->Name);
strModuleName=strModuleName.betweenString(0,'.');
strModuleName.upper();
if(!strModuleName.isNull()&&isascii(*((char*)strModuleName))&&!isInModuleNames(strModuleName,mImportModuleNames))mImportModuleNames.insert(&strModuleName);
npImageImportDescriptor++;
}
}
BOOL Intercept::isInModuleNames(const String &strModuleName,Block<String> &strModuleNames)
{
for(int index=0;index<strModuleNames.size();index++)if(strModuleName==strModuleNames[index])return TRUE;
return FALSE;
}
WORD Intercept::importEntryPoint(PureImport &pureImport)
{
DWORD entryPoint;
if(!pureImport.moduleName().isNull())
{
if(0!=(entryPoint=(DWORD)::GetProcAddress(::GetModuleHandle(pureImport.moduleName()),pureImport.importName())))
{
if(isWIN95Thunk((DWORD)entryPoint))
{
pureImport.importAddress(*((DWORD*)(((char*)entryPoint)+1)));
pureImport.thunkType(PureImport::WIN95Thunk);
}
else
{
pureImport.importAddress(entryPoint);
pureImport.thunkType(PureImport::StandardThunk);
}
return TRUE;
}
}
for(short moduleIndex=0;moduleIndex<mImportModuleNames.size();moduleIndex++)
{
if(0!=(entryPoint=(DWORD)::GetProcAddress(::GetModuleHandle(mImportModuleNames[moduleIndex]),pureImport.importName())))
{
pureImport.moduleName(mImportModuleNames[moduleIndex]);
if(isWIN95Thunk((DWORD)entryPoint))
{
pureImport.importAddress(*((DWORD*)(((char*)entryPoint)+1)));
pureImport.thunkType(PureImport::WIN95Thunk);
}
else
{
pureImport.importAddress(entryPoint);
pureImport.thunkType(PureImport::StandardThunk);
}
return TRUE;
}
}
return FALSE;
}
void Intercept::moduleEntryPoints(void)
{
BinaryTree<PureImport> importEntries;
QuickSort<PureImport> sortImport;
entryPoints(importEntries,mBaseAddress);
for(int index=0;index<mImportModuleNames.size();index++)entryPoints(importEntries,(DWORD)::GetModuleHandle(mImportModuleNames[index]));
TreeIteratorInorder<PureImport> impIterator(importEntries);
PureImport *pImport;
index=0;
size(importEntries.leaves());
while(0!=(pImport=impIterator++))operator[](index++)=*pImport;
sortImport.sortItems((Array<PureImport>&)*this);
}
// ApiSpy is watching for protection faults generated by this function by the
// while(pThunk->u1.Function) loop. ApiSpy knows the code sequence of the first
// line of code to dereference pThunk->u1.Function. If the dereference generates
// a fault, ApiSpy will advance the instruction pointer to the first nop instruction.
// see "apidebug.cpp" for the counterpart.
// modified:06/29/1999 for windows NT
// Added the isWIN95Thunk() code because the WINNT entry points are pure and do not need to be
// incremented. I have not tested the if statement for protection faults generated by this
// code change.
void Intercept::entryPoints(BinaryTree<PureImport> &importEntries,DWORD baseAddress)
{
PIMAGE_DOS_HEADER npImageDosHeader;
PIMAGE_NT_HEADERS npImageNTHeader;
PIMAGE_IMPORT_DESCRIPTOR npImageImportDescriptor;
PIMAGE_THUNK_DATA pThunk;
PureImport pureImport;
String moduleName;
npImageDosHeader=(PIMAGE_DOS_HEADER)baseAddress;
if(::IsBadReadPtr((void*)baseAddress,sizeof(PIMAGE_NT_HEADERS)))return;
if(npImageDosHeader->e_magic!=IMAGE_DOS_SIGNATURE)return;
npImageNTHeader=(PIMAGE_NT_HEADERS)((char*)npImageDosHeader+npImageDosHeader->e_lfanew);
if(npImageNTHeader->Signature!=IMAGE_NT_SIGNATURE)return;
npImageImportDescriptor=(PIMAGE_IMPORT_DESCRIPTOR)((char*)baseAddress+npImageNTHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
if((char*)npImageImportDescriptor==(char*)npImageNTHeader)return;
while(npImageImportDescriptor->Name)
{
pThunk=(PIMAGE_THUNK_DATA)(baseAddress+(DWORD)npImageImportDescriptor->FirstThunk);
moduleName=(char*)(baseAddress+npImageImportDescriptor->Name);
moduleName=moduleName.betweenString(0,'.');
moduleName.upper();
if(moduleName.isNull()||!isascii(*((char*)moduleName)))break;
while(pThunk->u1.Function)
{
if((int)pThunk->u1.Function==0xCCCCCCCC)break;
if(0xCC==HIBYTE(HIWORD((int)pThunk->u1.Function)))break;
pureImport.moduleName(moduleName);
if(isWIN95Thunk((DWORD)pThunk->u1.Function)||mVersionInfo.isWin95())
{
pureImport.importAddress(*((DWORD*)((char*)(((DWORD)pThunk->u1.Function)+1))));
pureImport.rewriteAddress((DWORD)&(*((DWORD*)((char*)(((DWORD)pThunk->u1.Function)+1)))));
pureImport.thunkType(PureImport::WIN95Thunk);
}
else
{
pureImport.importAddress((DWORD)pThunk->u1.Function);
pureImport.rewriteAddress((DWORD)&pThunk->u1.Function);
pureImport.thunkType(PureImport::StandardThunk);
}
_asm nop;
_asm nop;
importEntries.insert(pureImport);
pThunk++;
}
npImageImportDescriptor++;
}
}
void Intercept::resolveImportNames(Array<PureImport> &pureImport)
{
PureImport moduleImport;
DWORD importCount(pureImport.size());
BinarySearch<PureImport> searchImport((Array<PureImport>&)*this);
int resolved(0);
for(long importIndex=0;importIndex<importCount;importIndex++)
{
if(searchImport.searchItem(pureImport[importIndex],moduleImport))
{
pureImport[importIndex].importAddress(moduleImport.importAddress());
pureImport[importIndex].rewriteAddress(moduleImport.rewriteAddress());
pureImport[importIndex].thunkType(moduleImport.thunkType());
resolved++;
}
else pureImport[importIndex].rewriteAddress(0L);
}
}

76
remoteps/intercpt.hpp Normal file
View File

@@ -0,0 +1,76 @@
#ifndef _REMOTEPS_INTERCEPT_HPP_
#define _REMOTEPS_INTERCEPT_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif
#ifndef _COMMON_VERSIONINFO_HPP_
#include <common/version.hpp>
#endif
#ifndef _COMMON_BLOCK_HPP_
#include <common/block.hpp>
#endif
#ifndef _COMMON_QUICKSORT_HPP_
#include <common/qsort.hpp>
#endif
#ifndef _COMMON_BINARYSEARCH_HPP_
#include <common/binsrch.hpp>
#endif
#ifndef _COMMON_ARRAY_HPP_
#include <common/array.hpp>
#endif
#ifndef _IMAGE_PUREIMPORT_HPP_
#include <image/pureimp.hpp>
#endif
template <class T>
class BinaryTree;
class Intercept : public Array<PureImport>
{
public:
Intercept(void);
~Intercept();
WORD performIntercept(Array<PureImport> &pureImports,DWORD baseAddress);
private:
void loadImportDescriptors(Array<PureImport> &pureImports);
void loadImportModuleNames(void);
void moduleEntryPoints(void);
void resolveImportNames(Array<PureImport> &pureImport);
WORD importEntryPoint(PureImport &pureImport);
DWORD baseAddress(void)const;
WORD isWIN95Thunk(DWORD baseAddress);
void loadImportModuleNamesEx(void);
void loadImportModuleNames(Block<String> &importModuleNames,DWORD baseAddress);
BOOL isInModuleNames(const String &strModuleName,Block<String> &strModuleNames);
void entryPoints(BinaryTree<PureImport> &pureImports,DWORD baseAddress);
DWORD mBaseAddress;
Block<String> mImportModuleNames;
WinVersionInfo mVersionInfo;
};
inline
Intercept::Intercept(void)
{
}
inline
Intercept::~Intercept()
{
}
inline
DWORD Intercept::baseAddress(void)const
{
return mBaseAddress;
}
inline
WORD Intercept::isWIN95Thunk(DWORD baseAddress)
{
if(*((BYTE*)baseAddress)==0x68&&*(((BYTE*)baseAddress)+5)==0xE9)return TRUE;
return FALSE;
}
#endif

20
remoteps/procaddr.hpp Normal file
View File

@@ -0,0 +1,20 @@
#ifndef _REMOTEPS_PROCADDRESS_HPP_
#define _REMOTEPS_PROCADDRESS_HPP_
#if defined(_MSC_VER)
#pragma warning(disable:4700)
#endif
template <class T>
class ProcAddress
{
public:
typedef void (T::*LPFNMETHODVOID)(void);
ProcAddress(void);
virtual ~ProcAddress();
int getProcAddress(LPFNMETHODVOID lpfnMethod);
private:
};
#if defined(_MSC_VER)
#include <remoteps/procaddr.tpp>
#endif
#endif

34
remoteps/procaddr.tpp Normal file
View File

@@ -0,0 +1,34 @@
template <class T>
ProcAddress<T>::ProcAddress(void)
{
}
template <class T>
ProcAddress<T>::~ProcAddress()
{
}
#if defined(_MSC_VER)
template <class T>
int ProcAddress<T>::getProcAddress(LPFNMETHODVOID lpfnMethod)
{
typedef void (*LPFNPROCVOID)(void);
int methodAddress=*((int*)&lpfnMethod);
return methodAddress;
}
#else
template <class T>
int ProcAddress<T>::getProcAddress(void (T::* /*lpfnMethod*/ )(void))
{
typedef void (*LPFNPROCVOID)(void);
int methodAddress;
char assign[]={0x8B,0x5D,0x0C,0xC3};
char address[]={0x00,0x00,0x00,0x00};
*((DWORD*)address)=(DWORD)((DWORD*)assign);
((LPFNPROCVOID)address)();
return methodAddress;
}
#endif

468
remoteps/remoteps.001 Normal file
View File

@@ -0,0 +1,468 @@
# Microsoft Developer Studio Project File - Name="remoteps" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 5.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=remoteps - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "remoteps.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "remoteps.mak" CFG="remoteps - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "remoteps - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE "remoteps - Win32 Unicode Debug" (based on "Win32 (x86) Application")
!MESSAGE "remoteps - Win32 Release MinSize" (based on\
"Win32 (x86) Application")
!MESSAGE "remoteps - Win32 Release MinDependency" (based on\
"Win32 (x86) Application")
!MESSAGE "remoteps - Win32 Unicode Release MinSize" (based on\
"Win32 (x86) Application")
!MESSAGE "remoteps - Win32 Unicode Release MinDependency" (based on\
"Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "remoteps - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /Zp1 /MTd /Gm /Zi /Od /I "\work" /I "\parts" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "STRICT" /D "__FLAT__" /YX"windows.hpp" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# Begin Custom Build - Performing registration
OutDir=.\Debug
TargetPath=.\Debug\remoteps.exe
InputPath=.\Debug\remoteps.exe
SOURCE=$(InputPath)
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(TargetPath)" /RegServer
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
echo Server registration done!
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "DebugU"
# PROP BASE Intermediate_Dir "DebugU"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "DebugU"
# PROP Intermediate_Dir "DebugU"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /W3 /Gm /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /entry:"wWinMainCRTStartup" /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /entry:"wWinMainCRTStartup" /subsystem:windows /debug /machine:I386 /pdbtype:sept
# Begin Custom Build - Performing registration
OutDir=.\DebugU
TargetPath=.\DebugU\remoteps.exe
InputPath=.\DebugU\remoteps.exe
SOURCE=$(InputPath)
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(TargetPath)" /RegServer
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
echo Server registration done!
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinSize"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ReleaseMinSize"
# PROP BASE Intermediate_Dir "ReleaseMinSize"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "ReleaseMinSize"
# PROP Intermediate_Dir "ReleaseMinSize"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# Begin Custom Build - Performing registration
OutDir=.\ReleaseMinSize
TargetPath=.\ReleaseMinSize\remoteps.exe
InputPath=.\ReleaseMinSize\remoteps.exe
SOURCE=$(InputPath)
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(TargetPath)" /RegServer
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
echo Server registration done!
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinDependency"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ReleaseMinDependency"
# PROP BASE Intermediate_Dir "ReleaseMinDependency"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "ReleaseMinDependency"
# PROP Intermediate_Dir "ReleaseMinDependency"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# Begin Custom Build - Performing registration
OutDir=.\ReleaseMinDependency
TargetPath=.\ReleaseMinDependency\remoteps.exe
InputPath=.\ReleaseMinDependency\remoteps.exe
SOURCE=$(InputPath)
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(TargetPath)" /RegServer
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
echo Server registration done!
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinSize"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ReleaseUMinSize"
# PROP BASE Intermediate_Dir "ReleaseUMinSize"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "ReleaseUMinSize"
# PROP Intermediate_Dir "ReleaseUMinSize"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# Begin Custom Build - Performing registration
OutDir=.\ReleaseUMinSize
TargetPath=.\ReleaseUMinSize\remoteps.exe
InputPath=.\ReleaseUMinSize\remoteps.exe
SOURCE=$(InputPath)
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(TargetPath)" /RegServer
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
echo Server registration done!
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinDependency"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ReleaseUMinDependency"
# PROP BASE Intermediate_Dir "ReleaseUMinDependency"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "ReleaseUMinDependency"
# PROP Intermediate_Dir "ReleaseUMinDependency"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# Begin Custom Build - Performing registration
OutDir=.\ReleaseUMinDependency
TargetPath=.\ReleaseUMinDependency\remoteps.exe
InputPath=.\ReleaseUMinDependency\remoteps.exe
SOURCE=$(InputPath)
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(TargetPath)" /RegServer
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
echo Server registration done!
# End Custom Build
!ENDIF
# Begin Target
# Name "remoteps - Win32 Debug"
# Name "remoteps - Win32 Unicode Debug"
# Name "remoteps - Win32 Release MinSize"
# Name "remoteps - Win32 Release MinDependency"
# Name "remoteps - Win32 Unicode Release MinSize"
# Name "remoteps - Win32 Unicode Release MinDependency"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\RemoteProcess.cpp
# End Source File
# Begin Source File
SOURCE=.\RemoteProcessImpl.cpp
# End Source File
# Begin Source File
SOURCE=.\remoteps.cpp
# End Source File
# Begin Source File
SOURCE=.\remoteps.idl
!IF "$(CFG)" == "remoteps - Win32 Debug"
# Begin Custom Build - Performing MIDL step
InputPath=.\remoteps.idl
BuildCmds= \
midl /Oicf /h "remoteps.h" /iid "remoteps_i.c" "remoteps.idl"
".\remoteps.tlb" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps_i.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Debug"
# Begin Custom Build - Performing MIDL step
InputPath=.\remoteps.idl
BuildCmds= \
midl /Oicf /h "remoteps.h" /iid "remoteps_i.c" "remoteps.idl"
".\remoteps.tlb" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps_i.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinSize"
# Begin Custom Build - Performing MIDL step
InputPath=.\remoteps.idl
BuildCmds= \
midl /Oicf /h "remoteps.h" /iid "remoteps_i.c" "remoteps.idl"
".\remoteps.tlb" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps_i.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinDependency"
# Begin Custom Build - Performing MIDL step
InputPath=.\remoteps.idl
BuildCmds= \
midl /Oicf /h "remoteps.h" /iid "remoteps_i.c" "remoteps.idl"
".\remoteps.tlb" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps_i.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinSize"
# Begin Custom Build - Performing MIDL step
InputPath=.\remoteps.idl
BuildCmds= \
midl /Oicf /h "remoteps.h" /iid "remoteps_i.c" "remoteps.idl"
".\remoteps.tlb" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps_i.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinDependency"
# Begin Custom Build - Performing MIDL step
InputPath=.\remoteps.idl
BuildCmds= \
midl /Oicf /h "remoteps.h" /iid "remoteps_i.c" "remoteps.idl"
".\remoteps.tlb" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps_i.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\remoteps.rc
!IF "$(CFG)" == "remoteps - Win32 Debug"
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Debug"
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinSize"
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinDependency"
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinSize"
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinDependency"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\RemoteProcess.hpp
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=..\EXE\jpeg6b.lib
# End Source File
# End Group
# Begin Source File
SOURCE=..\EXE\mscommon.lib
# End Source File
# Begin Source File
SOURCE=..\EXE\psapint.lib
# End Source File
# Begin Source File
SOURCE=.\RemoteProcess.rgs
# End Source File
# Begin Source File
SOURCE=.\remoteps.rgs
# End Source File
# End Target
# End Project

BIN
remoteps/remoteps.aps Normal file

Binary file not shown.

15
remoteps/remoteps.clw Normal file
View File

@@ -0,0 +1,15 @@
; CLW file contains information for the MFC ClassWizard
[General Info]
Version=1
LastClass=
LastTemplate=CDialog
NewFileInclude1=#include "stdafx.h"
NewFileInclude2=#include "remoteps.h"
ODLFile=remoteps.idl
LastPage=0
ClassCount=0
ResourceCount=0

326
remoteps/remoteps.cpp Normal file
View File

@@ -0,0 +1,326 @@
// Note: Proxy/Stub Information
// To build a separate proxy/stub DLL,
// run nmake -f remotepsps.mk in the project directory.
#include "stdafx.h"
#include "resource.h"
#include "initguid.h"
#include "remoteps.h"
#include "remoteps_i.c"
#include "RemoteProcess.hpp"
#include <com/com.hpp>
#include <remoteps/procaddr.hpp>
#include <common/process.hpp>
#include <common/library.hpp>
#include <socket/wsadata.hpp>
class InterceptGetHostByName
{
public:
InterceptGetHostByName(const String &masquerade);
~InterceptGetHostByName();
private:
enum {CodeSize=32};
typedef hostent *(__stdcall *LPFNGETHOSTBYNAME)(const char *name);
bool intercept(void);
void createForwarderThunk(void);
bool setForwarderThunk(void);
DWORD getAddress(void);
hostent *__stdcall gethostbyname(const char *strHostName);
BYTE mForwarderThunk[CodeSize];
Process mThisProcess;
DWORD mBaseAddress;
hostent *mpHostEnt;
WSASystem mWSASystem;
bool mIsOkay;
};
InterceptGetHostByName::InterceptGetHostByName(const String &strMasquerade)
: mIsOkay(false), mBaseAddress(0)
{
mpHostEnt=::gethostbyname(strMasquerade);
if(!mpHostEnt)return;
mThisProcess.openProcess(::GetCurrentProcessId(),Process::AllAccess);
if(!mThisProcess.isOkay())return;
createForwarderThunk();
if(!intercept())return;
mIsOkay=true;
}
InterceptGetHostByName::~InterceptGetHostByName()
{
}
bool InterceptGetHostByName::intercept(void)
{
DWORD countBytes;
if(0==(mBaseAddress=getAddress()))return false;
if(!setForwarderThunk())return false;
return true;
}
void InterceptGetHostByName::createForwarderThunk(void)
{
ProcAddress<InterceptGetHostByName> procAddress;
mForwarderThunk[0]=0x51; // push ecx
mForwarderThunk[1]=0xB9; // mov ecx,this
*((unsigned*)(mForwarderThunk+2))=(unsigned)this; // "" ""
mForwarderThunk[6]=0x8B; // mov eax,[esp+12]
mForwarderThunk[7]=0x44; // ""
mForwarderThunk[8]=0x24; // ""
mForwarderThunk[9]=0x0C; // ""
mForwarderThunk[10]=0x50; // push eax
mForwarderThunk[11]=0x50; // push eax
mForwarderThunk[12]=0xB8; // mov eax,function address
*((unsigned*)(mForwarderThunk+13))=(unsigned)procAddress.getProcAddress((ProcAddress<InterceptGetHostByName>::LPFNMETHODVOID)&InterceptGetHostByName::gethostbyname);
mForwarderThunk[17]=0xFF; // call eax
mForwarderThunk[18]=0xD0; // "" ""
mForwarderThunk[19]=0x59; // pop ecx
mForwarderThunk[20]=0xC2; // retn 4
*((short*)(mForwarderThunk+21))=4; // "" ""
}
DWORD InterceptGetHostByName::getAddress(void)
{
Library sockLib("wsock32.dll");
if(!sockLib.isOkay())return false;
return (DWORD)sockLib.procAddress("gethostbyname");
}
bool InterceptGetHostByName::setForwarderThunk(void)
{
DWORD countBytes;
mThisProcess.writeProcessMemory((void*)mBaseAddress,mForwarderThunk,sizeof(mForwarderThunk),&countBytes);
return countBytes==sizeof(mForwarderThunk);
}
hostent *InterceptGetHostByName::gethostbyname(const char *hostname)
{
InterceptGetHostByName *pInterceptGetHostByName;
_asm mov pInterceptGetHostByName,ecx;
return pInterceptGetHostByName->mpHostEnt;
}
// **********************************************************************************
class InterceptGetComputerName
{
public:
InterceptGetComputerName(const String &masquerade);
~InterceptGetComputerName();
private:
enum {CodeSize=32};
typedef int (__stdcall *LPFNGETCOMPUTERNAME)(LPSTR lpComputerName,LPDWORD cbBytes);
bool intercept(void);
void createForwarderThunk(void);
bool setForwarderThunk(void);
DWORD getAddress(void);
int __stdcall getcomputername(LPSTR lpComputerName,LPDWORD cbBytes);
BYTE mForwarderThunk[CodeSize];
Process mThisProcess;
DWORD mBaseAddress;
WSASystem mWSASystem;
String mComputerName;
bool mIsOkay;
};
InterceptGetComputerName::InterceptGetComputerName(const String &strMasquerade)
: mIsOkay(false), mBaseAddress(0)
{
if(strMasquerade.isNull())return;
mComputerName=strMasquerade;
mThisProcess.openProcess(::GetCurrentProcessId(),Process::AllAccess);
if(!mThisProcess.isOkay())return;
createForwarderThunk();
if(!intercept())return;
mIsOkay=true;
}
InterceptGetComputerName::~InterceptGetComputerName()
{
}
bool InterceptGetComputerName::intercept(void)
{
DWORD countBytes;
if(0==(mBaseAddress=getAddress()))return false;
if(!setForwarderThunk())return false;
return true;
}
void InterceptGetComputerName::createForwarderThunk(void)
{
ProcAddress<InterceptGetComputerName> procAddress;
mForwarderThunk[0]=0x51; // push ecx
mForwarderThunk[1]=0xB9; // mov ecx,this
*((unsigned*)(mForwarderThunk+2))=(unsigned)this; // "" ""
mForwarderThunk[6]=0x8B; // mov eax,[esp+8]
mForwarderThunk[7]=0x44; // ""
mForwarderThunk[8]=0x24; // ""
mForwarderThunk[9]=0x0C; // ""
mForwarderThunk[10]=0x50; // push eax
mForwarderThunk[11]=0x8B; // mov eax,[esp+16]
mForwarderThunk[12]=0x44; // ""
mForwarderThunk[13]=0x24; // ""
mForwarderThunk[14]=0x14; // ""
mForwarderThunk[15]=0x50; // push eax
mForwarderThunk[15]=0x50; // push eax
// mForwarderThunk[11]=0x50; // push eax
mForwarderThunk[16]=0xB8; // mov eax,function address
*((unsigned*)(mForwarderThunk+17))=(unsigned)procAddress.getProcAddress((ProcAddress<InterceptGetComputerName>::LPFNMETHODVOID)&InterceptGetComputerName::getcomputername);
mForwarderThunk[21]=0xFF; // call eax
mForwarderThunk[22]=0xD0; // "" ""
mForwarderThunk[23]=0x59; // pop ecx
mForwarderThunk[24]=0xC2; // retn 8
*((short*)(mForwarderThunk+25))=8; // "" ""
}
DWORD InterceptGetComputerName::getAddress(void)
{
Library k32("kernel32.dll");
if(!k32.isOkay())return false;
return (DWORD)k32.procAddress("GetComputerNameW");
}
bool InterceptGetComputerName::setForwarderThunk(void)
{
DWORD countBytes;
mThisProcess.writeProcessMemory((void*)mBaseAddress,mForwarderThunk,sizeof(mForwarderThunk),&countBytes);
return countBytes==sizeof(mForwarderThunk);
}
int InterceptGetComputerName::getcomputername(LPSTR lpComputerName,LPDWORD cbBytes)
{
InterceptGetComputerName *pInterceptGetComputerName;
_asm mov pInterceptGetComputerName,ecx;
::strcpy(lpComputerName,"ganymede");
*cbBytes=::strlen("ganymede");
// return pInterceptGetHostByName->mpHostEnt;
return 1;
}
// ******************************************************************
LONG CExeModule::Unlock()
{
LONG l = CComModule::Unlock();
if (l == 0)
{
#if _WIN32_WINNT >= 0x0400
if (CoSuspendClassObjects() == S_OK)
PostThreadMessage(dwThreadID, WM_QUIT, 0, 0);
#else
PostThreadMessage(dwThreadID, WM_QUIT, 0, 0);
#endif
}
return l;
}
CExeModule _Module;
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_CoRemoteProcess, RemoteProcess)
END_OBJECT_MAP()
LPCTSTR FindOneOf(LPCTSTR p1, LPCTSTR p2)
{
while (*p1 != NULL)
{
LPCTSTR p = p2;
while (*p != NULL)
{
if (*p1 == *p++)
return p1+1;
}
p1++;
}
return NULL;
}
/////////////////////////////////////////////////////////////////////////////
extern "C" int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpCmdLine, int /*nShowCmd*/)
{
HRESULT hRes;
ComObj comObj;
// InterceptGetHostByName interceptGetHostByName("scas1user120.li.net");
// InterceptGetComputerName interceptGetComputerName("ganymede");
lpCmdLine = GetCommandLine(); //this line necessary for _ATL_MIN_CRT
// HRESULT hRes = CoInitialize(NULL);
hRes = CoInitialize(NULL);
// If you are running on NT 4.0 or higher you can use the following call
// instead to make the EXE free threaded.
// This means that calls come in on a random RPC thread
// hRes = CoInitializeEx(NULL, COINIT_MULTITHREADED);
// _ASSERTE(SUCCEEDED(hRes));
_Module.Init(ObjectMap, hInstance);
_Module.dwThreadID = GetCurrentThreadId();
TCHAR szTokens[] = _T("-/");
int nRet = 0;
BOOL bRun = TRUE;
LPCTSTR lpszToken = FindOneOf(lpCmdLine, szTokens);
while (lpszToken != NULL)
{
if (lstrcmpi(lpszToken, _T("UnregServer"))==0)
{
_Module.UpdateRegistryFromResource(IDR_Remoteps, FALSE);
nRet = _Module.UnregisterServer();
bRun = FALSE;
break;
}
if (lstrcmpi(lpszToken, _T("RegServer"))==0)
{
_Module.UpdateRegistryFromResource(IDR_Remoteps, TRUE);
nRet = _Module.RegisterServer(TRUE);
bRun = FALSE;
break;
}
lpszToken = FindOneOf(lpszToken, szTokens);
}
if (bRun)
{
hRes = _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER,REGCLS_MULTIPLEUSE);
_ASSERTE(SUCCEEDED(hRes));
MSG msg;
while (GetMessage(&msg, 0, 0, 0))
DispatchMessage(&msg);
_Module.RevokeClassObjects();
}
CoUninitialize();
return nRet;
}

465
remoteps/remoteps.dsp Normal file
View File

@@ -0,0 +1,465 @@
# Microsoft Developer Studio Project File - Name="remoteps" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=remoteps - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "remoteps.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "remoteps.mak" CFG="remoteps - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "remoteps - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE "remoteps - Win32 Unicode Debug" (based on "Win32 (x86) Application")
!MESSAGE "remoteps - Win32 Release MinSize" (based on "Win32 (x86) Application")
!MESSAGE "remoteps - Win32 Release MinDependency" (based on "Win32 (x86) Application")
!MESSAGE "remoteps - Win32 Unicode Release MinSize" (based on "Win32 (x86) Application")
!MESSAGE "remoteps - Win32 Unicode Release MinDependency" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "remoteps - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /Gz /MTd /Gm /ZI /Od /I "\work" /I "\parts" /I "\parts\sgi_stl" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "STRICT" /D "__FLAT__" /D "_ATL_FREE_THREADED" /YX"windows.hpp" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib wsock32.lib /nologo /subsystem:windows /machine:I386 /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
# Begin Custom Build - Performing registration
OutDir=.\Debug
TargetPath=.\Debug\remoteps.exe
InputPath=.\Debug\remoteps.exe
SOURCE="$(InputPath)"
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(TargetPath)" /RegServer
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
echo Server registration done!
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "DebugU"
# PROP BASE Intermediate_Dir "DebugU"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "DebugU"
# PROP Intermediate_Dir "DebugU"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /entry:"wWinMainCRTStartup" /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /entry:"wWinMainCRTStartup" /subsystem:windows /debug /machine:I386 /pdbtype:sept
# Begin Custom Build - Performing registration
OutDir=.\DebugU
TargetPath=.\DebugU\remoteps.exe
InputPath=.\DebugU\remoteps.exe
SOURCE="$(InputPath)"
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(TargetPath)" /RegServer
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
echo Server registration done!
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinSize"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ReleaseMinSize"
# PROP BASE Intermediate_Dir "ReleaseMinSize"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "ReleaseMinSize"
# PROP Intermediate_Dir "ReleaseMinSize"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# Begin Custom Build - Performing registration
OutDir=.\ReleaseMinSize
TargetPath=.\ReleaseMinSize\remoteps.exe
InputPath=.\ReleaseMinSize\remoteps.exe
SOURCE="$(InputPath)"
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(TargetPath)" /RegServer
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
echo Server registration done!
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinDependency"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ReleaseMinDependency"
# PROP BASE Intermediate_Dir "ReleaseMinDependency"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "ReleaseMinDependency"
# PROP Intermediate_Dir "ReleaseMinDependency"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# Begin Custom Build - Performing registration
OutDir=.\ReleaseMinDependency
TargetPath=.\ReleaseMinDependency\remoteps.exe
InputPath=.\ReleaseMinDependency\remoteps.exe
SOURCE="$(InputPath)"
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(TargetPath)" /RegServer
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
echo Server registration done!
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinSize"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ReleaseUMinSize"
# PROP BASE Intermediate_Dir "ReleaseUMinSize"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "ReleaseUMinSize"
# PROP Intermediate_Dir "ReleaseUMinSize"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# Begin Custom Build - Performing registration
OutDir=.\ReleaseUMinSize
TargetPath=.\ReleaseUMinSize\remoteps.exe
InputPath=.\ReleaseUMinSize\remoteps.exe
SOURCE="$(InputPath)"
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(TargetPath)" /RegServer
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
echo Server registration done!
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinDependency"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ReleaseUMinDependency"
# PROP BASE Intermediate_Dir "ReleaseUMinDependency"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "ReleaseUMinDependency"
# PROP Intermediate_Dir "ReleaseUMinDependency"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# Begin Custom Build - Performing registration
OutDir=.\ReleaseUMinDependency
TargetPath=.\ReleaseUMinDependency\remoteps.exe
InputPath=.\ReleaseUMinDependency\remoteps.exe
SOURCE="$(InputPath)"
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(TargetPath)" /RegServer
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
echo Server registration done!
# End Custom Build
!ENDIF
# Begin Target
# Name "remoteps - Win32 Debug"
# Name "remoteps - Win32 Unicode Debug"
# Name "remoteps - Win32 Release MinSize"
# Name "remoteps - Win32 Release MinDependency"
# Name "remoteps - Win32 Unicode Release MinSize"
# Name "remoteps - Win32 Unicode Release MinDependency"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\intercpt.cpp
# End Source File
# Begin Source File
SOURCE=.\RemoteProcess.cpp
# End Source File
# Begin Source File
SOURCE=.\RemoteProcessImpl.cpp
# End Source File
# Begin Source File
SOURCE=.\remoteps.cpp
# End Source File
# Begin Source File
SOURCE=.\remoteps.idl
!IF "$(CFG)" == "remoteps - Win32 Debug"
# PROP Ignore_Default_Tool 1
# Begin Custom Build - Performing MIDL step
InputPath=.\remoteps.idl
BuildCmds= \
midl /Oicf /h "remoteps.h" /iid "remoteps_i.c" "remoteps.idl"
".\remoteps.tlb" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps_i.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Debug"
# PROP Ignore_Default_Tool 1
# Begin Custom Build - Performing MIDL step
InputPath=.\remoteps.idl
BuildCmds= \
midl /Oicf /h "remoteps.h" /iid "remoteps_i.c" "remoteps.idl"
".\remoteps.tlb" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps_i.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinSize"
# PROP Ignore_Default_Tool 1
# Begin Custom Build - Performing MIDL step
InputPath=.\remoteps.idl
BuildCmds= \
midl /Oicf /h "remoteps.h" /iid "remoteps_i.c" "remoteps.idl"
".\remoteps.tlb" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps_i.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinDependency"
# PROP Ignore_Default_Tool 1
# Begin Custom Build - Performing MIDL step
InputPath=.\remoteps.idl
BuildCmds= \
midl /Oicf /h "remoteps.h" /iid "remoteps_i.c" "remoteps.idl"
".\remoteps.tlb" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps_i.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinSize"
# PROP Ignore_Default_Tool 1
# Begin Custom Build - Performing MIDL step
InputPath=.\remoteps.idl
BuildCmds= \
midl /Oicf /h "remoteps.h" /iid "remoteps_i.c" "remoteps.idl"
".\remoteps.tlb" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps_i.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinDependency"
# PROP Ignore_Default_Tool 1
# Begin Custom Build - Performing MIDL step
InputPath=.\remoteps.idl
BuildCmds= \
midl /Oicf /h "remoteps.h" /iid "remoteps_i.c" "remoteps.idl"
".\remoteps.tlb" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
".\remoteps_i.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\remoteps.rc
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\RemoteProcess.hpp
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\APISPY.BMP
# End Source File
# Begin Source File
SOURCE=..\EXE\com.lib
# End Source File
# End Group
# Begin Source File
SOURCE=.\RemoteProcess.rgs
# End Source File
# Begin Source File
SOURCE=.\remoteps.rgs
# End Source File
# Begin Source File
SOURCE=..\EXE\mscommon.lib
# End Source File
# Begin Source File
SOURCE=..\EXE\psapint.lib
# End Source File
# End Target
# End Project

122
remoteps/remoteps.dsw Normal file
View File

@@ -0,0 +1,122 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "bsptree"=..\BSPTREE\bsptree.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "common"=..\common\common.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "fileio"=..\FILEIO\fileio.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "image"=..\IMAGE\image.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "jpeg6b"="..\..\parts\jpeg-6b\jpeg6b.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "remoteps"=.\remoteps.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name bsptree
End Project Dependency
Begin Project Dependency
Project_Dep_Name apiparse
End Project Dependency
Begin Project Dependency
Project_Dep_Name fileio
End Project Dependency
Begin Project Dependency
Project_Dep_Name image
End Project Dependency
Begin Project Dependency
Project_Dep_Name socket
End Project Dependency
Begin Project Dependency
Project_Dep_Name jpeg6b
End Project Dependency
Begin Project Dependency
Project_Dep_Name common
End Project Dependency
}}}
###############################################################################
Project: "socket"=..\SOCKET\socket.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

353
remoteps/remoteps.h Normal file
View File

@@ -0,0 +1,353 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 5.01.0164 */
/* at Tue Jun 10 07:16:23 2003
*/
/* Compiler settings for remoteps.idl:
Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
error checks: allocation ref bounds_check enum stub_data
*/
//@@MIDL_FILE_HEADING( )
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 440
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __remoteps_h__
#define __remoteps_h__
#ifdef __cplusplus
extern "C"{
#endif
/* Forward Declarations */
#ifndef __IRemoteProcess_FWD_DEFINED__
#define __IRemoteProcess_FWD_DEFINED__
typedef interface IRemoteProcess IRemoteProcess;
#endif /* __IRemoteProcess_FWD_DEFINED__ */
#ifndef __CoRemoteProcess_FWD_DEFINED__
#define __CoRemoteProcess_FWD_DEFINED__
#ifdef __cplusplus
typedef class CoRemoteProcess CoRemoteProcess;
#else
typedef struct CoRemoteProcess CoRemoteProcess;
#endif /* __cplusplus */
#endif /* __CoRemoteProcess_FWD_DEFINED__ */
/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
void __RPC_USER MIDL_user_free( void __RPC_FAR * );
#ifndef __IRemoteProcess_INTERFACE_DEFINED__
#define __IRemoteProcess_INTERFACE_DEFINED__
/* interface IRemoteProcess */
/* [object][unique][helpstring][uuid] */
EXTERN_C const IID IID_IRemoteProcess;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("BD20693E-8D8A-11D3-B2F0-0050043ED4DB")
IRemoteProcess : public IUnknown
{
public:
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Snapshot(
/* [retval][out] */ VARIANT __RPC_FAR *pVariant) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetProcessFirst(
/* [retval][out] */ VARIANT __RPC_FAR *pVariant) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetProcessNext(
/* [retval][out] */ VARIANT __RPC_FAR *pVariant) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetModuleFirst(
/* [retval][out] */ VARIANT __RPC_FAR *pVariant) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetModuleNext(
/* [retval][out] */ VARIANT __RPC_FAR *pVariant) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDesktopWindow(
/* [retval][out] */ VARIANT __RPC_FAR *pVariant) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetProcessTimes(
/* [in] */ VARIANT __RPC_FAR *pVariant,
/* [out] */ DATE __RPC_FAR *pCreationTime,
/* [out] */ DATE __RPC_FAR *pExitTime,
/* [out] */ DATE __RPC_FAR *pKernelTime,
/* [out] */ DATE __RPC_FAR *pUserTime) = 0;
virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Kill(
/* [retval][out] */ VARIANT __RPC_FAR *pVariant) = 0;
};
#else /* C style interface */
typedef struct IRemoteProcessVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *QueryInterface )(
IRemoteProcess __RPC_FAR * This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject);
ULONG ( STDMETHODCALLTYPE __RPC_FAR *AddRef )(
IRemoteProcess __RPC_FAR * This);
ULONG ( STDMETHODCALLTYPE __RPC_FAR *Release )(
IRemoteProcess __RPC_FAR * This);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Snapshot )(
IRemoteProcess __RPC_FAR * This,
/* [retval][out] */ VARIANT __RPC_FAR *pVariant);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetProcessFirst )(
IRemoteProcess __RPC_FAR * This,
/* [retval][out] */ VARIANT __RPC_FAR *pVariant);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetProcessNext )(
IRemoteProcess __RPC_FAR * This,
/* [retval][out] */ VARIANT __RPC_FAR *pVariant);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetModuleFirst )(
IRemoteProcess __RPC_FAR * This,
/* [retval][out] */ VARIANT __RPC_FAR *pVariant);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetModuleNext )(
IRemoteProcess __RPC_FAR * This,
/* [retval][out] */ VARIANT __RPC_FAR *pVariant);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetDesktopWindow )(
IRemoteProcess __RPC_FAR * This,
/* [retval][out] */ VARIANT __RPC_FAR *pVariant);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *GetProcessTimes )(
IRemoteProcess __RPC_FAR * This,
/* [in] */ VARIANT __RPC_FAR *pVariant,
/* [out] */ DATE __RPC_FAR *pCreationTime,
/* [out] */ DATE __RPC_FAR *pExitTime,
/* [out] */ DATE __RPC_FAR *pKernelTime,
/* [out] */ DATE __RPC_FAR *pUserTime);
/* [helpstring] */ HRESULT ( STDMETHODCALLTYPE __RPC_FAR *Kill )(
IRemoteProcess __RPC_FAR * This,
/* [retval][out] */ VARIANT __RPC_FAR *pVariant);
END_INTERFACE
} IRemoteProcessVtbl;
interface IRemoteProcess
{
CONST_VTBL struct IRemoteProcessVtbl __RPC_FAR *lpVtbl;
};
#ifdef COBJMACROS
#define IRemoteProcess_QueryInterface(This,riid,ppvObject) \
(This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
#define IRemoteProcess_AddRef(This) \
(This)->lpVtbl -> AddRef(This)
#define IRemoteProcess_Release(This) \
(This)->lpVtbl -> Release(This)
#define IRemoteProcess_Snapshot(This,pVariant) \
(This)->lpVtbl -> Snapshot(This,pVariant)
#define IRemoteProcess_GetProcessFirst(This,pVariant) \
(This)->lpVtbl -> GetProcessFirst(This,pVariant)
#define IRemoteProcess_GetProcessNext(This,pVariant) \
(This)->lpVtbl -> GetProcessNext(This,pVariant)
#define IRemoteProcess_GetModuleFirst(This,pVariant) \
(This)->lpVtbl -> GetModuleFirst(This,pVariant)
#define IRemoteProcess_GetModuleNext(This,pVariant) \
(This)->lpVtbl -> GetModuleNext(This,pVariant)
#define IRemoteProcess_GetDesktopWindow(This,pVariant) \
(This)->lpVtbl -> GetDesktopWindow(This,pVariant)
#define IRemoteProcess_GetProcessTimes(This,pVariant,pCreationTime,pExitTime,pKernelTime,pUserTime) \
(This)->lpVtbl -> GetProcessTimes(This,pVariant,pCreationTime,pExitTime,pKernelTime,pUserTime)
#define IRemoteProcess_Kill(This,pVariant) \
(This)->lpVtbl -> Kill(This,pVariant)
#endif /* COBJMACROS */
#endif /* C style interface */
/* [helpstring] */ HRESULT STDMETHODCALLTYPE IRemoteProcess_Snapshot_Proxy(
IRemoteProcess __RPC_FAR * This,
/* [retval][out] */ VARIANT __RPC_FAR *pVariant);
void __RPC_STUB IRemoteProcess_Snapshot_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring] */ HRESULT STDMETHODCALLTYPE IRemoteProcess_GetProcessFirst_Proxy(
IRemoteProcess __RPC_FAR * This,
/* [retval][out] */ VARIANT __RPC_FAR *pVariant);
void __RPC_STUB IRemoteProcess_GetProcessFirst_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring] */ HRESULT STDMETHODCALLTYPE IRemoteProcess_GetProcessNext_Proxy(
IRemoteProcess __RPC_FAR * This,
/* [retval][out] */ VARIANT __RPC_FAR *pVariant);
void __RPC_STUB IRemoteProcess_GetProcessNext_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring] */ HRESULT STDMETHODCALLTYPE IRemoteProcess_GetModuleFirst_Proxy(
IRemoteProcess __RPC_FAR * This,
/* [retval][out] */ VARIANT __RPC_FAR *pVariant);
void __RPC_STUB IRemoteProcess_GetModuleFirst_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring] */ HRESULT STDMETHODCALLTYPE IRemoteProcess_GetModuleNext_Proxy(
IRemoteProcess __RPC_FAR * This,
/* [retval][out] */ VARIANT __RPC_FAR *pVariant);
void __RPC_STUB IRemoteProcess_GetModuleNext_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring] */ HRESULT STDMETHODCALLTYPE IRemoteProcess_GetDesktopWindow_Proxy(
IRemoteProcess __RPC_FAR * This,
/* [retval][out] */ VARIANT __RPC_FAR *pVariant);
void __RPC_STUB IRemoteProcess_GetDesktopWindow_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring] */ HRESULT STDMETHODCALLTYPE IRemoteProcess_GetProcessTimes_Proxy(
IRemoteProcess __RPC_FAR * This,
/* [in] */ VARIANT __RPC_FAR *pVariant,
/* [out] */ DATE __RPC_FAR *pCreationTime,
/* [out] */ DATE __RPC_FAR *pExitTime,
/* [out] */ DATE __RPC_FAR *pKernelTime,
/* [out] */ DATE __RPC_FAR *pUserTime);
void __RPC_STUB IRemoteProcess_GetProcessTimes_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
/* [helpstring] */ HRESULT STDMETHODCALLTYPE IRemoteProcess_Kill_Proxy(
IRemoteProcess __RPC_FAR * This,
/* [retval][out] */ VARIANT __RPC_FAR *pVariant);
void __RPC_STUB IRemoteProcess_Kill_Stub(
IRpcStubBuffer *This,
IRpcChannelBuffer *_pRpcChannelBuffer,
PRPC_MESSAGE _pRpcMessage,
DWORD *_pdwStubPhase);
#endif /* __IRemoteProcess_INTERFACE_DEFINED__ */
#ifndef __REMOTEPSLib_LIBRARY_DEFINED__
#define __REMOTEPSLib_LIBRARY_DEFINED__
/* library REMOTEPSLib */
/* [helpstring][version][uuid] */
EXTERN_C const IID LIBID_REMOTEPSLib;
EXTERN_C const CLSID CLSID_CoRemoteProcess;
#ifdef __cplusplus
class DECLSPEC_UUID("BD20693F-8D8A-11D3-B2F0-0050043ED4DB")
CoRemoteProcess;
#endif
#endif /* __REMOTEPSLib_LIBRARY_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
unsigned long __RPC_USER VARIANT_UserSize( unsigned long __RPC_FAR *, unsigned long , VARIANT __RPC_FAR * );
unsigned char __RPC_FAR * __RPC_USER VARIANT_UserMarshal( unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, VARIANT __RPC_FAR * );
unsigned char __RPC_FAR * __RPC_USER VARIANT_UserUnmarshal(unsigned long __RPC_FAR *, unsigned char __RPC_FAR *, VARIANT __RPC_FAR * );
void __RPC_USER VARIANT_UserFree( unsigned long __RPC_FAR *, VARIANT __RPC_FAR * );
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif

46
remoteps/remoteps.idl Normal file
View File

@@ -0,0 +1,46 @@
// remoteps.idl : IDL source for remoteps.dll
//
// This file will be processed by the MIDL tool to
// produce the type library (remoteps.tlb) and marshalling code.
import "oaidl.idl";
import "ocidl.idl";
[
uuid(BD20693E-8D8A-11D3-B2F0-0050043ED4DB),
helpstring("IRemoteProcess Interface"),
pointer_default(unique)
]
interface IRemoteProcess : IUnknown
{
[helpstring("method Snapshot")] HRESULT Snapshot([out, retval] VARIANT *pVariant);
[helpstring("method GetProcessFirst")] HRESULT GetProcessFirst([out, retval] VARIANT *pVariant);
[helpstring("method GetProcessNext")] HRESULT GetProcessNext([out, retval] VARIANT *pVariant);
[helpstring("method GetModuleFirst")] HRESULT GetModuleFirst([out, retval] VARIANT *pVariant);
[helpstring("method GetModuleNext")] HRESULT GetModuleNext([out, retval] VARIANT *pVariant);
[helpstring("method GetDesktopWindow")] HRESULT GetDesktopWindow([out,retval] VARIANT *pVariant);
[helpstring("method GetProcessTimes")] HRESULT GetProcessTimes([in] VARIANT *pVariant,[out] DATE *pCreationTime,[out] DATE *pExitTime,[out] DATE *pKernelTime,[out] DATE *pUserTime);
[helpstring("method Kill")] HRESULT Kill([out, retval] VARIANT *pVariant);
};
[
uuid(BD206931-8D8A-11D3-B2F0-0050043ED4DB),
version(1.0),
helpstring("remoteps 1.0 Type Library")
]
library REMOTEPSLib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
[
uuid(BD20693F-8D8A-11D3-B2F0-0050043ED4DB),
helpstring("RemoteProcess Class")
]
coclass CoRemoteProcess
{
[default] interface IRemoteProcess;
};
};

916
remoteps/remoteps.mak Normal file
View File

@@ -0,0 +1,916 @@
# Microsoft Developer Studio Generated NMAKE File, Based on remoteps.dsp
!IF "$(CFG)" == ""
CFG=remoteps - Win32 Debug
!MESSAGE No configuration specified. Defaulting to remoteps - Win32 Debug.
!ENDIF
!IF "$(CFG)" != "remoteps - Win32 Debug" && "$(CFG)" !=\
"remoteps - Win32 Unicode Debug" && "$(CFG)" !=\
"remoteps - Win32 Release MinSize" && "$(CFG)" !=\
"remoteps - Win32 Release MinDependency" && "$(CFG)" !=\
"remoteps - Win32 Unicode Release MinSize" && "$(CFG)" !=\
"remoteps - Win32 Unicode Release MinDependency"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "remoteps.mak" CFG="remoteps - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "remoteps - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE "remoteps - Win32 Unicode Debug" (based on "Win32 (x86) Application")
!MESSAGE "remoteps - Win32 Release MinSize" (based on\
"Win32 (x86) Application")
!MESSAGE "remoteps - Win32 Release MinDependency" (based on\
"Win32 (x86) Application")
!MESSAGE "remoteps - Win32 Unicode Release MinSize" (based on\
"Win32 (x86) Application")
!MESSAGE "remoteps - Win32 Unicode Release MinDependency" (based on\
"Win32 (x86) Application")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "remoteps - Win32 Debug"
OUTDIR=.\Debug
INTDIR=.\Debug
# Begin Custom Macros
OutDir=.\Debug
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\remoteps.exe" "$(OutDir)\regsvr32.trg"
!ELSE
ALL : "$(OUTDIR)\remoteps.exe" "$(OutDir)\regsvr32.trg"
!ENDIF
CLEAN :
-@erase "$(INTDIR)\RemoteProcess.obj"
-@erase "$(INTDIR)\remoteps.obj"
-@erase "$(INTDIR)\remoteps.pch"
-@erase "$(INTDIR)\remoteps.res"
-@erase "$(INTDIR)\StdAfx.obj"
-@erase "$(INTDIR)\vc50.idb"
-@erase "$(INTDIR)\vc50.pdb"
-@erase "$(OUTDIR)\remoteps.exe"
-@erase "$(OUTDIR)\remoteps.ilk"
-@erase "$(OUTDIR)\remoteps.pdb"
-@erase "$(OutDir)\regsvr32.trg"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /Zp1 /MLd /W1 /Gm /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS"\
/D "STRICT" /D "__FLAT__" /Fp"$(INTDIR)\remoteps.pch" /Yu"stdafx.h"\
/Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
CPP_OBJS=.\Debug/
CPP_SBRS=.
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\remoteps.res" /d "_DEBUG"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\remoteps.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
odbccp32.lib /nologo /subsystem:windows /incremental:yes\
/pdb:"$(OUTDIR)\remoteps.pdb" /debug /machine:I386\
/out:"$(OUTDIR)\remoteps.exe" /pdbtype:sept
LINK32_OBJS= \
"$(INTDIR)\RemoteProcess.obj" \
"$(INTDIR)\remoteps.obj" \
"$(INTDIR)\remoteps.res" \
"$(INTDIR)\StdAfx.obj" \
"..\EXE\mscommon.lib" \
"..\EXE\psapint.lib"
"$(OUTDIR)\remoteps.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
OutDir=.\Debug
TargetPath=.\Debug\remoteps.exe
InputPath=.\Debug\remoteps.exe
SOURCE=$(InputPath)
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(TargetPath)" /RegServer
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
echo Server registration done!
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Debug"
OUTDIR=.\DebugU
INTDIR=.\DebugU
# Begin Custom Macros
OutDir=.\DebugU
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\remoteps.exe" "$(OutDir)\regsvr32.trg"
!ELSE
ALL : "$(OUTDIR)\remoteps.exe" "$(OutDir)\regsvr32.trg"
!ENDIF
CLEAN :
-@erase "$(INTDIR)\RemoteProcess.obj"
-@erase "$(INTDIR)\remoteps.obj"
-@erase "$(INTDIR)\remoteps.pch"
-@erase "$(INTDIR)\remoteps.res"
-@erase "$(INTDIR)\StdAfx.obj"
-@erase "$(INTDIR)\vc50.idb"
-@erase "$(INTDIR)\vc50.pdb"
-@erase "$(OUTDIR)\remoteps.exe"
-@erase "$(OUTDIR)\remoteps.ilk"
-@erase "$(OUTDIR)\remoteps.pdb"
-@erase "$(OutDir)\regsvr32.trg"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /MLd /W3 /Gm /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D\
"_UNICODE" /Fp"$(INTDIR)\remoteps.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\"\
/Fd"$(INTDIR)\\" /FD /c
CPP_OBJS=.\DebugU/
CPP_SBRS=.
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\remoteps.res" /d "_DEBUG"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\remoteps.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
odbccp32.lib /nologo /entry:"wWinMainCRTStartup" /subsystem:windows\
/incremental:yes /pdb:"$(OUTDIR)\remoteps.pdb" /debug /machine:I386\
/out:"$(OUTDIR)\remoteps.exe" /pdbtype:sept
LINK32_OBJS= \
"$(INTDIR)\RemoteProcess.obj" \
"$(INTDIR)\remoteps.obj" \
"$(INTDIR)\remoteps.res" \
"$(INTDIR)\StdAfx.obj" \
"..\EXE\mscommon.lib" \
"..\EXE\psapint.lib"
"$(OUTDIR)\remoteps.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
OutDir=.\DebugU
TargetPath=.\DebugU\remoteps.exe
InputPath=.\DebugU\remoteps.exe
SOURCE=$(InputPath)
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(TargetPath)" /RegServer
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
echo Server registration done!
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinSize"
OUTDIR=.\ReleaseMinSize
INTDIR=.\ReleaseMinSize
# Begin Custom Macros
OutDir=.\ReleaseMinSize
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\remoteps.exe" "$(OutDir)\regsvr32.trg"
!ELSE
ALL : "$(OUTDIR)\remoteps.exe" "$(OutDir)\regsvr32.trg"
!ENDIF
CLEAN :
-@erase "$(INTDIR)\RemoteProcess.obj"
-@erase "$(INTDIR)\remoteps.obj"
-@erase "$(INTDIR)\remoteps.pch"
-@erase "$(INTDIR)\remoteps.res"
-@erase "$(INTDIR)\StdAfx.obj"
-@erase "$(INTDIR)\vc50.idb"
-@erase "$(OUTDIR)\remoteps.exe"
-@erase "$(OutDir)\regsvr32.trg"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /ML /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_ATL_DLL"\
/D "_ATL_MIN_CRT" /Fp"$(INTDIR)\remoteps.pch" /Yu"stdafx.h" /Fo"$(INTDIR)\\"\
/Fd"$(INTDIR)\\" /FD /c
CPP_OBJS=.\ReleaseMinSize/
CPP_SBRS=.
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\remoteps.res" /d "NDEBUG"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\remoteps.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
odbccp32.lib /nologo /subsystem:windows /incremental:no\
/pdb:"$(OUTDIR)\remoteps.pdb" /machine:I386 /out:"$(OUTDIR)\remoteps.exe"
LINK32_OBJS= \
"$(INTDIR)\RemoteProcess.obj" \
"$(INTDIR)\remoteps.obj" \
"$(INTDIR)\remoteps.res" \
"$(INTDIR)\StdAfx.obj" \
"..\EXE\mscommon.lib" \
"..\EXE\psapint.lib"
"$(OUTDIR)\remoteps.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
OutDir=.\ReleaseMinSize
TargetPath=.\ReleaseMinSize\remoteps.exe
InputPath=.\ReleaseMinSize\remoteps.exe
SOURCE=$(InputPath)
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(TargetPath)" /RegServer
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
echo Server registration done!
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinDependency"
OUTDIR=.\ReleaseMinDependency
INTDIR=.\ReleaseMinDependency
# Begin Custom Macros
OutDir=.\ReleaseMinDependency
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\remoteps.exe" "$(OutDir)\regsvr32.trg"
!ELSE
ALL : "$(OUTDIR)\remoteps.exe" "$(OutDir)\regsvr32.trg"
!ENDIF
CLEAN :
-@erase "$(INTDIR)\RemoteProcess.obj"
-@erase "$(INTDIR)\remoteps.obj"
-@erase "$(INTDIR)\remoteps.pch"
-@erase "$(INTDIR)\remoteps.res"
-@erase "$(INTDIR)\StdAfx.obj"
-@erase "$(INTDIR)\vc50.idb"
-@erase "$(OUTDIR)\remoteps.exe"
-@erase "$(OutDir)\regsvr32.trg"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /ML /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D\
"_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Fp"$(INTDIR)\remoteps.pch"\
/Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
CPP_OBJS=.\ReleaseMinDependency/
CPP_SBRS=.
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\remoteps.res" /d "NDEBUG"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\remoteps.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
odbccp32.lib /nologo /subsystem:windows /incremental:no\
/pdb:"$(OUTDIR)\remoteps.pdb" /machine:I386 /out:"$(OUTDIR)\remoteps.exe"
LINK32_OBJS= \
"$(INTDIR)\RemoteProcess.obj" \
"$(INTDIR)\remoteps.obj" \
"$(INTDIR)\remoteps.res" \
"$(INTDIR)\StdAfx.obj" \
"..\EXE\mscommon.lib" \
"..\EXE\psapint.lib"
"$(OUTDIR)\remoteps.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
OutDir=.\ReleaseMinDependency
TargetPath=.\ReleaseMinDependency\remoteps.exe
InputPath=.\ReleaseMinDependency\remoteps.exe
SOURCE=$(InputPath)
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(TargetPath)" /RegServer
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
echo Server registration done!
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinSize"
OUTDIR=.\ReleaseUMinSize
INTDIR=.\ReleaseUMinSize
# Begin Custom Macros
OutDir=.\ReleaseUMinSize
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\remoteps.exe" "$(OutDir)\regsvr32.trg"
!ELSE
ALL : "$(OUTDIR)\remoteps.exe" "$(OutDir)\regsvr32.trg"
!ENDIF
CLEAN :
-@erase "$(INTDIR)\RemoteProcess.obj"
-@erase "$(INTDIR)\remoteps.obj"
-@erase "$(INTDIR)\remoteps.pch"
-@erase "$(INTDIR)\remoteps.res"
-@erase "$(INTDIR)\StdAfx.obj"
-@erase "$(INTDIR)\vc50.idb"
-@erase "$(OUTDIR)\remoteps.exe"
-@erase "$(OutDir)\regsvr32.trg"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /ML /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE"\
/D "_ATL_DLL" /D "_ATL_MIN_CRT" /Fp"$(INTDIR)\remoteps.pch" /Yu"stdafx.h"\
/Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
CPP_OBJS=.\ReleaseUMinSize/
CPP_SBRS=.
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\remoteps.res" /d "NDEBUG"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\remoteps.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
odbccp32.lib /nologo /subsystem:windows /incremental:no\
/pdb:"$(OUTDIR)\remoteps.pdb" /machine:I386 /out:"$(OUTDIR)\remoteps.exe"
LINK32_OBJS= \
"$(INTDIR)\RemoteProcess.obj" \
"$(INTDIR)\remoteps.obj" \
"$(INTDIR)\remoteps.res" \
"$(INTDIR)\StdAfx.obj" \
"..\EXE\mscommon.lib" \
"..\EXE\psapint.lib"
"$(OUTDIR)\remoteps.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
OutDir=.\ReleaseUMinSize
TargetPath=.\ReleaseUMinSize\remoteps.exe
InputPath=.\ReleaseUMinSize\remoteps.exe
SOURCE=$(InputPath)
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(TargetPath)" /RegServer
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
echo Server registration done!
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinDependency"
OUTDIR=.\ReleaseUMinDependency
INTDIR=.\ReleaseUMinDependency
# Begin Custom Macros
OutDir=.\ReleaseUMinDependency
# End Custom Macros
!IF "$(RECURSE)" == "0"
ALL : "$(OUTDIR)\remoteps.exe" "$(OutDir)\regsvr32.trg"
!ELSE
ALL : "$(OUTDIR)\remoteps.exe" "$(OutDir)\regsvr32.trg"
!ENDIF
CLEAN :
-@erase "$(INTDIR)\RemoteProcess.obj"
-@erase "$(INTDIR)\remoteps.obj"
-@erase "$(INTDIR)\remoteps.pch"
-@erase "$(INTDIR)\remoteps.res"
-@erase "$(INTDIR)\StdAfx.obj"
-@erase "$(INTDIR)\vc50.idb"
-@erase "$(OUTDIR)\remoteps.exe"
-@erase "$(OutDir)\regsvr32.trg"
"$(OUTDIR)" :
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=/nologo /ML /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_UNICODE"\
/D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Fp"$(INTDIR)\remoteps.pch"\
/Yu"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
CPP_OBJS=.\ReleaseUMinDependency/
CPP_SBRS=.
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\remoteps.res" /d "NDEBUG"
BSC32=bscmake.exe
BSC32_FLAGS=/nologo /o"$(OUTDIR)\remoteps.bsc"
BSC32_SBRS= \
LINK32=link.exe
LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib\
odbccp32.lib /nologo /subsystem:windows /incremental:no\
/pdb:"$(OUTDIR)\remoteps.pdb" /machine:I386 /out:"$(OUTDIR)\remoteps.exe"
LINK32_OBJS= \
"$(INTDIR)\RemoteProcess.obj" \
"$(INTDIR)\remoteps.obj" \
"$(INTDIR)\remoteps.res" \
"$(INTDIR)\StdAfx.obj" \
"..\EXE\mscommon.lib" \
"..\EXE\psapint.lib"
"$(OUTDIR)\remoteps.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
$(LINK32) @<<
$(LINK32_FLAGS) $(LINK32_OBJS)
<<
OutDir=.\ReleaseUMinDependency
TargetPath=.\ReleaseUMinDependency\remoteps.exe
InputPath=.\ReleaseUMinDependency\remoteps.exe
SOURCE=$(InputPath)
"$(OutDir)\regsvr32.trg" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
"$(TargetPath)" /RegServer
echo regsvr32 exec. time > "$(OutDir)\regsvr32.trg"
echo Server registration done!
!ENDIF
.c{$(CPP_OBJS)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(CPP_OBJS)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(CPP_OBJS)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.c{$(CPP_SBRS)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cpp{$(CPP_SBRS)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
.cxx{$(CPP_SBRS)}.sbr::
$(CPP) @<<
$(CPP_PROJ) $<
<<
!IF "$(CFG)" == "remoteps - Win32 Debug" || "$(CFG)" ==\
"remoteps - Win32 Unicode Debug" || "$(CFG)" ==\
"remoteps - Win32 Release MinSize" || "$(CFG)" ==\
"remoteps - Win32 Release MinDependency" || "$(CFG)" ==\
"remoteps - Win32 Unicode Release MinSize" || "$(CFG)" ==\
"remoteps - Win32 Unicode Release MinDependency"
SOURCE=.\RemoteProcess.cpp
!IF "$(CFG)" == "remoteps - Win32 Debug"
DEP_CPP_REMOT=\
".\RemoteProcess.hpp"\
".\remoteps.h"\
{$(INCLUDE)}"common\array.hpp"\
{$(INCLUDE)}"common\console.hpp"\
{$(INCLUDE)}"common\coord.hpp"\
{$(INCLUDE)}"common\except.hpp"\
{$(INCLUDE)}"common\library.hpp"\
{$(INCLUDE)}"common\scrnbuff.hpp"\
{$(INCLUDE)}"common\smrect.hpp"\
{$(INCLUDE)}"common\stdlib.hpp"\
{$(INCLUDE)}"common\string.hpp"\
{$(INCLUDE)}"common\windows.hpp"\
{$(INCLUDE)}"psapi\psapi.h"\
{$(INCLUDE)}"psapint\modinfo.hpp"\
{$(INCLUDE)}"psapint\procid.hpp"\
{$(INCLUDE)}"psapint\procinfo.hpp"\
{$(INCLUDE)}"psapint\psapi.hpp"\
"$(INTDIR)\RemoteProcess.obj" : $(SOURCE) $(DEP_CPP_REMOT) "$(INTDIR)"\
"$(INTDIR)\remoteps.pch" ".\remoteps.h"
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Debug"
DEP_CPP_REMOT=\
".\RemoteProcess.hpp"\
".\remoteps.h"\
".\StdAfx.h"\
{$(INCLUDE)}"common\array.hpp"\
{$(INCLUDE)}"common\console.hpp"\
{$(INCLUDE)}"common\coord.hpp"\
{$(INCLUDE)}"common\except.hpp"\
{$(INCLUDE)}"common\library.hpp"\
{$(INCLUDE)}"common\scrnbuff.hpp"\
{$(INCLUDE)}"common\smrect.hpp"\
{$(INCLUDE)}"common\stdlib.hpp"\
{$(INCLUDE)}"common\string.hpp"\
{$(INCLUDE)}"common\windows.hpp"\
{$(INCLUDE)}"psapi\psapi.h"\
{$(INCLUDE)}"psapint\modinfo.hpp"\
{$(INCLUDE)}"psapint\procid.hpp"\
{$(INCLUDE)}"psapint\procinfo.hpp"\
{$(INCLUDE)}"psapint\psapi.hpp"\
"$(INTDIR)\RemoteProcess.obj" : $(SOURCE) $(DEP_CPP_REMOT) "$(INTDIR)"\
"$(INTDIR)\remoteps.pch" ".\remoteps.h"
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinSize"
DEP_CPP_REMOT=\
".\RemoteProcess.hpp"\
".\remoteps.h"\
".\StdAfx.h"\
{$(INCLUDE)}"common\array.hpp"\
{$(INCLUDE)}"common\console.hpp"\
{$(INCLUDE)}"common\coord.hpp"\
{$(INCLUDE)}"common\except.hpp"\
{$(INCLUDE)}"common\library.hpp"\
{$(INCLUDE)}"common\scrnbuff.hpp"\
{$(INCLUDE)}"common\smrect.hpp"\
{$(INCLUDE)}"common\stdlib.hpp"\
{$(INCLUDE)}"common\string.hpp"\
{$(INCLUDE)}"common\windows.hpp"\
{$(INCLUDE)}"psapi\psapi.h"\
{$(INCLUDE)}"psapint\modinfo.hpp"\
{$(INCLUDE)}"psapint\procid.hpp"\
{$(INCLUDE)}"psapint\procinfo.hpp"\
{$(INCLUDE)}"psapint\psapi.hpp"\
"$(INTDIR)\RemoteProcess.obj" : $(SOURCE) $(DEP_CPP_REMOT) "$(INTDIR)"\
"$(INTDIR)\remoteps.pch" ".\remoteps.h"
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinDependency"
DEP_CPP_REMOT=\
".\RemoteProcess.hpp"\
".\remoteps.h"\
".\StdAfx.h"\
{$(INCLUDE)}"common\array.hpp"\
{$(INCLUDE)}"common\console.hpp"\
{$(INCLUDE)}"common\coord.hpp"\
{$(INCLUDE)}"common\except.hpp"\
{$(INCLUDE)}"common\library.hpp"\
{$(INCLUDE)}"common\scrnbuff.hpp"\
{$(INCLUDE)}"common\smrect.hpp"\
{$(INCLUDE)}"common\stdlib.hpp"\
{$(INCLUDE)}"common\string.hpp"\
{$(INCLUDE)}"common\windows.hpp"\
{$(INCLUDE)}"psapi\psapi.h"\
{$(INCLUDE)}"psapint\modinfo.hpp"\
{$(INCLUDE)}"psapint\procid.hpp"\
{$(INCLUDE)}"psapint\procinfo.hpp"\
{$(INCLUDE)}"psapint\psapi.hpp"\
"$(INTDIR)\RemoteProcess.obj" : $(SOURCE) $(DEP_CPP_REMOT) "$(INTDIR)"\
"$(INTDIR)\remoteps.pch" ".\remoteps.h"
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinSize"
DEP_CPP_REMOT=\
".\RemoteProcess.hpp"\
".\remoteps.h"\
".\StdAfx.h"\
{$(INCLUDE)}"common\array.hpp"\
{$(INCLUDE)}"common\console.hpp"\
{$(INCLUDE)}"common\coord.hpp"\
{$(INCLUDE)}"common\except.hpp"\
{$(INCLUDE)}"common\library.hpp"\
{$(INCLUDE)}"common\scrnbuff.hpp"\
{$(INCLUDE)}"common\smrect.hpp"\
{$(INCLUDE)}"common\stdlib.hpp"\
{$(INCLUDE)}"common\string.hpp"\
{$(INCLUDE)}"common\windows.hpp"\
{$(INCLUDE)}"psapi\psapi.h"\
{$(INCLUDE)}"psapint\modinfo.hpp"\
{$(INCLUDE)}"psapint\procid.hpp"\
{$(INCLUDE)}"psapint\procinfo.hpp"\
{$(INCLUDE)}"psapint\psapi.hpp"\
"$(INTDIR)\RemoteProcess.obj" : $(SOURCE) $(DEP_CPP_REMOT) "$(INTDIR)"\
"$(INTDIR)\remoteps.pch" ".\remoteps.h"
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinDependency"
DEP_CPP_REMOT=\
".\RemoteProcess.hpp"\
".\remoteps.h"\
".\StdAfx.h"\
{$(INCLUDE)}"common\array.hpp"\
{$(INCLUDE)}"common\console.hpp"\
{$(INCLUDE)}"common\coord.hpp"\
{$(INCLUDE)}"common\except.hpp"\
{$(INCLUDE)}"common\library.hpp"\
{$(INCLUDE)}"common\scrnbuff.hpp"\
{$(INCLUDE)}"common\smrect.hpp"\
{$(INCLUDE)}"common\stdlib.hpp"\
{$(INCLUDE)}"common\string.hpp"\
{$(INCLUDE)}"common\windows.hpp"\
{$(INCLUDE)}"psapi\psapi.h"\
{$(INCLUDE)}"psapint\modinfo.hpp"\
{$(INCLUDE)}"psapint\procid.hpp"\
{$(INCLUDE)}"psapint\procinfo.hpp"\
{$(INCLUDE)}"psapint\psapi.hpp"\
"$(INTDIR)\RemoteProcess.obj" : $(SOURCE) $(DEP_CPP_REMOT) "$(INTDIR)"\
"$(INTDIR)\remoteps.pch" ".\remoteps.h"
!ENDIF
SOURCE=.\remoteps.cpp
!IF "$(CFG)" == "remoteps - Win32 Debug"
DEP_CPP_REMOTE=\
".\RemoteProcess.hpp"\
".\remoteps.h"\
".\remoteps_i.c"\
"$(INTDIR)\remoteps.obj" : $(SOURCE) $(DEP_CPP_REMOTE) "$(INTDIR)"\
"$(INTDIR)\remoteps.pch" ".\remoteps.h" ".\remoteps_i.c"
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Debug"
DEP_CPP_REMOTE=\
".\RemoteProcess.hpp"\
".\remoteps.h"\
".\remoteps_i.c"\
".\StdAfx.h"\
"$(INTDIR)\remoteps.obj" : $(SOURCE) $(DEP_CPP_REMOTE) "$(INTDIR)"\
"$(INTDIR)\remoteps.pch" ".\remoteps.h" ".\remoteps_i.c"
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinSize"
DEP_CPP_REMOTE=\
".\RemoteProcess.hpp"\
".\remoteps.h"\
".\remoteps_i.c"\
".\StdAfx.h"\
"$(INTDIR)\remoteps.obj" : $(SOURCE) $(DEP_CPP_REMOTE) "$(INTDIR)"\
"$(INTDIR)\remoteps.pch" ".\remoteps.h" ".\remoteps_i.c"
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinDependency"
DEP_CPP_REMOTE=\
".\RemoteProcess.hpp"\
".\remoteps.h"\
".\remoteps_i.c"\
".\StdAfx.h"\
"$(INTDIR)\remoteps.obj" : $(SOURCE) $(DEP_CPP_REMOTE) "$(INTDIR)"\
"$(INTDIR)\remoteps.pch" ".\remoteps.h" ".\remoteps_i.c"
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinSize"
DEP_CPP_REMOTE=\
".\RemoteProcess.hpp"\
".\remoteps.h"\
".\remoteps_i.c"\
".\StdAfx.h"\
"$(INTDIR)\remoteps.obj" : $(SOURCE) $(DEP_CPP_REMOTE) "$(INTDIR)"\
"$(INTDIR)\remoteps.pch" ".\remoteps.h" ".\remoteps_i.c"
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinDependency"
DEP_CPP_REMOTE=\
".\RemoteProcess.hpp"\
".\remoteps.h"\
".\remoteps_i.c"\
".\StdAfx.h"\
"$(INTDIR)\remoteps.obj" : $(SOURCE) $(DEP_CPP_REMOTE) "$(INTDIR)"\
"$(INTDIR)\remoteps.pch" ".\remoteps.h" ".\remoteps_i.c"
!ENDIF
SOURCE=.\remoteps.idl
!IF "$(CFG)" == "remoteps - Win32 Debug"
InputPath=.\remoteps.idl
".\remoteps.tlb" ".\remoteps.h" ".\remoteps_i.c" : $(SOURCE) "$(INTDIR)"\
"$(OUTDIR)"
midl /Oicf /h "remoteps.h" /iid "remoteps_i.c" "remoteps.idl"
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Debug"
InputPath=.\remoteps.idl
".\remoteps.tlb" ".\remoteps.h" ".\remoteps_i.c" : $(SOURCE) "$(INTDIR)"\
"$(OUTDIR)"
midl /Oicf /h "remoteps.h" /iid "remoteps_i.c" "remoteps.idl"
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinSize"
InputPath=.\remoteps.idl
".\remoteps.tlb" ".\remoteps.h" ".\remoteps_i.c" : $(SOURCE) "$(INTDIR)"\
"$(OUTDIR)"
midl /Oicf /h "remoteps.h" /iid "remoteps_i.c" "remoteps.idl"
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinDependency"
InputPath=.\remoteps.idl
".\remoteps.tlb" ".\remoteps.h" ".\remoteps_i.c" : $(SOURCE) "$(INTDIR)"\
"$(OUTDIR)"
midl /Oicf /h "remoteps.h" /iid "remoteps_i.c" "remoteps.idl"
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinSize"
InputPath=.\remoteps.idl
".\remoteps.tlb" ".\remoteps.h" ".\remoteps_i.c" : $(SOURCE) "$(INTDIR)"\
"$(OUTDIR)"
midl /Oicf /h "remoteps.h" /iid "remoteps_i.c" "remoteps.idl"
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinDependency"
InputPath=.\remoteps.idl
".\remoteps.tlb" ".\remoteps.h" ".\remoteps_i.c" : $(SOURCE) "$(INTDIR)"\
"$(OUTDIR)"
midl /Oicf /h "remoteps.h" /iid "remoteps_i.c" "remoteps.idl"
!ENDIF
SOURCE=.\remoteps.rc
DEP_RSC_REMOTEP=\
".\RemoteProcess.rgs"\
".\remoteps.rgs"\
".\remoteps.tlb"\
"$(INTDIR)\remoteps.res" : $(SOURCE) $(DEP_RSC_REMOTEP) "$(INTDIR)"\
".\remoteps.tlb"
$(RSC) $(RSC_PROJ) $(SOURCE)
SOURCE=.\StdAfx.cpp
DEP_CPP_STDAF=\
".\StdAfx.h"\
!IF "$(CFG)" == "remoteps - Win32 Debug"
CPP_SWITCHES=/nologo /Zp1 /MLd /W1 /Gm /Zi /Od /D "WIN32" /D "_DEBUG" /D\
"_WINDOWS" /D "STRICT" /D "__FLAT__" /Fp"$(INTDIR)\remoteps.pch" /Yc"stdafx.h"\
/Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
"$(INTDIR)\StdAfx.obj" "$(INTDIR)\remoteps.pch" : $(SOURCE) $(DEP_CPP_STDAF)\
"$(INTDIR)"
$(CPP) @<<
$(CPP_SWITCHES) $(SOURCE)
<<
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Debug"
CPP_SWITCHES=/nologo /MLd /W3 /Gm /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS"\
/D "_UNICODE" /Fp"$(INTDIR)\remoteps.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\"\
/Fd"$(INTDIR)\\" /FD /c
"$(INTDIR)\StdAfx.obj" "$(INTDIR)\remoteps.pch" : $(SOURCE) $(DEP_CPP_STDAF)\
"$(INTDIR)"
$(CPP) @<<
$(CPP_SWITCHES) $(SOURCE)
<<
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinSize"
CPP_SWITCHES=/nologo /ML /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D\
"_ATL_DLL" /D "_ATL_MIN_CRT" /Fp"$(INTDIR)\remoteps.pch" /Yc"stdafx.h"\
/Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
"$(INTDIR)\StdAfx.obj" "$(INTDIR)\remoteps.pch" : $(SOURCE) $(DEP_CPP_STDAF)\
"$(INTDIR)"
$(CPP) @<<
$(CPP_SWITCHES) $(SOURCE)
<<
!ELSEIF "$(CFG)" == "remoteps - Win32 Release MinDependency"
CPP_SWITCHES=/nologo /ML /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D\
"_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT" /Fp"$(INTDIR)\remoteps.pch"\
/Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
"$(INTDIR)\StdAfx.obj" "$(INTDIR)\remoteps.pch" : $(SOURCE) $(DEP_CPP_STDAF)\
"$(INTDIR)"
$(CPP) @<<
$(CPP_SWITCHES) $(SOURCE)
<<
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinSize"
CPP_SWITCHES=/nologo /ML /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D\
"_UNICODE" /D "_ATL_DLL" /D "_ATL_MIN_CRT" /Fp"$(INTDIR)\remoteps.pch"\
/Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
"$(INTDIR)\StdAfx.obj" "$(INTDIR)\remoteps.pch" : $(SOURCE) $(DEP_CPP_STDAF)\
"$(INTDIR)"
$(CPP) @<<
$(CPP_SWITCHES) $(SOURCE)
<<
!ELSEIF "$(CFG)" == "remoteps - Win32 Unicode Release MinDependency"
CPP_SWITCHES=/nologo /ML /W3 /O1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D\
"_UNICODE" /D "_ATL_STATIC_REGISTRY" /D "_ATL_MIN_CRT"\
/Fp"$(INTDIR)\remoteps.pch" /Yc"stdafx.h" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD\
/c
"$(INTDIR)\StdAfx.obj" "$(INTDIR)\remoteps.pch" : $(SOURCE) $(DEP_CPP_STDAF)\
"$(INTDIR)"
$(CPP) @<<
$(CPP_SWITCHES) $(SOURCE)
<<
!ENDIF
!ENDIF

BIN
remoteps/remoteps.ncb Normal file

Binary file not shown.

BIN
remoteps/remoteps.opt Normal file

Binary file not shown.

48
remoteps/remoteps.plg Normal file
View File

@@ -0,0 +1,48 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: remoteps - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\WINNT\Profiles\sean\LOCALS~1\Temp\RSP99.tmp" with contents
[
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib wsock32.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/remoteps.pdb" /machine:I386 /out:"Debug/remoteps.exe" /pdbtype:sept
.\Debug\intercpt.obj
.\Debug\RemoteProcess.obj
.\Debug\RemoteProcessImpl.obj
.\Debug\remoteps.obj
.\Debug\StdAfx.obj
.\Debug\remoteps.res
..\EXE\com.lib
..\EXE\mscommon.lib
..\EXE\psapint.lib
\work\exe\msbsp.lib
\work\exe\msfileio.lib
\work\exe\msimage.lib
\work\exe\mssocket.lib
"\parts\jpeg-6b\lib\jpeg6b.lib"
]
Creating command line "link.exe @C:\WINNT\Profiles\sean\LOCALS~1\Temp\RSP99.tmp"
Creating temporary file "C:\WINNT\Profiles\sean\LOCALS~1\Temp\RSP9A.bat" with contents
[
@echo off
".\Debug\remoteps.exe" /RegServer
echo regsvr32 exec. time > ".\Debug\regsvr32.trg"
echo Server registration done!
]
Creating command line "C:\WINNT\Profiles\sean\LOCALS~1\Temp\RSP9A.bat"
Linking...
Creating library Debug/remoteps.lib and object Debug/remoteps.exp
<h3>Output Window</h3>
Performing registration
Server registration done!
<h3>Results</h3>
remoteps.exe - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

129
remoteps/remoteps.rc Normal file
View File

@@ -0,0 +1,129 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
APISPY BITMAP "APISPY.BMP"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"1 TYPELIB ""remoteps.tlb""\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "remoteps Module\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "REMOTEPS\0"
VALUE "LegalCopyright", "Copyright 1997\0"
VALUE "OriginalFilename", "REMOTEPS.DLL\0"
VALUE "ProductName", "remoteps Module\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
VALUE "OLESelfRegister", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// REGISTRY
//
IDR_Remoteps REGISTRY MOVEABLE PURE "remoteps.rgs"
IDR_REMOTEPROCESS REGISTRY DISCARDABLE "RemoteProcess.rgs"
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
IDS_PROJNAME "Remoteps"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
1 TYPELIB "remoteps.tlb"
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

11
remoteps/remoteps.rgs Normal file
View File

@@ -0,0 +1,11 @@
HKCR
{
NoRemove AppID
{
{BD206932-8D8A-11D3-B2F0-0050043ED4DB} = s 'remoteps'
'remoteps.EXE'
{
val AppID = s {BD206932-8D8A-11D3-B2F0-0050043ED4DB}
}
}
}

BIN
remoteps/remoteps.tlb Normal file

Binary file not shown.

50
remoteps/remoteps_i.c Normal file
View File

@@ -0,0 +1,50 @@
/* this file contains the actual definitions of */
/* the IIDs and CLSIDs */
/* link this file in with the server and any clients */
/* File created by MIDL compiler version 5.01.0164 */
/* at Tue Jun 10 07:16:23 2003
*/
/* Compiler settings for remoteps.idl:
Oicf (OptLev=i2), W1, Zp8, env=Win32, ms_ext, c_ext
error checks: allocation ref bounds_check enum stub_data
*/
//@@MIDL_FILE_HEADING( )
#ifdef __cplusplus
extern "C"{
#endif
#ifndef __IID_DEFINED__
#define __IID_DEFINED__
typedef struct _IID
{
unsigned long x;
unsigned short s1;
unsigned short s2;
unsigned char c[8];
} IID;
#endif // __IID_DEFINED__
#ifndef CLSID_DEFINED
#define CLSID_DEFINED
typedef IID CLSID;
#endif // CLSID_DEFINED
const IID IID_IRemoteProcess = {0xBD20693E,0x8D8A,0x11D3,{0xB2,0xF0,0x00,0x50,0x04,0x3E,0xD4,0xDB}};
const IID LIBID_REMOTEPSLib = {0xBD206931,0x8D8A,0x11D3,{0xB2,0xF0,0x00,0x50,0x04,0x3E,0xD4,0xDB}};
const CLSID CLSID_CoRemoteProcess = {0xBD20693F,0x8D8A,0x11D3,{0xB2,0xF0,0x00,0x50,0x04,0x3E,0xD4,0xDB}};
#ifdef __cplusplus
}
#endif

1265
remoteps/remoteps_p.c Normal file

File diff suppressed because it is too large Load Diff

11
remoteps/remotepsps.def Normal file
View File

@@ -0,0 +1,11 @@
LIBRARY "remotepsPS"
DESCRIPTION 'Proxy/Stub DLL'
EXPORTS
DllGetClassObject @1 PRIVATE
DllCanUnloadNow @2 PRIVATE
GetProxyDllInfo @3 PRIVATE
DllRegisterServer @4 PRIVATE
DllUnregisterServer @5 PRIVATE

BIN
remoteps/remotepsps.dll Normal file

Binary file not shown.

BIN
remoteps/remotepsps.exp Normal file

Binary file not shown.

BIN
remoteps/remotepsps.lib Normal file

Binary file not shown.

14
remoteps/remotepsps.mk Normal file
View File

@@ -0,0 +1,14 @@
remotepsps.dll: dlldata.obj remoteps_p.obj remoteps_i.obj
link /dll /out:remotepsps.dll /def:remotepsps.def /entry:DllMain dlldata.obj remoteps_p.obj remoteps_i.obj kernel32.lib rpcndr.lib rpcns4.lib rpcrt4.lib oleaut32.lib uuid.lib
.c.obj:
cl /c /Ox /DWIN32 /D_WIN32_WINNT=0x0400 /DREGISTER_PROXY_DLL $<
clean:
@del remotepsps.dll
@del remotepsps.lib
@del remotepsps.exp
@del dlldata.obj
@del remoteps_p.obj
@del remoteps_i.obj

211
remoteps/scraps.txt Normal file
View File

@@ -0,0 +1,211 @@
// Desktop desktop;
// desktop.open("Default",false,Desktop::AccessReadObjects);
// if(!desktop.isOkay())return ComResult::Fail;
// getInfo();
// WindowStation windowStation;
// windowStation.open("SAWinSta",WindowStation::AccessReadScreen,false);
// if(!windowStation.isOkay())
// {
// DWORD errorCode(::GetLastError());
// ::sprintf(strLastError,"system error code %d(0x%08lx)",errorCode,errorCode);
// mLogFile.writeLine(String("ERROR ACCESSING WINDOW STATION ")+strLastError);
// }
// else mLogFile.writeLine("WINDOW STATION IS OPEN");
// desktop.open("Default",false,Desktop::AccessReadObjects|Desktop::AccessSwitchDesktop);
void RemoteProcess::getInfo(void)
{
WindowStationEnumerator windowStationEnumerator;
windowStationEnumerator.enumerateWindowStations();
for(int index=0;index<windowStationEnumerator.size();index++)
{
DesktopEnumerator desktopEnumerator;
WindowStation windowStation;
mLogFile.writeLine(String("WindowStationName: '")+windowStationEnumerator[index]);
// ::OutputDebugString(String("WindowStationName: '")+windowStationEnumerator[index]+String("'\n"));
if(!windowStation.open(windowStationEnumerator[index]))::OutputDebugString("could not open window station\n");
desktopEnumerator.enumerateDesktops(windowStation);
for(int dindex=0;dindex<desktopEnumerator.size();dindex++)
{
Desktop desktop;
// ::OutputDebugString(String("Desktop Name:")+desktopEnumerator[dindex]+String("\n"));
mLogFile.writeLine(String("Desktop Name:")+desktopEnumerator[dindex]);
if(!desktop.open(desktopEnumerator[dindex]))continue;
DesktopWindowEnumerator desktopWindowEnumerator;
desktopWindowEnumerator.enumerateDesktopWindows(desktop);
for(int dwindex=0;dwindex<desktopWindowEnumerator.size();dwindex++)
{
String strClassName;
::GetClassName(desktopWindowEnumerator[dwindex],(LPSTR)strClassName,String::MaxString);
// ::OutputDebugString(String("Windows Class Name:")+strClassName+String("\n"));
mLogFile.writeLine(String("Windows Class Name:")+strClassName);
}
}
}
}
HWND hButton;
hButton=::CreateWindow("BUTTTON","",WS_VISIBLE|WS_CHILD,0,0,320,200,(HWND)::GetDesktopWindow(),(HMENU)101,(HINSTANCE)0x400000,0);
::ShowWindow(hButton,SW_SHOW);
::UpdateWindow(hButton);
PureDevice deskDevice(::GetDesktopWindow());
PureDevice compatibleDevice;
PureBitmap compatibleBitmap;
compatibleBitmap.compatibleBitmap(deskDevice,pureBitmap.width(),pureBitmap.height());
compatibleDevice.compatibleDevice(deskDevice);
compatibleDevice.select((GDIObj)pureBitmap.getBitmap());
deskDevice.stretchBlt(Rect(0,0,320,200),compatibleDevice,Rect(0,0,pureBitmap.width(),pureBitmap.height()));
::Sleep(1000);
::DestroyWindow(hButton);
bool InterceptGetHostByName::setOriginalThunk(void)
{
DWORD countBytes;
mThisProcess.writeProcessMemory((void*)mBaseAddress,mOriginalThunk,sizeof(mOriginalThunk),&countBytes);
return countBytes==sizeof(mOriginalThunk);
}
mThisProcess.readProcessMemory((void*)mBaseAddress,mOriginalThunk,sizeof(mOriginalThunk),&countBytes);
if(!(countBytes==sizeof(mOriginalThunk)))return false;
#if 0
write((BYTE)(0x50));
push eax ; 0x50
mov eax,909090 ; 0xB8,0x00,0x00,0x00,0x00
call eax ; 0xFF,0xD0
pop eax ; 0x58
retn 4 ; 0xC2,0x00,0x00
776B5194 55 push ebp
776B5195 8B EC mov ebp,esp
776B5197 81 EC D8 00 00 00 sub esp,0D8h
776B519D 53 push ebx
776B519E 8D 45 F4 lea eax,[ebp-0Ch]
776B51A1 56 push esi
776B51A2 8D 4D F0 lea ecx,[ebp-10h]
776B51A5 57 push edi
776B51A6 50 push eax
776B51A7 51 push ecx
776B51A8 FF 15 9C F7 6B 77 call dword ptr ds:[776BF79Ch]
776B51AE 85 C0 test eax,eax
776B51B0 74 0E je 776B51C0
776B51B2 50 push eax
776B51B3 FF 15 4C D0 6B 77 call dword ptr ds:[776BD04Ch]
776B51B9 33 C0 xor eax,eax
776B51BB E9 19 01 00 00 jmp 776B52D9
776B51C0 83 7D 08 00 cmp dword ptr [ebp+8],0
776B51C4 74 0C je 776B51D2
776B51C6 8B 45 08 mov eax,dword ptr [ebp+8]
776B51C9 80 38 00 cmp byte ptr [eax],0
776B51CC 74 04 je 776B51D2
776B51CE 8B F0 mov esi,eax
776B51D0 EB 22 jmp 776B51F4
776B51D2 68 C8 00 00 00 push 0C8h
776B51D7 8D 85 28 FF FF FF lea eax,[ebp-0D8h]
776B51DD 50 push eax
776B51DE E8 FF 00 00 00 call 776B52E2
776B51E3 85 C0 test eax,eax
#endif
#if 0
getsockopt
setsockopt
recv
recvfrom
WSApSetPostRoutine
AcceptEx
EnumProtocolsA
EnumProtocolsW
GetAcceptExSockaddrs
GetAddressByNameA
GetAddressByNameW
GetNameByTypeA
GetNameByTypeW
GetServiceA
GetServiceW
GetTypeByNameA
GetTypeByNameW
MigrateWinsockConfiguration
NPLoadNameSpaces
SetServiceA
SetServiceW
TransmitFile
WEP
WSAAsyncGetHostByAddr
WSAAsyncGetHostByName X
WSAAsyncGetProtoByName
WSAAsyncGetProtoByNumber
WSAAsyncGetServByName
WSAAsyncGetServByPort
WSAAsyncSelect
WSACancelAsyncRequest
WSACancelBlockingCall
WSACleanup
WSAGetLastError
WSAIsBlocking
WSARecvEx
WSASetBlockingHook
WSASetLastError
WSAStartup
WSAUnhookBlockingHook
__WSAFDIsSet
accept
bind
closesocket
connect
dn_expand
gethostbyaddr X
gethostbyname Y intercepted, positive results
gethostname X
getnetbyname ?
getpeername X
getprotobyname
getprotobynumber
getservbyname
getservbyport
getsockname
htonl
htons
inet_addr X
inet_network X
inet_ntoa X returns 209.139.139.88
ioctlsocket
listen
ntohl
ntohs
rcmd
rexec
rresvport
s_perror
select
send X
sendto
sethostname X
shutdown
socket
#endif

52
remoteps/smk Normal file
View File

@@ -0,0 +1,52 @@
Comparing files remoteps.cpp and E:remoteps.cPP
FC: no differences encountered
Comparing files StdAfx.cpp and E:StdAfx.cPP
FC: no differences encountered
Comparing files RemoteProcess.hpp and E:RemoteProcess.hPP
FC: no differences encountered
Comparing files RemoteProcess.cpp and E:RemoteProcess.cPP
***** RemoteProcess.cpp
// HWND hDesktopWindow(::GetDesktopWindow());
HWND hDesktopWindow(::GetForegroundWindow());
if(!hDesktopWindow){::MessageBox(::GetFocus(),(LPSTR)"GetDesktopWindow()",(LPSTR)"FAIL",MB_ICONSTOP);return ComResult::
ail;}
pureBitmap.windowBitmap(hDesktopWindow);
if(!pureBitmap.isOkay()){::MessageBox(::GetFocus(),(LPSTR)"PureBitmap",(LPSTR)"FAIL",MB_ICONSTOP);return ComResult::Fai
;}
pureBitmap.getBitmapBits(bitmapBytes,BitmapInfo::Bit24,true);
int windowWidth(320);
int windowHeight(200);
HWND hWnd=::CreateWindow("BUTTON","",WS_VISIBLE|WS_POPUP|WS_BORDER,CW_USEDEFAULT,CW_USEDEFAULT,windowWidth,windowHeight,(HWND
hDesktopWindow,(HMENU)0,::GetModuleHandle(0),0);
if(!hWnd)return 0;
::ShowWindow(hWnd,SW_SHOW);
::UpdateWindow(hWnd);
PureDevice displayDevice(hWnd);
PureDevice compatibleDevice;
compatibleDevice.compatibleDevice(displayDevice);
compatibleDevice.select(pureBitmap,true);
displayDevice.stretchBlt(Rect(0,0,windowWidth,windowHeight),compatibleDevice,Rect(0,0,pureBitmap.width(),pureBitmap.hei
ht()));
::Sleep(2000);
::DestroyWindow(hWnd);
arrayBound.elements(bitmapBytes.size()+(sizeof(DWORD)*5));
***** E:RemoteProcess.cPP
pureBitmap.windowBitmap(::GetDesktopWindow());
if(!pureBitmap.isOkay())return ComResult::Fail;
pureBitmap.getBitmapBits(bitmapBytes,BitmapInfo::Bit24,true);
arrayBound.elements(bitmapBytes.size()+(sizeof(DWORD)*5));
*****