angr/angr

SimFile Failed in the Windows7

Open

#981 建立於 2018年5月9日

在 GitHub 查看
 (4 留言) (0 反應) (1 負責人)Python (6,947 star) (1,031 fork)batch import
enhancementgood first issuehelp wanted

描述

Hello, everyone. First of all, I want to say that I run angr on Windows7, because I need to write a thesis about PE malware analysis. I follow the documents you provide to learn angr step by step, but an error occurred like this: Input:

files = {'test': angr.storage.file.SimFile('C:\Users\angry\AppData\Local\Temp\test.txt','r',size=30)}
s  = proj.factory.entry_state(fs=files,concrete_fs=True)

Error Output:

 TypeError                                 Traceback (most recent call last)
<ipython-input-99-36bce92d963a> in <module>()
----> 1 s  = proj.factory.entry_state(fs=files,concrete_fs=True)

C:\Python27\lib\site-packages\angr\factory.pyc in entry_state(self, **kwargs)
    133         """
    134
--> 135         return self._project.simos.state_entry(**kwargs)
    136
    137     def full_init_state(self, **kwargs):

C:\Python27\lib\site-packages\angr\simos\windows.pyc in state_entry(self, args,
env, argc, **kwargs)
     60     # pylint: disable=arguments-differ
     61     def state_entry(self, args=None, env=None, argc=None, **kwargs):
---> 62         state = super(SimWindows, self).state_entry(**kwargs)
     63
     64         if args is None: args = []

C:\Python27\lib\site-packages\angr\simos\simos.pyc in state_entry(self, **kwargs
)
    164
    165     def state_entry(self, **kwargs):
--> 166         return self.state_blank(**kwargs)
    167
    168     def state_full_init(self, **kwargs):

C:\Python27\lib\site-packages\angr\simos\windows.pyc in state_blank(self, **kwar
gs)
    150             add_options.add(o.ENABLE_NX)
    151             kwargs['add_options'] = add_options
--> 152         state = super(SimWindows, self).state_blank(**kwargs)
    153
    154         # yikes!!!

C:\Python27\lib\site-packages\angr\simos\simos.pyc in state_blank(self, addr, in
itial_prefix, stack_size, **kwargs)
    111             kwargs['os_name'] = self.name
    112
--> 113         state = SimState(self.project, **kwargs)
    114
    115         stack_end = state.arch.initial_sp

TypeError: __init__() got an unexpected keyword argument 'fs'

I also query the simstate function that caused the error.
class angr.sim_state.SimState(project=None, arch=None, plugins=None, memory_backer=None, permissions_backer=None, mode=None, options=None, add_options=None, remove_options=None, special_memory_filler=None, os_name=None). The init function does not have keyword argument 'fs'.

Therefore, I would like to confirm whether it is impossible to use SimFile on Windows currently. In addition, I would be very happy if you could give some way to read and write files on windows.

Thanks~

貢獻者指南

SimFile Failed in the Windows7 · angr/angr#981 | Good First Issue