亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? sslpc.c

?? Undocumented Windows NT 經(jīng)典書籍的源碼
?? C
字號(hào):
#define _X86_

#include <ntddk.h>
#include <stdio.h>

#include "undocnt.h"
#include "..\port\print.h"

#define PORTNAME L"\\Windows\\MyPort"

#define SHARED_SECTION_SIZE 0x10000

typedef struct SharedLpcMessage {
	ULONG ServerBaseAddress;
	ULONG MessageOffset;
} SHAREDLPCMESSAGE, *PSHAREDLPCMESSAGE;

/*Define the WIN32 calls we are using, since we can not include both NTDDK.H and
WINDOWS.H in the same 'C' file.*/
ULONG _stdcall GetCurrentProcessId();
ULONG _stdcall GetCurrentThreadId();
HANDLE _stdcall CreateFileMappingA(
    HANDLE hFile,	// handle to file to map 
    PVOID lpFileMappingAttributes,	// optional security attributes 
    ULONG flProtect,	// protection for mapping object 
    ULONG dwMaximumSizeHigh,	// high-order 32 bits of object size  
    ULONG dwMaximumSizeLow,	// low-order 32 bits of object size  
    LPCSTR lpName 	// name of file-mapping object 
   );


/* Extract the message string from the shared section and
reverse it */
void ProcessMessageData(PLPCMESSAGE pLpcMessage)
{
	PSHAREDLPCMESSAGE SharedLpcMessage;
	char *ServerView;

	SharedLpcMessage=(PSHAREDLPCMESSAGE)(pLpcMessage->MessageData);
	ServerView=((char *)SharedLpcMessage->ServerBaseAddress)+
				SharedLpcMessage->MessageOffset;
	strrev(ServerView);
}

server(POBJECT_ATTRIBUTES ObjectAttr)
{
	LPCSECTIONMAPINFO SectionMapInfo;
	int rc;
	HANDLE PortHandle;
	LPCMESSAGE LpcMessage;


	/* Create the named port */
	rc=NtCreatePort(&PortHandle, ObjectAttr, 0x0, 0x0, 0x00000);
	if (rc==0) {
		HANDLE AcceptPortHandle;
		BOOLEAN FirstTime=TRUE;

		MyPrintf("Port created, PortHandle=%x %d\n", PortHandle,
					PortHandle);
		memset(&LpcMessage, 0, sizeof(LpcMessage));

		while (1) {
			if ((FirstTime) || (LpcMessage.MessageType==LPC_CONNECTION_REQUEST)) {
				/* If you are first time listening or if the previous
				message was a connection request then do not send
				any reply but just wait on the message */
				rc=NtReplyWaitReceivePort(PortHandle, NULL, NULL, &LpcMessage);
				FirstTime=FALSE;
			} else {
				/* Send a reply to the previous message and wait
				for the new message */
				MyPrintf("Sending reply and Waiting for the request ....\n");

				rc=NtReplyWaitReceivePort(PortHandle, 0, &LpcMessage, &LpcMessage);
				if (rc!=0) {
					MyPrintf("NtReplyWaitReceivePort failed, rc=%x\n", rc);
					return -1;
				}
			}

			if (LpcMessage.MessageType==LPC_CONNECTION_REQUEST) {
				MyPrintf("Got the connection request\n");
				PrintMessage(&LpcMessage);

				/* If you get the connection request accept
				and complete the request */
				memset(&SectionMapInfo, 0, sizeof(SectionMapInfo));
				SectionMapInfo.Length=0x0C;
				rc=NtAcceptConnectPort(&AcceptPortHandle, 0, &LpcMessage,
									1, 0, &SectionMapInfo);
				if (rc!=0) {
					MyPrintf("NtAcceptConnectPort failed, rc=%x\n", rc);
					return -1;
				}
				MyPrintf("AcceptPortHandle=%x\n", AcceptPortHandle);
				MyPrintf("SectionMapInfo.SectionSize=%x\n", SectionMapInfo.SectionSize);
				MyPrintf("SectionMapInfo.ServerBaseAddress=%x\n", SectionMapInfo.ServerBaseAddress);

				rc=NtCompleteConnectPort(AcceptPortHandle);
				if (rc!=0) {
					MyPrintf("NtCompleteConnectPort failed, rc=%x\n", rc);
					return -1;
				}
			} else if (LpcMessage.MessageType==LPC_REQUEST) {

				/* Process the message received and send the
				reply in the next iteration of while 1*/
				MyPrintf("Got the request\n");
				PrintMessage(&LpcMessage);
				ProcessMessageData(&LpcMessage);
			}
		}
	} else {
		MyPrintf("NtCreatePort failed, rc=%x\n", rc);
	}
}

client(PUNICODE_STRING uString)
{
	static int Param3;
	HANDLE hFileMapping;
	LPCSECTIONINFO SectionInfo;
	LPCSECTIONMAPINFO SectionMapInfo;
	ULONG ServerBaseAddress;
	ULONG ClientBaseAddress;
	char *ClientView;
	int rc;
	LPCMESSAGE LpcMessage;
	HANDLE PortHandle;

	hFileMapping=CreateFileMappingA((HANDLE)0xFFFFFFFF, NULL, 
					PAGE_READWRITE, 0, SHARED_SECTION_SIZE, 
					NULL);

	if (hFileMapping==NULL) {
		MyPrintf("Unable to create file mapping\n");
		return -1;
	}
	memset(&SectionInfo, 0, sizeof(SectionInfo));
	memset(&SectionMapInfo, 0, sizeof(SectionMapInfo));

	SectionInfo.Length=0x18;
	SectionInfo.SectionHandle=hFileMapping;
	SectionInfo.SectionSize=SHARED_SECTION_SIZE;

	SectionMapInfo.Length=0x0C;


	MyPrintf("ClientProcessId=%x, ClientThreadId=%x\n",
				GetCurrentProcessId(),
				GetCurrentThreadId());

	rc=NtConnectPort(&PortHandle, uString,
					&Param3, &SectionInfo, NULL, 
					NULL, NULL, NULL);

	if (rc==0) {
		MyPrintf("PortHandle=%x\n", PortHandle);
		MyPrintf("Client Base address=%x\n", SectionInfo.ClientBaseAddress);
		MyPrintf("Server Base address=%x\n", SectionInfo.ServerBaseAddress);
		ServerBaseAddress=SectionInfo.ServerBaseAddress;
		ClientBaseAddress=SectionInfo.ClientBaseAddress;
	} else {
		MyPrintf("Connect failed, rc=%x %d\n", rc);
		return -1;
	}

	while (1) {
		static char MessageString[SHARED_SECTION_SIZE];
		int MessageOffset=0;
		PSHAREDLPCMESSAGE SharedLpcMessage;
		
		printf("Enter the message string, enter 'quit' to exit : ");
		gets(MessageString);
		if (stricmp(MessageString, "quit")==0) {
			ZwClose(PortHandle);
			return 0;
		}
		fflush(stdin);
		printf("Enter the offset in shared memory where the message is to be kept : ");
		scanf("%d", &MessageOffset);

		if ((MessageOffset+strlen(MessageString))>=SHARED_SECTION_SIZE) {
			MyPrintf("Message can not fit in shared memory window\n");
			return -1;
		}
		/* Fill in the message */
		memset(&LpcMessage, 0, sizeof(LpcMessage));
		LpcMessage.ActualMessageLength=0x08;
		LpcMessage.TotalMessageLength=0x20;
		SharedLpcMessage=(PSHAREDLPCMESSAGE)(LpcMessage.MessageData);
		MyPrintf("Server base address=%x\n", ServerBaseAddress); 
		SharedLpcMessage->ServerBaseAddress=ServerBaseAddress;
		SharedLpcMessage->MessageOffset=MessageOffset;

		ClientView=((char *)ClientBaseAddress)+MessageOffset;
		strcpy(ClientView, MessageString);
		getchar();

		/* Send the message and wait for the reply */
		MyPrintf("Sending request and waiting for reply....\n");
		rc=NtRequestWaitReplyPort(PortHandle, &LpcMessage, &LpcMessage);
		if (rc!=0) {
			MyPrintf("NtRequestWaitReplyport failed, rc=%x\n", rc);
			return -1;
		}

		/* Print the reply received */
		MyPrintf("Got the reply\n");
		PrintMessage(&LpcMessage);
		//
		MyPrintf("Reply = %s\n", ClientView);
	}
	getchar();
}


main(int argc, char **argv)
{
	OBJECT_ATTRIBUTES ObjectAttr;
	UNICODE_STRING uString;

	/* Initializes the object attribute structure */
	RtlInitUnicodeString(&uString, PORTNAME);
	InitializeObjectAttributes(&ObjectAttr, &uString, OBJ_CASE_INSENSITIVE, NULL, NULL);

	if (argc==1) {
		/* If no parameters are specified for the program
		act as the server */

		server(&ObjectAttr);
	} else {
		/* If any command line parameter is specified it
		acts as the client */
		client(&uString);
	}
	return 0;
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品福利电影一区二区三区四区| 亚洲女人的天堂| 国产精品污网站| 日韩极品在线观看| 欧美一区二区三区日韩| 国产精品国产三级国产普通话99| 日韩黄色片在线观看| 91美女福利视频| 久久精品人人爽人人爽| 日韩成人精品在线| 欧美性色综合网| 最近中文字幕一区二区三区| 国产一区二区在线观看免费| 欧美亚洲一区二区在线| 《视频一区视频二区| 成人午夜大片免费观看| 欧美精品一区二区蜜臀亚洲| 丝袜国产日韩另类美女| 欧美性极品少妇| 亚洲小说春色综合另类电影| 91美女片黄在线| 1024成人网| 99精品视频在线免费观看| 国产日韩精品一区二区三区在线| 精品无码三级在线观看视频| 在线不卡免费av| 日韩二区三区四区| 51久久夜色精品国产麻豆| 亚洲成a人v欧美综合天堂下载 | 久久免费看少妇高潮| 国产精品一二三四| 久久综合色天天久久综合图片| 蜜臀av一级做a爰片久久| 欧美一区二区黄色| 黄色资源网久久资源365| 欧美tickle裸体挠脚心vk| 捆绑紧缚一区二区三区视频| 日韩欧美国产成人一区二区| 精品在线播放午夜| 久久奇米777| 成人免费视频caoporn| 国产精品乱码妇女bbbb| 91视频在线观看| 亚洲国产精品麻豆| 91精品国产全国免费观看| 美女脱光内衣内裤视频久久影院| 精品毛片乱码1区2区3区| 国产福利不卡视频| 亚洲日本韩国一区| 欧美日韩电影在线| 激情综合色综合久久| 中文字幕免费不卡| 色婷婷av一区二区三区大白胸| 亚洲午夜影视影院在线观看| 欧美一卡2卡三卡4卡5免费| 国产高清在线观看免费不卡| 亚洲婷婷在线视频| 欧美久久一区二区| 国产精品一区二区无线| 亚洲视频免费观看| 日韩欧美一级在线播放| 岛国av在线一区| 亚洲韩国一区二区三区| 精品国产自在久精品国产| 成人福利视频在线| 日韩一区欧美二区| 国产精品天干天干在观线 | 国内精品久久久久影院薰衣草 | 国产91精品一区二区麻豆网站 | 欧美成人精品二区三区99精品| 国产激情偷乱视频一区二区三区 | 国产女主播视频一区二区| 色成人在线视频| 麻豆国产精品官网| 一区二区三区四区国产精品| 欧美不卡一区二区| 欧美性猛片aaaaaaa做受| 国产精品一区二区三区四区 | 中文子幕无线码一区tr| 在线不卡一区二区| 色综合久久久久综合体 | 日韩高清一区在线| 亚洲人成小说网站色在线| 日韩美女一区二区三区| 色婷婷精品久久二区二区蜜臂av| 蜜臀99久久精品久久久久久软件| 一区二区在线观看视频| 国产欧美一区二区三区在线看蜜臀 | 91福利社在线观看| 国产suv精品一区二区6| 日韩va欧美va亚洲va久久| 亚洲精品美国一| 国产日韩欧美精品在线| 日韩精品中文字幕在线不卡尤物| 91免费版在线| 99热这里都是精品| 国产成人日日夜夜| 国内欧美视频一区二区| 日本不卡一区二区| 午夜视黄欧洲亚洲| 夜夜操天天操亚洲| 一区二区三区四区国产精品| 国产精品理伦片| 欧美极品xxx| 久久噜噜亚洲综合| 久久美女艺术照精彩视频福利播放 | 亚洲专区一二三| 亚洲欧美色一区| 亚洲欧美日韩国产一区二区三区| 久久久久国产精品麻豆ai换脸 | 国产精品二三区| 亚洲国产精品99久久久久久久久| 2欧美一区二区三区在线观看视频| 7777精品伊人久久久大香线蕉经典版下载 | 欧洲精品一区二区| 欧美丝袜丝交足nylons| 日本高清无吗v一区| 91啪亚洲精品| 欧日韩精品视频| 在线看国产一区二区| 91蝌蚪porny| 欧美视频在线一区| 欧美军同video69gay| 4438x成人网最大色成网站| 7777精品伊人久久久大香线蕉完整版| 欧美日韩激情一区| 日韩丝袜美女视频| xf在线a精品一区二区视频网站| 日韩免费成人网| 国产视频在线观看一区二区三区| 国产拍揄自揄精品视频麻豆| 国产精品麻豆99久久久久久| 亚洲色欲色欲www| 亚洲香蕉伊在人在线观| 日韩精彩视频在线观看| 国产在线日韩欧美| 99国内精品久久| 欧美午夜一区二区三区免费大片| 欧美亚男人的天堂| 日韩久久免费av| 国产精品每日更新在线播放网址 | 精品精品国产高清a毛片牛牛| 精品国产一区二区三区忘忧草 | 日韩理论片在线| 午夜视黄欧洲亚洲| 国产精品99久久久久久久vr| 色综合久久六月婷婷中文字幕| 777xxx欧美| 亚洲同性gay激情无套| 日韩国产一二三区| 99国产精品久| 欧美一二三区精品| 亚洲免费观看高清完整版在线观看熊| 亚洲午夜在线视频| 成人免费毛片app| 欧美军同video69gay| 中文在线资源观看网站视频免费不卡 | 91极品美女在线| 精品国产乱码久久| 一区二区激情视频| 国产精品99久久不卡二区| 欧美三级韩国三级日本三斤 | 国产精品久久久久久妇女6080| 亚洲 欧美综合在线网络| 风间由美性色一区二区三区| 欧美日韩一区二区三区视频| 国产精品亲子伦对白| 久久精品国产77777蜜臀| 91精品91久久久中77777| 国产性色一区二区| 免费在线看一区| 欧美三日本三级三级在线播放| 国产精品理论片| 国产美女精品人人做人人爽| 在线播放中文一区| 亚洲精品视频免费观看| 成人不卡免费av| 久久久久久久久久久99999| 全部av―极品视觉盛宴亚洲| 日本福利一区二区| 国产精品大尺度| 国产成人亚洲精品狼色在线| 日韩欧美一二区| 日韩国产精品91| 欧美二区三区的天堂| 亚洲午夜免费电影| 在线一区二区视频| 国产精品电影一区二区| 国产91对白在线观看九色| 26uuu国产日韩综合| 激情小说欧美图片| 精品国产污污免费网站入口| 麻豆精品新av中文字幕| 欧美一区二区三区四区久久| 首页国产欧美日韩丝袜| 欧美日韩久久一区二区| 亚洲成人第一页| 91精品在线麻豆| 久久精品国产99久久6| 精品理论电影在线观看|