jtpereyda/boofuzz

How to access the primitives of a static node?

tr4v3ler opened this issue · 2 comments

Here is an example:

s_initialize("first")
with s_block("a"):
    s_static(b"\x00\x00", name="static_data")

s_initialize("second")
with s_block("b"):
    s_bytes(b"\x00\x00", name="fuzz_data")
...
session.connect(s_get("first"))
session.connect(s_get("first"), s_get("second"))
    
session.fuzz()

I know that I can access the fuzz_data in the callback function in the following way:
session.fuzz_node.names["second.b.fuzz_data"]
But I don't know how to access static_data in callback functions.

You should be able to access static_data in the same way as fuzz_data. What exactly are you trying to access/write?
If you're trying to modify its value you could try to write to session.fuzz_node.names["second.b.static_data"]._default_value.

I hope that helps.

I found that all types of nodes can be accessed in the following way:
session.nodes[index].names["first.a.static_data"]