mirror of https://github.com/pwndbg/pwndbg
Use pwnlib.util.misc.which instead of gdblib.which.which (#1584)
This commit is contained in:
parent
c33c18c374
commit
871a440a50
|
@ -1,5 +0,0 @@
|
|||
:mod:`pwndbg.lib.which` --- pwndbg.lib.which
|
||||
=============================================
|
||||
|
||||
.. automodule:: pwndbg.lib.which
|
||||
:members:
|
|
@ -1,5 +1,4 @@
|
|||
import pwndbg.commands
|
||||
import pwndbg.lib.which
|
||||
import pwndbg.wrappers.checksec
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import pwndbg.chain
|
|||
import pwndbg.commands
|
||||
import pwndbg.enhance
|
||||
import pwndbg.gdblib.file
|
||||
import pwndbg.lib.which
|
||||
import pwndbg.wrappers.checksec
|
||||
import pwndbg.wrappers.readelf
|
||||
from pwndbg.color import message
|
||||
|
|
|
@ -8,7 +8,6 @@ import pwndbg.chain
|
|||
import pwndbg.commands
|
||||
import pwndbg.enhance
|
||||
import pwndbg.gdblib.file
|
||||
import pwndbg.lib.which
|
||||
import pwndbg.wrappers.checksec
|
||||
import pwndbg.wrappers.readelf
|
||||
from pwndbg.commands import CommandCategory
|
||||
|
|
|
@ -4,8 +4,9 @@ Wrapper for shell commands.
|
|||
|
||||
import os
|
||||
|
||||
from pwnlib.util.misc import which
|
||||
|
||||
import pwndbg.commands
|
||||
import pwndbg.lib.which
|
||||
from pwndbg.commands import CommandCategory
|
||||
|
||||
pwncmd_names = ["asm", "constgrep", "disasm", "pwn", "unhex"]
|
||||
|
@ -61,8 +62,8 @@ shellcmd_names = [
|
|||
"zsh",
|
||||
]
|
||||
|
||||
pwncmds = list(filter(pwndbg.lib.which.which, pwncmd_names))
|
||||
shellcmds = list(filter(pwndbg.lib.which.which, shellcmd_names))
|
||||
pwncmds = list(filter(which, pwncmd_names))
|
||||
shellcmds = list(filter(which, shellcmd_names))
|
||||
|
||||
|
||||
def register_shell_function(cmd, deprecated=False) -> None:
|
||||
|
|
|
@ -2,8 +2,9 @@ import functools
|
|||
import subprocess
|
||||
from subprocess import STDOUT
|
||||
|
||||
from pwnlib.util.misc import which
|
||||
|
||||
import pwndbg.commands
|
||||
import pwndbg.lib.which
|
||||
|
||||
|
||||
class OnlyWithCommand:
|
||||
|
@ -11,7 +12,7 @@ class OnlyWithCommand:
|
|||
self.all_cmds = list(map(lambda cmd: cmd[0] if isinstance(cmd, list) else cmd, commands))
|
||||
for command in commands:
|
||||
self.cmd = command if isinstance(command, list) else [command]
|
||||
self.cmd_path = pwndbg.lib.which.which(self.cmd[0])
|
||||
self.cmd_path = which(self.cmd[0])
|
||||
if self.cmd_path:
|
||||
break
|
||||
|
||||
|
|
Loading…
Reference in New Issue