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
Hello, thank you for your work on this awesome library! I'd lke to use Qiling to override arguments to a function call with my own values. I'm running on Intel x86_64 instruction set.
And I got it to work for string types, though I'm not sure if this is the best way:
defoverride_arguments(ql):
addr=0x100000# By the way, what is the best place to allocate memory like this?size=len(arg) +1size=ql.mem.align_up(size)
ql.log.info(f"Reserving {size} bytes")
ql.mem.map(addr, size)
ql.log.info(f"Writing {repr(arg)} to 0x{addr:x}")
ql.mem.string(addr, arg)
ql.arch.regs.write("edi", addr)
However, I can't figure out how to supply floating-point values. As far as I can tell, the calling convention passes these values in the registers xmm0, xmm1, ... using the movss instruction. If I directly write data to xmm0, the value is printed as 0.0 in the inferior program.
I'd appreciate if you can help answer my questions: What's the best way to allocate memory for loading string data? How can I load floating-point values as a function's arguments?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, thank you for your work on this awesome library! I'd lke to use Qiling to override arguments to a function call with my own values. I'm running on Intel x86_64 instruction set.
This is easy to do for integer types:
And I got it to work for string types, though I'm not sure if this is the best way:
However, I can't figure out how to supply floating-point values. As far as I can tell, the calling convention passes these values in the registers
xmm0
,xmm1
, ... using themovss
instruction. If I directly write data toxmm0
, the value is printed as 0.0 in the inferior program.I'd appreciate if you can help answer my questions: What's the best way to allocate memory for loading string data? How can I load floating-point values as a function's arguments?
Beta Was this translation helpful? Give feedback.
All reactions