Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLE crashes when trying to load FASM-compiled executables #48

Open
ViktorMKa opened this issue Dec 15, 2015 · 9 comments
Open

CLE crashes when trying to load FASM-compiled executables #48

ViktorMKa opened this issue Dec 15, 2015 · 9 comments
Assignees

Comments

@ViktorMKa
Copy link

>>> b=angr.Project('./garbage_bytes2.EXE')
ERROR   | 2015-12-15 16:57:25,594 | cle.loader | Loading error when loading /home/viktor/tool/angrtest/garbage_bytes2.EXE with backend Blob
Traceback (most recent call last): File "/home/viktor/.virtualenvs/angr3/local/lib/python2.7/site-packages/cle/loader.py", line 230, in load_object loaded = backend(path,compatible_with=compatible_with, filetype=filetype, is_main_bin=is_main_bin, **options)
  File "/home/viktor/.virtualenvs/angr3/local/lib/python2.7/site-packages/cle/backends/blob.py", line 25, in __init__raise CLEError("Must specify custom_arch when loading blob!")
CLEError: Must specify custom_arch when loading blob!
Traceback (most recent call last):    
  File "<stdin>", line 1, in <module>
  File "/home/viktor/.virtualenvs/angr3/local/lib/python2.7/site-packages/angr/project.py", line 98, in __init__
self.loader = cle.Loader(self.filename, **load_options)
File "/home/viktor/.virtualenvs/angr3/local/lib/python2.7/site-packages/cle/loader.py", line 88, in __init__
self._load_main_binary()
File "/home/viktor/.virtualenvs/angr3/local/lib/python2.7/site-packages/cle/loader.py", line 139, in _load_main_binary
self.main_bin = self.load_object(self._main_binary_path, self._main_opts, is_main_bin=True)
File "/home/viktor/.virtualenvs/angr3/local/lib/python2.7/site-packages/cle/loader.py", line 236, in load_object
raise CLEError("All backends failed loading %s!" % path)
cle.errors.CLEError: All backends failed loading /home/viktor/tools/angrtest/garbage_bytes2.EXE!

Not sure if this is my error or whether it is on angr/CLE. I made a fresh virtualenv to try and fix this. Didn't help.

garbage_bytes.txt

@rhelmot
Copy link
Member

rhelmot commented Dec 15, 2015

Could you provide the compiled binary? What's happening is that CLE can't tell what kind of file it is (all its magic number checks fail), and also the blob backend fails because you didn't specify the architecture it's for, so CLE can't load it.

@ViktorMKa
Copy link
Author

garbage_bytes2.EXE.zip
This is the file in question. I'm not sure about specifying the architecture, i only dabbled in assembler to produce some small testcase files.

@zardus
Copy link
Member

zardus commented Dec 17, 2015

rhelmot is the only one with a chance at solving this :-)

@rhelmot
Copy link
Member

rhelmot commented Dec 18, 2015

Alright so the answer here is that this is a MS-DOS executable, which is not currently supported by CLE. It wouldn't be too hard to write a loader for this format, since there's no metadata and it's basically a flat binary minus the header if I'm not mistaken.

@ltfish
Copy link
Member

ltfish commented Dec 18, 2015

Do we support running 16-bit programs (or is that part open sourced)?

@rhelmot
Copy link
Member

rhelmot commented Dec 18, 2015

Ronny's stuff is in fact released, so there shouldn't be an issue here.

@ltfish
Copy link
Member

ltfish commented Dec 18, 2015

Nice! I guess we are still lacking simulation for MS-DOS environments, but that's not a big issue.

@ViktorMKa
Copy link
Author

It is honestly not a big priority to me. I've switched over to gcc for my assembler needs, which works just dandy since it produces ELF files. Still thank you for the explanations you provided.

@trietptm
Copy link

It would be nice to have angr CLE support for MS-DOS executable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants