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

Method set_cmdline

qiling/loader/pe.py:470–490  ·  view source on GitHub ↗
(self, name: bytes, address: int, memory: bytearray)

Source from the content-addressed store, hash-verified

468 self.ql.log.info(f'Returned from {dll_name} DllMain')
469
470 def set_cmdline(self, name: bytes, address: int, memory: bytearray):
471 cmdln = {
472 b'_acmdln' : 1,
473 b'_wcmdln' : 2
474 }
475
476 clen = cmdln.get(name, None)
477
478 if clen is None:
479 return None
480
481 addr = self.ql.os.heap.alloc(len(self.cmdline) * clen)
482 memory[address:address + self.ql.arch.pointersize] = self.ql.pack(addr)
483 data = self.cmdline
484
485 if clen == 2:
486 data = data.decode('ascii').encode('UTF-16LE')
487
488 self.ql.mem.write(addr, data)
489
490 return {"name": name, "address": address}
491
492 def init_teb(self):
493 teb_struct = make_teb(self.ql.arch.bits)

Callers 1

load_dllMethod · 0.95

Calls 4

getMethod · 0.45
allocMethod · 0.45
packMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected