qilingframework / qiling

A True Instrumentable Binary Emulation Framework
https://qiling.io
GNU General Public License v2.0
5.14k stars 744 forks source link

can't pass arg to command line tools #62

Closed TinyNiko closed 4 years ago

TinyNiko commented 4 years ago

in core.py , I think self.argv is writtern by self.filename and lost args . for example

 ql = Qiling(["rootfs/arm_linux/bin/aa"], "rootfs/arm_linux",argv=["rootfs/arm_linux/bin/aa","666666666"])
  if self.rootfs and self.shellcoder == None:
            if (os.path.exists(str(self.filename[0])) and os.path.exists(self.rootfs)):
                self.path = (str(self.filename[0]))
                if self.ostype == None or self.arch == None:
                    self.arch, self.ostype = ql_checkostype(self.path)
                tmp = self.argv
                print(self.filename)
                self.argv[0] = self.filename[0]
                print(self.argv)
xwings commented 4 years ago

there are some examples shows how argv works

if you want to change it that way, sounds logical.

will it be possible for u to trow in a PR and we will take a look ?

TinyNiko commented 4 years ago

3q I see this

    my_netgear(["rootfs/netgear_r6220/bin/mini_httpd",
                "-d","/www",
                "-r","NETGEAR R6220",
                "-c","**.cgi",
                "-t","300"], 
                "rootfs/netgear_r6220")
xwings commented 4 years ago

Solution accepted. Issue closed.