Skip to content

Commit

Permalink
change arg value computation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jubeaz committed May 25, 2024
1 parent 77b8c0f commit 1962925
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions arsenal/modules/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,17 @@ def compute_args(self, cheat, gvars):
# Variable has been added to cheat variables before, remove it
cheat.command = cheat.command.replace(arg_name, name)
self.cmdline = cheat.command
elif arg_name in gvars:
self._add_arg(arg_name, gvars[arg_name], position)
elif arg_name in cheat.variables:
self._add_arg(arg_name, cheat.variables[arg_name], position)
else:
self._add_arg(arg_name, "", position)
# compute values
for arg_name in self.args:
if arg_name in gvars:
self.args[arg_name]["value"] = gvars[arg_name]
elif arg_name in cheat.variables:
self.args[arg_name]["value"] = cheat.variables[arg_name]
else:
continue
print("toto")

def _add_arg(self, name=None, value="", position=0):
if name in self.args:
Expand Down

0 comments on commit 1962925

Please sign in to comment.