[原创]分享一个LPC通讯库
大牛们都有自己的通讯方式,LPC通讯的也见过很多例子,就是没找到现成可用的库。
遂自己写了一个,代码很挫,还有很多地方不完善,就算抛砖引玉了
基本实现了r0和r3,r3和r3的通讯,注册回调并执行等
客户端

r3服务端

r0服务端

但在win 7下有点问题,驱动里不能用Section通讯,看了下NtAcceptConnectPort 在win 7下调用AlpcpAcceptConnectPort,看他的代码
if ( WriteSection )
{
v16 = MmUserProbeAddress;
if ( WriteSection < (unsigned int)MmUserProbeAddress )
v16 = (const void *)WriteSection;
memcpy(&ServerView, v16, 0x18u);
if ( ServerView != 0x18 )
goto LABEL_17;
if ( WriteSection & 3 )
goto LABEL_19;
if ( WriteSection >= (unsigned int)MmUserProbeAddress )
*(_BYTE *)MmUserProbeAddress = 0;
*(_BYTE *)WriteSection = *(_BYTE *)WriteSection;
*(_BYTE *)(WriteSection + 20) = *(_BYTE *)(WriteSection + 20);
v13 = MmUserProbeAddress;
}
似乎是内核建的section (地址大于7fff0000)赋值成了MmUserProbeAddress,导致后面用 AlpcpMapLegacyPortView时检查句柄是STATUS_INVALID_HANDLE,不知是bug还是故意这么限制的,求教

LPC - 副本.7z
