You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fuzz Return:
Sometimes it would be nice to fuzz the return value of a function instead of replacing it with a static value. I've prototyped this with the inline asm native.inline_asm_024900bfd1f800007047efbe0040 which returns the value of 0x4000beef (a made up peripheral address), but I suspect there may be better ways to do this.
Readable ASM:
Rather than specify inline_asm through hex values, it would be nice to have an option to write it out in readable form, and have it assembled, so as to make the config files more readable.
This should be pretty easy with the keystone library. Something like
from keystone import Ks,KS_ARCH_ARM,KS_MODE_THUMB
patch = bytes(Ks(KS_ARCH_ARM, KS_MODE_THUMB).asm(readable_patch)[0])
as compared to
patch = binascii.unhexlify(inline_patch_hex)
in emulator/harness/fuzzware_harness/user_hooks/__init__.py should work
The text was updated successfully, but these errors were encountered:
for fuzzing the return value, you should be able to use the native.get_fuzz function in python, cast the bytes to an int, write them to r0 and configure the handler to return. To create a handler in a python file in the directory which contains the config, you can use the PYTHONPATH env variable targeting the directory and then create a simple myhandlers.py containing a function which you can then target via handler: myhandlers.myhook.
These files look something like this (I have not tested these exact ones but have used the PYTHONPATH once lately)
myhandlers.py
fromfuzzware_harness.nativeimportget_fuzzdefhandle(uc):
b=get_fuzz(4)
retval=struct.unpack("<I", b)
uc.regs.r0=retval
Two suggestions for handlers:
Fuzz Return:
Sometimes it would be nice to fuzz the return value of a function instead of replacing it with a static value. I've prototyped this with the inline asm
native.inline_asm_024900bfd1f800007047efbe0040
which returns the value of 0x4000beef (a made up peripheral address), but I suspect there may be better ways to do this.Readable ASM:
Rather than specify inline_asm through hex values, it would be nice to have an option to write it out in readable form, and have it assembled, so as to make the config files more readable.
This should be pretty easy with the keystone library. Something like
as compared to
in
emulator/harness/fuzzware_harness/user_hooks/__init__.py
should workThe text was updated successfully, but these errors were encountered: