我正在使用Enterprise Architect,我在C / C ++中进行逆向工程时遇到了一些问题

时间:2013-07-23 06:04:06

标签: reverse-engineering enterprise-architect

我一直在使用Enterprise Architect工具执行与逆向工程相关的项目。但是,当我在C / C ++语言中执行逆向工程时,它会发生未知错误。遵循错误日志:

There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\7z\7zDecode.cpp  on line 91.  Unexpected symbol: *   
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\7z\7zEncode.h  on line 36.  Unexpected symbol: * 
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\7z\7zHandler.h  on line 46.  Unexpected symbol: public   
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\7z\7zIn.h  on line 210.  Unexpected symbol: baseOffset   
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\7z\7zOut.h  on line 103.  Unexpected symbol: &   
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\7z\7zUpdate.h  on line 74.  Unexpected symbol: * 
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Cab\CabBlockInStream.h  on line 37.  Unexpected symbol: void 
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Cab\CabHandler.h  on line 22.  Unexpected symbol: private    
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Chm\ChmHandler.h  on line 22.  Unexpected symbol: private    
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Chm\ChmHeader.cpp  on line 14.  Unexpected symbol: { 
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Chm\ChmIn.h  on line 208.  Unexpected symbol: PURE   
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Com\ComHandler.h  on line 23.  Unexpected symbol: STDMETHOD  
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Common\CoderMixer2MT.h  on line 59.  Unexpected symbol: ISequentialInStream  
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Common\CoderMixer2ST.h  on line 43.  Unexpected symbol: GetInStream  
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Common\CoderMixerMT.h  on line 50.  Unexpected symbol: ISequentialInStream   
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Common\CrossThreadProgress.h  on line 34.  Unexpected symbol: const  
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Common\DummyOutStream.h  on line 20.  Unexpected symbol: const   
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Common\InStreamWithCRC.h  on line 19.  Unexpected symbol: void   
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Common\OutStreamWithCRC.h  on line 22.  Unexpected symbol: const 
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Common\OutStreamWithSha1.h  on line 22.  Unexpected symbol: const    
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Hfs\HfsHandler.h  on line 22.  Unexpected symbol: }  
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Iso\IsoHandler.h  on line 25.  Unexpected symbol: STDMETHOD  
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Nsis\NsisDecode.h  on line 41.  Unexpected symbol: * 
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Nsis\NsisHandler.h  on line 19.  Unexpected symbol: public   
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Nsis\NsisIn.h  on line 136.  Unexpected symbol: *    
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Rar\RarHandler.h  on line 19.  Unexpected symbol: public 
You may need to define a language macro.    
There was an error parsing C:\Users\soo\Desktop\7z920\7zip\Archive\Rar\RarVolumeInStream.h  on line 26.  Unexpected symbol: void    
You may need to define a language macro.

检查错误日志,我认为大部分错误是由预处理器处理的代码生成的,例如“#define”,“#ifdef”等等。

我该如何解决这个问题?企业架构师可以通过预处理器来处理反向代码吗?

我还有一个问题。

当一个文件在反向过程中在某一行产生错误时,我发现Enterprise Architect不会在该文件中的错误行之后处理。

是否有一个函数可以通过跳过该错误行来连续处理该文件?

1 个答案:

答案 0 :(得分:1)

首先,C和C ++是两种完全不同的语言,EA就是这样对待它们的。您似乎正在尝试导入C ++源代码,因此请确保未在“导入源目录”对话框中选择C作为源类型。

其次,语言宏在“设置” - “预处理器宏”中定义。再次,确保选择正确的语言。

在解析过程中EA会跳过而不是展开预定义的预处理器宏(并且您只能指定宏名称,而不能指定右侧)。因此,如果您的代码包含许多聪明的宏,它们将不会包含在模型中。如果这是不可接受的,请通过预处理器运行代码,然后导入结果,该结果现在将是无宏的。

相关帮助页面是软件工程 - 开发工具 - 其他设置 - 语言宏。

最后不,你不能告诉EA继续解析遇到问题的文件。它会跳过并转到下一个。