support multi command
This commit is contained in:
@@ -1070,7 +1070,7 @@ Examples:
|
|||||||
loader.close()
|
loader.close()
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
elif args.write:
|
if args.write:
|
||||||
command_executed = True
|
command_executed = True
|
||||||
try:
|
try:
|
||||||
addr = int(args.write[0], 0)
|
addr = int(args.write[0], 0)
|
||||||
@@ -1096,18 +1096,7 @@ Examples:
|
|||||||
loader.close()
|
loader.close()
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
elif args.go:
|
if args.exec:
|
||||||
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:
|
|
||||||
command_executed = True
|
command_executed = True
|
||||||
try:
|
try:
|
||||||
addr = 0
|
addr = 0
|
||||||
@@ -1124,6 +1113,17 @@ Examples:
|
|||||||
loader.close()
|
loader.close()
|
||||||
return 1
|
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 no command specified or need to enter interactive mode
|
||||||
if not command_executed or args.interactive:
|
if not command_executed or args.interactive:
|
||||||
loader.interactive_mode()
|
loader.interactive_mode()
|
||||||
|
|||||||
Reference in New Issue
Block a user