草庐IT

int_member

全部标签

c++ - Visual C++ 在函数末尾附加 0xCC (int3) 字节

这是我第一次来,我真的希望你们能帮助我,因为我现在已经没有想法了。我已经搜索了几个小时的答案,但找不到真正有效的答案。我想直接将代码注入(inject)到正在运行的进程中。是的,你没看错。我正在尝试将代码注入(inject)另一个应用程序,并且-不管你信不信-这只是为了扩展它的功能。我在Windows上使用VisualStudio2012ExpressEdition。我有以下代码:__declspec(naked)voidFoo(){__asm{//Inlineassemblycodehere}}__declspec(naked)voidFooEnd(){}intmain(){cout

c++ - 为什么返回 Windows BOOL 数据类型而不是 int?

来自MSDN.BOOLWINAPIGetMessage(_Out_LPMSGlpMsg,_In_opt_HWNDhWnd,_In_UINTwMsgFilterMin,_In_UINTwMsgFilterMax);声明如下:“如果函数检索到的消息不是WM_QUIT,则返回值为非零。如果函数检索到WM_QUIT消息,则返回值为零。如果有错误,返回值为-1。”boolean值不是true还是false?看来我们这里有三个选项,true、false和oopsie_daisy....因此,在输入此内容时,我认为我应该检查WinDef.h并在其中找到:typedefintBOOL;嗯……BOOL只

c++ - WINAPI 枚举WindowsProc : Non-Standard Syntax; use & to create a point to a member

我在调用EnumWindows(EnumWindowsProc,0)时不断收到错误消息;它将我的BOOLCALLBACKselectionWindows::EnumWindowsProc(HWNDhWnd,longlParam)函数转换为参数。我知道它与类和selectionWindows::有关,但我终究无法弄明白。这是.h#ifndefSELECTIONWINDOWS_H#defineSELECTIONWINDOWS_H#include#include"mainwindow.h"#include#includeclassselectionWindows:publicQWidget{

c++ - 相当于 gnu 中 windows stdint.h 的 u_int16_t?

到目前为止,我假设u_int16_t是一个名为stdint.h的MSVS头文件中某处的Windows类型。我正在使用GNUg++作为编译器(实际上是带有mingw的代码块),我想知道typedefunsignedshortuint_least16_t;(在mingw的stdint.h内)是否等效,或者我可以做些什么来包含它类型?这个问题实际上与编译googlesparsehash有关用于MSVS的项目文件,但我使用的是代码块。这是它给我的错误(顺便说一句,这个错误重复了很多次)。c:\programfiles\codeblocks\mingw\bin\..\lib\gcc\mingw3

vb.net - CodeDom编译错误 'Forms' is not member of 'Windows' in Windows 8.1

我正在使用CodeDom创建InMemoryexe。这适用于Windows8及以下版本。如果我删除表单声明,编译后的代码在Windows8.1中工作,但我不想这样做。有任何想法吗?Windows7-一切正常,Windows8-一切正常,Windows8.1-无需声明表单即可工作。引用框架provOptions.Add("CompilerVersion","v4.0")CodeDom引用程序集:vbParams.ReferencedAssemblies.Add("mscorlib.dll")vbParams.ReferencedAssemblies.Add("System.dll")vb

c# - "Add-Member"到一个类型,而不仅仅是 PowerShell 中该类型的对象

在PowerShell中,您可以扩展对象:TheAdd-Membercmdletletsyouaddmembers(propertiesandmethods)toaninstanceofaWindowsPowerShellobject.Forexample,youcanaddaNotePropertymemberthatcontainsadescriptionoftheobjectoraScriptMethodmemberthatrunsascripttochangetheobject.但是:Thepropertiesandmethodsthatyouaddareaddedonlyto

C++:将 __int64 转换为 unsigned long

我想在Windows和Linux中使用以下函数,但我不确定如何将__int64转换为unsignedlong。像我一样投值安全吗?getTimeInMilliseconds(){#ifdef_WIN32staticconst__int64magic=116444736000000000;//1970/1/1SYSTEMTIMEst;GetSystemTime(&st);FILETIMEft;SystemTimeToFileTime(&st,&ft);//in100-nanosecs...__int64t;memcpy(&t,&ft,sizeoft);return(unsignedlon

c - 'st_blksize' : is not a member of 'stat' on Windows

因为我想从Linux移植到Windows。我意识到Windows和LinuxAPI都有stat.h但有一些不同。问题是Windowsstat.h没有st_blksize变量,但Linux有。我真的不明白st_blksize也可以做什么。谁能帮我解决这个问题?如何在Windows上找到与st_blksize等效的内容? 最佳答案 对于Linux结构定义,请访问此处:http://pubs.opengroup.org/onlinepubs/7908799/xsh/sysstat.h.html主要摘录:st_size:文件大小(以字节为单

C++ Windows 如何将 'unsigned int' 转换为 'TCHAR *'?

我是Windows上的C++新手。你能告诉我如何将unsignedint转换为TCHAR*吗? 最佳答案 通常的方法是使用swprintf将宽字符打印到wchar_t(TCHAR通常定义为)。要将数字打印到TCHAR中,您应该使用_stprintf,正如@hvd在下面提到的(一怒之下)。这样,如果定义了UNICODE,您将使用宽字符,如果未定义UNICODE,您将使用ASCII字符。intmyInt=400;TCHARbuf[300];//whereyouputresult_stprintf(buf,TEXT("Formatstri

python - ctypes:printf 返回长度,它是 int 而不是字符串

我正在使用ctypes并在Python2.5中加载msvcrt.dll。>>>fromctypesimport*>>>libname='msvcrt.dll'>>>libc=CDLL(libname)>>>libc.printf("HelloWorld\n")12>>>为什么不打印HelloWorld? 最佳答案 Whydoesn'titprintHelloWorld?当从控制台运行时,它在我的Python(ActiveState,2.6)中执行:>>>fromctypesimport*>>>libc=CDLL('msvcrt.dl