能力值:
( LV2,RANK:10 )
|
-
-
2 楼
cb := (1 + lstrlenW(pszLibAFilename)) * sizeof(WCHAR);
pszLibFileRemote := PWIDESTRING(VirtualAllocEx(hRemoteProcess, nil, cb, MEM_COMMIT,PAGE_READWRITE));
|
能力值:
( LV2,RANK:10 )
|
-
-
3 楼
int len = lstrlen(DllFullPath) + sizeof(TCHAR);
pRemoteAddr = VirtualAllocEx(hRemoteProcess, NULL,len,MEM_COMMIT,PAGE_EXECUTE_READWRITE);
|
能力值:
( LV2,RANK:10 )
|
-
-
4 楼
这样改了,测试还是一样的。
|
能力值:
( LV2,RANK:10 )
|
-
-
5 楼
错误6是句柄无效,请上完整代码
|
能力值:
( LV2,RANK:10 )
|
-
-
6 楼
#include <strsafe.h> //格式化错误消息
#pragma comment(lib, "strsafe.lib")
void GetLastErrorEx(LPTSTR lpszFunction)
{
LPVOID lpMsgBuf;
LPVOID lpDisplayBuf;
DWORD dw = GetLastError();
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
dw,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0, NULL );
lpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZEROINIT,(lstrlen((LPCTSTR)lpMsgBuf) + lstrlen((LPCTSTR)lpszFunction) + 40) * sizeof (TCHAR));
StringCchPrintf((LPTSTR)lpDisplayBuf,
LocalSize(lpDisplayBuf) / sizeof (TCHAR),
TEXT( "%s failed with error %d: %s" ),
lpszFunction, dw, lpMsgBuf);
MessageBox(NULL, (LPCTSTR)lpDisplayBuf, TEXT( "Error" ), MB_OK);
LocalFree(lpMsgBuf);
LocalFree(lpDisplayBuf);
}
调用这函数 把错误码转换下
|
能力值:
( LV2,RANK:10 )
|
-
-
7 楼
printf("VirtualAllocEx:%d\n", GetLastError());
改成 GetLastErrorEx("VirtualAllocEx ");
|
能力值:
( LV2,RANK:10 )
|
-
-
8 楼
显示为“error 8 ,存储空间不足,无法使用此命令”
|
|
|