|  |  |  |  |  |  | 
					            
						            
							            
								            |  | 
	WinDbg帖子发起人: 手语   发起时间: 2009-01-07 14:17 下午   回复: 41
 
	 
		
			| 
					
						|         | 
						      
						        | 帖子排序: |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-07, 14:17 下午 |  
											| 
													 手语 
 
  
   注册: 2008-06-06
 发 贴: 73
 |  |  
											| 
													
														|   | 
																
																	| 1. 你想写那种类型的扩展DLL? DbgEng? EngExtCpp? WdbgExts?
 
 2. args,args[0],args[1],args[2]..... 是在哪里看到的?谁先是给你的?哪个文件?
 
 3. Args就是个CHAR型指针,指向命令中的参数。
 鸿鹄安知燕雀之志
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-07, 17:39 下午 |  
											| 
													 liuyjpdc 
 
   注册: 2009-01-05
 发 贴: 14
 |  |  
											| 
													
														|   | 
																
																	| 谢谢,我写的是第三种哈 前面的问题已经搞懂了哈...不过又迎来新的问题!!!!
 我想在windbg在输入一个目录及文件,然后新建此文件,并向其中写入一定数据...我写了之后,在执行时,总是报错且没有产生我的文件...
 我用的是fopen函数.
 报错如下:
 0000005 Exception in cc.dll.read debugger extension.
 PC: 7c921010  VA: 00000034  R/W: 0  Parameter: 0001003f
 希望大家多帮助...
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-07, 17:42 下午 |  
											| 
													 liuyjpdc 
 
   注册: 2009-01-05
 发 贴: 14
 |  |  
											| 
													
														|   | 
																
																	| 我的部分代码如下:char * place=NULL; for (int ii=0;args[ii+13]!='\0';ii++)
 {
 place[ii]=args[ii+13];
 }
 
 fp=fopen(place,"w");
 for (int j=0;j<ss;j++)
 {
 fprintf(fp," %x",Buffer[j]);
 }
 fclose(fp);
 //感觉文件没有新建成功...
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-07, 21:40 下午 |  
											| 
													 格蠹老雷 
 
   注册: 2005-12-19
 发 贴: 1,303
 |  |  
											| 
													
														|   | 
																
																	| 异常应该是0xC0000005吧,访问违例了,看下面的代码,place指针明显没有指向有效的内存就访问它。 
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-07, 22:49 下午 |  
											| 
													 手语 
 
  
   注册: 2008-06-06
 发 贴: 73
 |  |  
											| 
													
														|   |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-08, 20:20 下午 |  
											| 
													 liuyjpdc 
 
   注册: 2009-01-05
 发 贴: 14
 |  |  
											| 
													
														|   | 
																
																	| 哦,谢谢了哈. 我的问题终于解决了,总算写好了一个可以用的dll,感觉收获很多,也再次谢谢各位的哈...
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-09, 10:29 上午 |  
											| 
													 liuyjpdc 
 
   注册: 2009-01-05
 发 贴: 14
 |  |  
											| 
													
														|   | 
																
																	| 我在编译sdk中的exts时为什么总是说这样的错误呢,我把dgeng.h复制到了exts目录 也增加了lib文件...这里的错误共有79个,是怎么回事呢???
 #include"dbgeng.h"
 d:\liu\exts\dbgeng.h(4530) : error C2146: syntax error : missing ';' before identifier 'ExceptionRecord'
 d:\liu\exts\dbgeng.h(4530) : error C2501: 'EXCEPTION_RECORD64' : missing storage-class or type specifiers
 d:\liu\exts\dbgeng.h(4530) : error C2501: 'ExceptionRecord' : missing storage-class or type specifiers
 d:\liu\exts\dbgeng.h(4757) : error C2061: syntax error : identifier 'Output'
 d:\liu\exts\dbgeng.h(4762) : error C2091: function returns function
 d:\liu\exts\dbgeng.h(4762) : error C2501: 'STDMETHODV' : missing storage-class or type specifiers
 d:\liu\exts\dbgeng.h(4762) : error C2253: 'STDMETHODV' : pure specifier only applies to virtual function - specifier ignored
 d:\liu\exts\dbgeng.h(4775) : error C2061: syntax error : identifier 'ControlledOutput'
 d:\liu\exts\dbgeng.h(4781) : error C2091: function returns function
 d:\liu\exts\dbgeng.h(4781) : error C2501: 'STDMETHODV' : missing storage-class or type specifiers
 d:\liu\exts\dbgeng.h(4781) : error C2556: 'int (__cdecl *__thiscall IDebugControl::STDMETHODV(void))(unsigned long,unsigned long,const char *,...)' : overloaded function differs only by return type from 'int (__cdecl *__thiscall IDebugControl::STDME
 THODV(void))(unsigned long,const char *,...)'
 d:\liu\exts\dbgeng.h(4757) : see declaration of 'STDMETHODV'
 d:\liu\exts\dbgeng.h(4781) : warning C4031: second formal parameter list longer than the first list
 
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-09, 12:58 下午 |  
											| 
													 zhzhtst 
 
   注册: 2007-02-10
 发 贴: 5
 |  |  
											| 
													
														|   | 
																
																	| 如果不想麻烦,最好看一下samples目录下的readme.txt文件,那上面说得十分清楚。 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-09, 14:19 下午 |  
											| 
													 手语 
 
  
   注册: 2008-06-06
 发 贴: 73
 |  |  
											| 
													
														|   | 
																
																	| 1、必须用WDK编译,必须用Windows 2003 Server Build Environment
 2、设置环境变量
 set DBGSDK_INC_PATH=%debuggers%\sdk\inc
 set DBGSDK_LIB_PATH=%debuggers%\sdk\lib
 3、用build -cZMg编译
 4、多看看帮助,WinDBG的帮助写得不错,干净清楚。
 5、基本功,多尝试,多思考
 鸿鹄安知燕雀之志
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-11, 20:35 下午 |  
											| 
													 liuyjpdc 
 
   注册: 2009-01-05
 发 贴: 14
 |  |  
											| 
													
														|   | 
																
																	| 怎么写makefile呢,有没有一个范本或例子啊??? 初学者,让大家多费心了哈   
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-11, 21:08 下午 |  
											| 
													 liuyjpdc 
 
   注册: 2009-01-05
 发 贴: 14
 |  |  
											| 
													
														|   | 
																
																	| 我根据那个sources写的makefile总是有问题哟~~~ 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
				
					| 
							
								| 
										
											|  2009-01-11, 21:31 下午 |  
											| 
													 liuyjpdc 
 
   注册: 2009-01-05
 发 贴: 14
 |  |  
											| 
													
														|   | 
																
																	| 问题如下:这个是什么原因造成的呢?我没有改变def里的东西啊 D:\WinDDK\6001.18002\bin\exts>build -cZMg
 path contains nonexistant c:\program files\stormii\codec, removing
 BUILD: Compile and Link for IA64
 BUILD: Start time: Sun Jan 11 21:20:58 2009
 BUILD: Examining d:\winddk\6001.18002\bin\exts directory for files to compile.
 BUILD: Compiling d:\winddk\6001.18002\bin\exts directory
 errors in directory d:\winddk\6001.18002\bin\exts
 d:\winddk\6001.18002\bin\exts\dbgexts.def(2) : error U1033: syntax error : ';' u
 nexpected
 errors in directory d:\winddk\6001.18002\bin\exts
 nmake.exe /nologo BUILDMSG=Stop. -i BUILD_PASS=PASS1 NOLINK=1 MAKEDIR_RELATIVE_T
 O_BASEDIR=bin\exts failed - rc = 2
 
 BUILD: Compile errors: not linking d:\winddk\6001.18002\bin\exts directory
 BUILD: Finish time: Sun Jan 11 21:21:01 2009
 BUILD: Done
 
 0 files compiled - 1 Warning - 2 Errors
 
 |  |  
														|  | IP 地址: 已记录 | 报告 |  |  |  |  
		
			|  | 
						
							| 
									
										| 总页数 3 第 3 页  [共有 42 条记录] | < 1 2 3 |  |  |  
		
			| 高端调试 » 软件调试 » WinDbg » Re: 怎么写windbg的扩展命令? |  |  
 |  |  |  |