首頁(yè)
社區(qū)
課程
招聘
ept_map MSRPC EPT 調(diào)用問(wèn)題
wx_1_842 2022-12-22 1567

嚴(yán)重性 代碼 說(shuō)明 項(xiàng)目 文件 行 禁止顯示狀態(tài)
錯(cuò)誤 LNK1120 1 個(gè)無(wú)法解析的外部命令 ConsoleApplication1 C:\Users\1\Desktop\ConsoleApplication1\Debug\ConsoleApplication1.exe 1
改成0提示占位空指針

收藏
3條回答
wx_1_842 2022-12-30

列子有沒(méi)有

回復(fù)
wx_1_842 2022-12-30

https://bbs.125.la/forum.php?mod=viewthread&tid=14758535&extra=

回復(fù)
wx_1_842 2022-12-30

/ file: helloc.c /

 

#include <stdlib.h>

 

#include <stdio.h>

 

#include <ctype.h>

 

#include "WMRPC_h.h"

 

#include <windows.h>

 

#include <iostream>

 

#pragma comment(lib, "Rpcrt4.lib")

 

int main()
{
UUID A;
UuidFromStringA((RPC_CSTR)"e1af8308-5d1f-11c9-91a4-08002b14a0fa",&A);
//RPC_BINDING_HANDLE_TEMPLATE_V1_A TEMPLATE_V1_A = {1,RPC_BHT_OBJECT_UUID_VALID,RPC_PROTSEQ_TCP ,(PUCHAR)"\192.168.230.128\epmapper",NULL,NULL,A};
//RPC_BINDING_HANDLE H;
//RPC_BINDING_HANDLE_SECURITY_V1_A SECURITY_V1_A = {1};

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//RpcBindingCreateA(&TEMPLATE_V1_A,&SECURITY_V1_A,NULL,&H);
//
//RPC_IF_HANDLE Proc3_ept_map = {};
RPC_BINDING_HANDLE BindingHandle;
//printf("%X",RpcBindingBind(NULL, H, Proc3_ept_map));
 
RPC_STATUS status;
RPC_WSTR pszUuid = (RPC_WSTR)L"E1AF8308-5D1F-11C9-91A4-08002B14A0FA";
RPC_WSTR pszProtocolSequence = (RPC_WSTR)L"ncacn_np";
RPC_WSTR pszNetworkAddress = (RPC_WSTR)L"\\192.168.2.5\\epmapper";
RPC_WSTR pszEndpoint = (RPC_WSTR)L"\\pipe\\epmapper";
RPC_WSTR pszOptions = NULL;
RPC_WSTR pszStringBinding = NULL;
RPC_WSTR pszString = (RPC_WSTR)L"hello, world";
unsigned long ulCode;
 
status = RpcStringBindingComposeW(pszUuid,
    pszProtocolSequence,
    pszNetworkAddress,
    pszEndpoint,
    pszOptions,
    &pszStringBinding);
if (status) exit(status);
 
//Struct_12_t A = { /*4264640272 ,2046 ,NULL,(BYTE)"\x30\x12\x2E\xFE\xFE\x07\x00"*/};
status = RpcBindingFromStringBindingW(pszStringBinding, &BindingHandle);
twr_t T = {75,5};
        error_status_t error_status_t;
        ept_lookup_handle_t ept_lookup_handle_t;
        unsigned32 U;
        twr_p_t twr_p_t=&T;
if (status) exit(status);
 
        RpcTryExcept
        {
            //PVOID QA;
            //PVOID P;
            //Struct_88_t * AQ;
 
    ept_map(BindingHandle,NULL,&T, NULL,100, &U, &twr_p_t, &error_status_t);
}
    RpcExcept(1)
{
    ulCode = RpcExceptionCode();
    printf("Runtime reported exception 0x%lx = %ld\n", ulCode, ulCode);
}
RpcEndExcept
 
    status = RpcStringFree(&pszStringBinding);
 
if (status) exit(status);
 
status = RpcBindingFree(&BindingHandle);
 
if (status) exit(status);
printf("%X", error_status_t);
exit(0);

}

 

/**/
/ MIDL allocate and free /
/**/

 

void RPC_FAR* RPC_USER midl_user_allocate(size_t len)
{
return(malloc(len));
}

 

void RPC_USER midl_user_free(void RPC_FAR* ptr)
{
free(ptr);
}

回復(fù)
  參與學(xué)習(xí)     人
  提問(wèn)次數(shù)     100 個(gè)
我的問(wèn)答 領(lǐng)取收益
0
我的提問(wèn)
0
我的回答
0
學(xué)習(xí)收益