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

Method __push_bytes

qiling/loader/elf.py:278–287  ·  view source on GitHub ↗

Write bytes to stack memory and adjust the top of stack accordingly. Top of stack remains aligned to pointer size

(top: int, b: bytes)

Source from the content-addressed store, hash-verified

276 new_stack = stack_addr
277
278 def __push_bytes(top: int, b: bytes) -> int:
279 """Write bytes to stack memory and adjust the top of stack accordingly.
280 Top of stack remains aligned to pointer size
281 """
282
283 data = b + b'\x00'
284 top = self.ql.mem.align(top - len(data), self.ql.arch.pointersize)
285 self.ql.mem.write(top, data)
286
287 return top
288
289 def __push_str(top: int, s: str) -> int:
290 """A convinient method for writing a string to stack memory.

Callers

nothing calls this directly

Calls 2

alignMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected