Skip to content

How to create a SimFile and use SimSymbolicMemory? #2311

@JustAhmed

Description

@JustAhmed

Greetings!
So, i was going through some CTF challenges with angr and came across that one
it seems pretty straight forward to me but when i ran the script for the first time i got the following error:

password_file = angr.storage.SimFile(filename, 'rb', content=symbolic_file_backing_memory, size=symbolic_file_size_bytes) TypeError: __init__() got multiple values for argument 'content'

after researching the problem i found out that removing 'rb' from the parameters should solve the problem. Running the script again generated a different error but this time i can't figure it out. The error is:
File "solve.py", line 91, in main
password_file = angr.storage.SimFile(filename, content=symbolic_file_backing_memory, size=symbolic_file_size_bytes)
File "/home/user1/Angr/lib/python3.8/site-packages/angr/storage/file.py", line 179, in __init__
raise TypeError("Can't handle SimFile content of type %s" % type(content))
TypeError: Can't handle SimFile content of type <class 'angr.state_plugins.symbolic_memory.SimSymbolicMemory'>

I thought it may be related to the fact that i'm using python3, but i can't confirm that since anger is no longer supported for pytho2 so i'm kinda stuck at this point. Can i get a hint on how to solve/wrok around this porblem?
Many thanks for the awesome framework btw

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions