Skip to content

Commit

Permalink
Deployed ed8fda2 with MkDocs version: 1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
msm-code committed Jan 1, 2025
1 parent 3e95ecc commit 6cb04ae
Show file tree
Hide file tree
Showing 4 changed files with 5,476 additions and 3,866 deletions.
14 changes: 12 additions & 2 deletions getting_started/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ <h3 id="function">Function</h3>
print(Function(&quot;main&quot;).high_variables)

# Get the control flow graph of the main function...
# ...and show it! (you can do something more useful instead)
# ...and show it! (you can also do something more useful with it)
Function(&quot;main&quot;).control_flow.show()

# Decompile the main function and print the C code.
Expand All @@ -186,7 +186,7 @@ <h3 id="function">Function</h3>
# Define a function at address 0x400300
Function.create(0x400300, &quot;main&quot;)

# Infer a value of eax and edx at each call of this function
# Use symbolic execution to infer values of eax and edx at each call site
for call in Function(&quot;MyCustomCrypto&quot;).calls:
ctx = call.infer_context()
key, data = ctx[&quot;eax&quot;], ctx[&quot;edx&quot;]
Expand All @@ -197,9 +197,19 @@ <h3 id="function">Function</h3>
key, data = call.get_args()
print(key, data)

# Rename functions calling this function
for caller in Function(&quot;MyCustomCrypto&quot;).callers:
# Use caller address as a suffix. It's often useful to combine this with
# emulation, so you can put more context in the name.
caller.rename(&quot;CallsCustomCrypto_{}&quot;.format(caller.address))

# Emulate a function call and pass parameters (using the function signature)
ctx = Function(&quot;GetFuncNameByHash&quot;).emulate(0x698766968)
print(ctx.read_cstring(ctx[&quot;eax&quot;]))

# Use Ghidra's SymbolicPropagator to get known register values
ctx = Function(0x401000).symbolic_context()
print(ctx.register_at(0x401020, &quot;eax&quot;))
</code></pre>
<p>Read more in the <a href="../reference/#ghidralib.Function"><code>Function</code> object documentation</a>.</p>
<h3 id="instruction">Instruction</h3>
Expand Down
Binary file modified objects.inv
Binary file not shown.
Loading

0 comments on commit 6cb04ae

Please sign in to comment.