-
-
[旧帖]
奇怪的消息窗口创建失败问题
0.00雪花
-
发表于:
2016-3-14 16:24
2767
-
[旧帖] 奇怪的消息窗口创建失败问题
0.00雪花
改造公司一个旧有的项目,使用detours注入后创建消息窗口,在CreateWindow时报错,getLastError为183,而奇怪的是我使用一个新项目,用同样的方式却成功,2个项目只有默认项目配置和旧有项目配置的区别(旧项目似乎有不少改动的配置)。个人感觉应该和配置有关,但还是附上消息窗口代码吧。
BOOL InitMessageWindow()
{
HINSTANCE hInstance = NULL;
hInstance = GetModuleHandle(NULL);
if (hInstance == NULL)
{
return FALSE;
}
WNDCLASS wndcls;
wndcls.cbClsExtra = 0;
wndcls.cbWndExtra = 0;
wndcls.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
wndcls.hCursor = LoadCursor(NULL, IDC_CROSS);
wndcls.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wndcls.hInstance = hInstance;
wndcls.lpfnWndProc = GameFunc;
wndcls.lpszClassName = "Message Window";
wndcls.lpszMenuName = NULL;
wndcls.style = CS_HREDRAW | CS_VREDRAW;
RegisterClass(&wndcls);
HWND m_hwnd = CreateWindowEx(0, "Message Window", "Message Window", 0, 0, 0, 0, 0, HWND_MESSAGE, 0, hInstance, 0);
DWORD dd = GetLastError();
if (m_hwnd == NULL)
{
CString rg2;
rg2.Format("%d", m_hwnd);
MessageBox(NULL, "CreateWindowEx", rg2, MB_OK);
return FALSE;
}
return TRUE;
}
[课程]Android-CTF解题方法汇总!