support multi command
This commit is contained in:
@@ -1070,7 +1070,7 @@ Examples:
|
||||
loader.close()
|
||||
return 1
|
||||
|
||||
elif args.write:
|
||||
if args.write:
|
||||
command_executed = True
|
||||
try:
|
||||
addr = int(args.write[0], 0)
|
||||
@@ -1096,18 +1096,7 @@ Examples:
|
||||
loader.close()
|
||||
return 1
|
||||
|
||||
elif args.go:
|
||||
command_executed = True
|
||||
try:
|
||||
addr = int(args.go, 0)
|
||||
if loader.go_execute(addr):
|
||||
print(f"[INFO] Sent jump to 0x{addr:04X} command")
|
||||
except Exception as e:
|
||||
print(f"[ERROR] Jump failed: {e}")
|
||||
loader.close()
|
||||
return 1
|
||||
|
||||
elif args.exec:
|
||||
if args.exec:
|
||||
command_executed = True
|
||||
try:
|
||||
addr = 0
|
||||
@@ -1124,6 +1113,17 @@ Examples:
|
||||
loader.close()
|
||||
return 1
|
||||
|
||||
if args.go:
|
||||
command_executed = True
|
||||
try:
|
||||
addr = int(args.go, 0)
|
||||
if loader.go_execute(addr):
|
||||
print(f"[INFO] Sent jump to 0x{addr:04X} command")
|
||||
except Exception as e:
|
||||
print(f"[ERROR] Jump failed: {e}")
|
||||
loader.close()
|
||||
return 1
|
||||
|
||||
# If no command specified or need to enter interactive mode
|
||||
if not command_executed or args.interactive:
|
||||
loader.interactive_mode()
|
||||
|
||||
Reference in New Issue
Block a user