|
大牛们帮看看吧
爆掉以后还不能用,或许是因为别的地方还要验证吧,这么长,没几个人愿意去看一遍的…… |
|
|
|
函数指针与typedef
不知你到底想知道什么……囧…… 如果不是专门问函数指针问题的话,建议你直接按M$的写法写就是了: FARPROC WINAPI GetProcAddress( __in HMODULE hModule, __in LPCSTR lpProcName); 直接强制转换成FARPROC,也不用管其它的了…… 或者 FARPROC uAddr; (FARPROC &) uAddr = GetProcAddress(LoadLibrary("user32.dll"),"MessageBoxA"); 自己看着写呗,只要没犯原则性错误就是了…… |
|
[求助]如何快速升级为正式会员?
不是吧,这么有缘?那以后就算全论坛所有人都用这个头像,我也绝不会换掉~~哇咔咔,不过貌似没人爱跟进我的头像…… |
|
函数指针与typedef
不是void,看我在15L的解释,就好像 typedef bool BOOLEAN;一样,以后需要用bool的地方也就可以用BOOLEAN来代替了。 同理 typedef void(*MYPROC)(LPTSTR),那么以后需要用 void(*)(LPTSTR)的地方也就可以用MYPROC代替了。 PS:为了这个分我可真是尽心竭力了……还差3分就够钱买个邀请码了…… |
|
函数指针与typedef
晕,我知道你为什么不懂了,是因为形式的原因…… ProcAdd=(void (*)(LPTSTR))GetProcAddress(LibHandle,"MessageBoxA"); 你不知道为什么用(void (*)(LPTSTR))来进行强制类型转换是不是? 因为你写的是 typedef void(*MYPROC)(LPTSTR) ,这样写那么就意味着你定义了一个新的数据类型,叫做MYPROC。去掉typedef,去掉你定义的类型名MYPROC,就剩下void(*)(LPTSTR)了,所以你新定义的这个数据类型就是void(*)(LPTSTR)类型的,所以强制类型转换时要写成(void(*)(LPTSTR))这种奇怪的样子…… 而你写了typedef ……之后,(void (*)(LPTSTR))也就是MYPROC了,俩是一样的,所以你也可以用(MYPROC)来进行强制类型转换。 |
|
函数指针与typedef
这是C语言的规定……这样写就是进行强制类型转换的……没有为什么…… |
|
函数指针与typedef
额,这我倒没想过,呵呵,一直用(*pf)(11)写习惯了……不知有区别没,貌似没有,呵呵。 建议你直接从汇编的角度的理解吧,高级语言里的函数调用不过就是 push eip jmp 函数地址 这个函数地址你爱怎么获得怎么获得,用函数名字也好,用你自己弄的函数指针也罢,你直接写出来这个地址都行,也就是说只要地址是同样的,你爱咋写咋写 |
|
函数指针与typedef
你调用MessageBox的时候可以这样写: push push push push call MessageBox 这就好比高级语言里写MessageBox(NULL,offset szText,offset szCaption,MB_OK),这是我们常用的调用方式(C里可没有offset,哈哈)。 你也可以通过fp = (FARPROC)GetProcAddress(LoadLibrary("user32.dll"),"MessageBoxA")来获得MessageBoxA的地址,然后这样调用: push push push push call fp 这就好比是(*fp)(NULL,offset szText,szCaption,MB_OK),在高级语言的角度来看,两者是不同的,但是在汇编的角度来看,两者其实是一回事,因为函数的名字本身就存储着函数的地址,函数的名字本身就是一个函数指针,我们调用函数的时候用谁都一样,都是用的函数的地址。只是函数名字存储函数地址这个事实被编译器给隐藏了,我们平时也不在意。 返回值类型 函数名字(参数) 返回值类型 函数地址(参数) 两者是一回事~ |
|
|
|
函数指针与typedef
编译当然正确,都是DWORD嘛,呵呵,ls正解,编译正确甚至在你的机器上运行正确并不能代表程序就是正确的。 至于函数指针,很好理解,函数的名字指代的就是函数的首地址(就像数组的名字一样),调用一个函数可以通过函数的名字来调用func(1,2),那自然也可以用一个指向函数的指针的来调用这个函数(*pFunc)(1,2),这两者是一样的,就像下面: #include<iostream> using namespace std; typedef void(*pFunc)(int); void func(int a) { cout << a << endl; } int main() { func(7); //这总没问题吧 pFunc pf = func; (*pf)(11); //函数指针 cout << func << endl; cout << pf << endl; //这两者显然是一样的 return 0; } |
|
网上有那么多的软件!软件公司干嘛!!!
没软件公司的话,网上哪来的那么多软件?呵呵,不过软件公司做的一般都是一些行业软件,因为不容易被盗版,呵呵,客户一般都是企业客户,万一用盗版比较好查,而且一告一个准,不像个人用户,所以很少有大公司用盗版的行业软件~ |
|
新年第一天求助大家帮忙.......先给大家拜年了...
很显然,建议学习C/C++,如果觉得自己比较懒的话,Delphi是个不错的选择 :-) 希望不会被Delphi程序员骂~~呵呵 至于你说的那个什么学习系统……我没听过,更没注册码,我觉得学C语言没必要弄那玩意吧。 ------------------------------------------------------ 刚才看到楼下说的英语的问题,我觉得lz根本不用担心,很多人都是一开始被英语吓跑了,根本没必要嘛,本来就是初学者,国内的资料都已经完全能满足自己的要求了,根本没必要为了去看国外的资料先花上一年多功夫去背英语,等背完了只怕热情早耗光了,慢慢找资料看,等到你发觉国内的资料已经满足不了你的要求了的时候,同时你就会发现你的水平已经能够看懂英文了~如果临时需要看一些英文资料的话,可以到translate.google.com上查一下嘛~ 引用某大牛的一句话:没有必要在三岁的时候为自己准备棺材。 :-) |
|
|
|
Win7 下开OD加载exe,为何总停留在ntdll领空?
首先清空UDD目录试一下,如果不行的话,看一下OD的设置有问题么?“选项”-“调试选项”-“事件”,只选中WinMain那一个或者主模块入口点那一个,如果还是不行,lz想一想最近新装什么插件没?如果还是不行,建议lz换一个版本的OD解压了试一下,如果还是不行,记得曾经在装360的机器上用OD会有些不正常…… |
|
安装虚拟机vmware后启动vmware的一个错误提示怎么解决?
什么提示? 一般来说都是提示说“Do not forgot to install VMware Tools inside this virtual machine”,或者“Can not connectes to floopy0”之类的,要么就点YES,要么就点OK,如果嫌烦,直接选中“Do not show this hint again”前面的复选框,这样下次就不提示了,像floopy之类的提示可以在虚拟机设置里弄成总是不连接。 不知lz说的是这种提示不? |
|
|
|
[分享]新人给你们拜年来了!
哈哈,新年快乐~ |
|
[求助]昨天还能在求助问答区回答问题的,今天怎么就不能了?
报告kanxue老大,我觉得只要禁止临时会员在【求助问答区】提问就可以了,回答还是可以的,这样就不会有曲线转账的情况发生了。 如果不能在哪儿回答问题的话,临时会员就根本赚不到钱了,只能靠求邀请码或者混时间自己去买了,希望kanxue老大能到这个帖子,给临时会员开通回答问题的权限 :-) 哪位不是临时会员的朋友看到后给kanxue老大发个站内信吧,给老大说一下这个情况,呵呵,麻烦你了,先道谢。 |
|
[求助]昨天还能在求助问答区回答问题的,今天怎么就不能了?
有人借提问的幌子曲线转账啊,结果kanxue老大直接不准临时会员在求助问答区提问和回答了……真让那个家伙给气死了,把这点小聪明用在学习上的话,只怕早就赚来好几个邀请码的钱了,哪用的着这样!!还害得我们受牵连 |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值