MCPcopy Create free account
hub / github.com/qilingframework/qiling / call_native

Method call_native

qiling/os/fcall.py:192–212  ·  view source on GitHub ↗

Call a native function after properly staging its arguments and return address. Args: addr: function entry point args: a sequence of 2-tuples containing parameters types and values to pass to the function; may be empty ret: return address; may be None

(self, addr: int, args: Sequence[Tuple[Any, int]], ret: Optional[int])

Source from the content-addressed store, hash-verified

190 return targs, retval, retaddr
191
192 def call_native(self, addr: int, args: Sequence[Tuple[Any, int]], ret: Optional[int]) -> None:
193 """Call a native function after properly staging its arguments and return address.
194
195 Args:
196 addr: function entry point
197 args: a sequence of 2-tuples containing parameters types and values to pass to the function; may be empty
198 ret: return address; may be None
199 """
200
201 # reserve slots for arguments
202 nslots = self.__count_slots(atype for atype, _ in args)
203 self.cc.reserve(nslots)
204
205 if ret is not None:
206 self.cc.setReturnAddress(ret)
207
208 # set arguments values
209 self.writeParams(args)
210
211 # call
212 self.ql.arch.regs.arch_pc = addr

Callers 10

__invoke_callbackMethod · 0.80
hook_ZwRaiseExceptionFunction · 0.80
hook_RaiseExceptionFunction · 0.80
invoke_swsmiMethod · 0.80
call_functionMethod · 0.80
unload_modulesMethod · 0.80
execute_moduleMethod · 0.80
call_dll_entrypointMethod · 0.80
loadMethod · 0.80
call_DialogFuncFunction · 0.80

Calls 4

__count_slotsMethod · 0.95
writeParamsMethod · 0.95
reserveMethod · 0.45
setReturnAddressMethod · 0.45

Tested by

no test coverage detected