|  |  |  |  |  |  | 
					            
						            
							            
								            |  | 
	WinDbg帖子发起人: 文竹   发起时间: 2008-10-14 21:04 下午   回复: 41
 
	 
		
			| 
					
						|         | 
						      
						        | 帖子排序: |  |  |  |  
				
					| 
							
								| 
										
											|  2008-10-14, 21:04 下午 |  
											| 
													 文竹 
 
   注册: 2008-10-09
 发 贴: 17
 |  |  
											| 
													
														|   | 
																
																	| 问题全部解决了,打扰大家了,哈哈! 谢谢大家关注~~
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2008-10-15, 08:42 上午 |  
											| 
													 格蠹老雷 
 
   注册: 2005-12-19
 发 贴: 1,303
 |  |  
											| 
													
														|   | 
																
																	| 上面的错误是说找不到文件'engextcpp.hpp',这是第三种方式(EngCpp)所定义框架的头文件,位于sdk\inc目录中。因此你应该将sdk\inc目录放到头文件路径中。 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2008-10-15, 09:02 上午 |  
											| 
													 文竹 
 
   注册: 2008-10-09
 发 贴: 17
 |  |  
											| 
													
														|   | 
																
																	| Raymond ,你好!我很敬畏您的技术~能不能留下你的联系方式~;以便能即时请教! 
 
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2008-10-15, 09:07 上午 |  
											| 
													 格蠹老雷 
 
   注册: 2005-12-19
 发 贴: 1,303
 |  |  
											| 
													
														|   | 
																
																	| 文竹,在这个页面上有我的email地址: http://advdbg.org/books/swdbg/feedback.aspx 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2008-10-15, 09:09 上午 |  
											| 
													 文竹 
 
   注册: 2008-10-09
 发 贴: 17
 |  |  
											| 
													
														|   | 
																
																	| 不好意思,很冒昧的问你用即时聊天工具~qq、msn!由于我最近正在学习windbg,有您这样一位老师指导,对我来说很荣幸! 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2008-10-30, 21:46 下午 |  
											| 
													 zhzhtst 
 
   注册: 2007-02-10
 发 贴: 5
 |  |  
											| 
													
														|   | 
																
																	| The Build utility is usually not able to compile code that is located in a directory path containing spaces. Your extension code should be located in a directory whose full path contains no spaces. (In particular, this means that if you install Debugging Tools for Windows to the default location — Program Files\Debugging Tools for Windows — you will not be able to build the sample extensions.) 
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-05, 16:08 下午 |  
											| 
													 liuyjpdc 
 
   注册: 2009-01-05
 发 贴: 14
 |  |  
											| 
													
														|   | 
																
																	| 各位好,看了你们的对话,感觉理解了很多,但是我的还是不行哈. 我的LBR总出现这个问题...
 \practice\lbr\lbr.cpp(39) : error C2491: 'nLBR' : definition of dllimport data not allowed
 \practice\lbr\lbr.cpp(43) : error C2491: 'fnLBR' : definition of dllimport function not allowed
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-05, 16:10 下午 |  
											| 
													 liuyjpdc 
 
   注册: 2009-01-05
 发 贴: 14
 |  |  
											| 
													
														|   | 
																
																	| 我想写一个dll来对部api函数打断点,希望大家指教一下....谢谢 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-05, 22:14 下午 |  
											| 
													 格蠹老雷 
 
   注册: 2005-12-19
 发 贴: 1,303
 |  |  
											| 
													
														|   | 
																
																	| |  liuyjpdc wrote: |  | | 各位好,看了你们的对话,感觉理解了很多,但是我的还是不行哈. 我的LBR总出现这个问题... \practice\lbr\lbr.cpp(39) : error C2491: 'nLBR' : definition of dllimport data not allowed \practice\lbr\lbr.cpp(43) : error C2491: 'fnLBR' : definition of dllimport function not allowed | 
 | 
 不知道你是怎么编译的,VC几,命令行还是IDE?这个错误是因为没有定义LBR_EXPORTS标志。
 #ifdef LBR_EXPORTS#define LBR_API __declspec(dllexport)
 #else
 #define LBR_API __declspec(dllimport)
 #endif
 使用IDE编译时,项目属性里已经设置好了。 
   
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-06, 18:12 下午 |  
											| 
													 手语 
 
  
   注册: 2008-06-06
 发 贴: 73
 |  |  
											| 
													
														|   | 
																
																	| 好像阿 那个路径里不能有空格的
 你把代码从安装目录考到根目录下某个不带空格的目录再编译试试
 
 我也写扩展DLL
 个人感觉还是DbgEng方式的比较顺手
 例子可以看Exts
 鸿鹄安知燕雀之志
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-06, 18:31 下午 |  
											| 
													 手语 
 
  
   注册: 2008-06-06
 发 贴: 73
 |  |  
											| 
													
														|   | 
																
																	| 建议先把某个Sample编译过 然后在这个Sample框架基础上增加一些功能
 慢慢就简单了
 鸿鹄安知燕雀之志
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-07, 10:03 上午 |  
											| 
													 liuyjpdc 
 
   注册: 2009-01-05
 发 贴: 14
 |  |  
											| 
													
														|   | 
																
																	| 谢谢各位的指点,现在我的程序能编译过了 但是当我想传几个参数的时候又遇到问题了,我得写一个dll把指定内存中的值读到指定的文件上,
 命令如 !read  xxx   number  place .
 把内存地址为xxx的number大小字节的数据放到指写的文件place上.
 我现在只能传入xxx的值,用GetExpression(args)(参照sdk中的例子),但是number和place不知道该怎样传入了,它们为args[1],args[2]吗,当我把它们显示出来的时候又不对了..
 希望得到大家的指点...
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-07, 13:04 下午 |  
											| 
													 手语 
 
  
   注册: 2008-06-06
 发 贴: 73
 |  |  
											| 
													
														|   | 
																
																	| 扩展命令原型中args参数都是PCSTR的 PCSTR                  args
 所有参数都在一个字符串里
 需要自己解析
 鸿鹄安知燕雀之志
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-07, 13:06 下午 |  
											| 
													 手语 
 
  
   注册: 2008-06-06
 发 贴: 73
 |  |  
											| 
													
														|   | 
																
																	| 参考帮助 Args
 Specifies the arguments passed to the extension command. In particular, if the extension command was called from a command line, Args contains the rest of the command line. It can be NULL or empty.
 
 其实WinDBG的帮助写得挺详细了,多读读就明白了。
 鸿鹄安知燕雀之志
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-07, 14:04 下午 |  
											| 
													 liuyjpdc 
 
   注册: 2009-01-05
 发 贴: 14
 |  |  
											| 
													
														|   | 
																
																	| 能不能讲明白一点啊,我显示args,args[0],args[1],args[2].....都不是我输入进去的参数啊... 能不能讲讲它的存储方式是什么啊,是第一个参数在args[0]中,第二个以至类推.还是其他的呢...还有它的格式是什么呢...args是个指针吗?
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
		
			|  | 
						
							| 
									
										| 总页数 2 第 3 页  [共有 42 条记录] | < 1 2 3 > |  |  |  
		
			| 高端调试 » 软件调试 » WinDbg » Re: 怎么写windbg的扩展命令? |  |  
 |  |  |  |