|
[求助]卸载全局钩子时 如何让其他进程不卸载我的DLL?
楼上应该是正确答案 |
|
[原创]DLL, lib静态、动态库
针对楼主后来修改的内容: 你所说的第二种,根本就不叫静态库好不。。。。这叫正宗的动态链接 你这里所说的针对DLL的静态链接,跟上面你所谓的“第二种静态库”根本就是一回事,这个是正宗的动态链接 至于你所说的“针对DLL的动态链接”,这根本就不叫链接,因为从编译链接的角度讲你的程序没有跟目标DLL发生任何依赖关系,这种真正的叫法叫“动态调用”,可以针对任何DLL 归根到底,就两种,实现代码在lib中然后链接时被整合到exe中的叫静态链接,实现代码不在lib中链接后exe的导入表中包含了相关模块引用在使用时需加载dll的叫动态链接,哪有那么多分类 |
|
[原创]DLL, lib静态、动态库
有没有用不是你感觉没用就没用~ 你所谓的空间换时间,就是把代码整体在EXE内部,增加了EXE的体积,来换那么一点点的时间? 我上面讲了,运行时间上没有差别,而你这样反而增加了许多不便~ 真想提高效率,那就好好优化代码(自己的,或者是库的) 要不然你如何解释现在的绝大多数程序都是使用的动态链接方式呢? 我还从没听说过DLL这种模型会消亡 |
|
[原创]DLL, lib静态、动态库
纠正一下楼主的认识~~ 这个说法是完全错误的,静态链接时就不存在DLL了,函数的实现代码被整合到EXE中了,如果有DLL,那肯定是动态链接,必然不包含函数的具体实现代码 举个例子:比如你要调用模块ModA的一个函数FuncA,如果链接之后,FunA的函数体也是在exe内部,那么就是静态链接,单独一个exe就可以运行;如果FunA的函数体在模块ModA.dll中,那么这就是动态链接,运行的时候需要加载ModA.dll。 事实上,不管是静态链接还是动态链接,都需要提供头文件(包含函数接口声明)和lib文件(动态链接也需要lib哦) 只不过: 静态链接需要的lib,一般文件比较大,因为它包含了函数的具体实现,链接时会和exe的主体链接在一起,当然会增大文件尺寸,因为它里面有货啊 动态链接需要的lib,一般文件比较小,因为它只包含了函数的原型和地址(其实就是一个jmp [IAT]引用),它只不过会在exe的IAT里增加几项内容,几乎不影响文件大小 这两者现在用得都很多,看具体场景,与时代无关~ 至于效率上,这两者没有区别,就比如吃饭一样,区别在于你是在自己家吃饭还是到邻居家吃饭,主要时间消耗在吃饭这个过程上,到自己家(EXE内部jmp)和到邻居家(jmp [IAT])的这个过程需要的时间完全可以忽略不计 关于测试: 楼主可以用VC建立一个mfc工程,分别用"使用共享MFC库"和“使用静态MFC库”,比较一下编译出来的文件的大小、导入表、运行效率就一清二楚了 |
|
[原创]DLL, lib静态、动态库
这种想法完全错误~ 动态库的主要作用是把功能模块独立出来用于共享,提供公共接口,而不必关心具体实现~ 一个库的功能不需要共享的话,你使用静态或动态方式都无所谓,但是需要共享的话,动态库就比较方便了~ 而动态库呢,只要接口不变,它的具体实现有没有变化根本不需要关心,比如CreateFile这种系统dll中的API,从98时代到现在其内部实现不知道升级了多少版本了,但是参数定义一直没变化,使用这个API的程序也就不需要做什么变化就可以正常使用并且可以享受其内部实现的新特性~ 而使用静态库的话,相应的功能每升级一次,你想使用新功能就得重新编译一次程序,何必呢? 64K内存的时代,人们绞尽脑汁在想着如何节省每一字节的内存使用时肯定在想,如果内存能达到64M那该多好啊,就可以想用就用了~ 而现在家用机的内存普遍达到了4G、8G左右,但是应用软件使用的内存也越来越大,总还是感觉不够用的~ 至于服务器,呵呵,128G或者更大内存的服务器现在也多的是吧? 你问问数据库管理员内存够用吗? 所以,一个时代有一个时代的问题,要用发展的眼光来看~ 少年,你想得太简单了~ |
|
[求助]请问我如何获得磁盘上的分区信息?
QueryDosDevice http://msdn.microsoft.com/en-us/library/cc542456(v=vs.85).aspx char szDrv[MAX_PATH] = "C:"; char szBuffer[1024]={0}; DWORD ret = QueryDosDevice(szDrv,szBuffer,1024); printf("DevicePath = %s\n",szBuffer); |
|
[求助]Delphi编写怕LPK在Win7 64位无法运行!
要改注册表啊,那就没啥好说了,我说嘛,这玩意儿Win7下默认不能劫持的 |
|
[求助]Delphi编写怕LPK在Win7 64位无法运行!
win7下面lpk.dll应该属于knowndll了吧,还能被劫持吗? |
|
想问问关于WinDbg无法连接上WIN7的解决办法
用管理员权限运行 |
|
[求助]我想写一个函数,参数为ip地址,用来探测此ip主机是否在线
Ping最简单,但是可能会被对方限制,代码也不用楼上那么麻烦 IcmpCreateFile/IcmpSendEcho/IcmpCloseHandle三个函数,不超过10行代码就可以搞定 |
|
[求助]winserver2003是否支持大硬盘
我也没搞什么啊,记得就是mbr的,明天再确认一下 |
|
[求助]winserver2003是否支持大硬盘
补充一下,是mbr格式 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值