aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2021-08-05 05:14:10 +0000
committerterminaldweller <thabogre@gmail.com>2021-08-05 05:14:10 +0000
commit5f596a3f401a0a40eefcc0f8b6c6b5083748cc1a (patch)
treea892e31077574f1c1a340af257bb6e27ae0ad89c /bin
parentupdate for neomutt (diff)
downloadscripts-5f596a3f401a0a40eefcc0f8b6c6b5083748cc1a.tar.gz
scripts-5f596a3f401a0a40eefcc0f8b6c6b5083748cc1a.zip
a lot of updates and fixes
Diffstat (limited to 'bin')
l---------bin/delf2
-rwxr-xr-xbin/disasm17
2 files changed, 14 insertions, 5 deletions
diff --git a/bin/delf b/bin/delf
index 090f766..b90158c 120000
--- a/bin/delf
+++ b/bin/delf
@@ -1 +1 @@
-/home/devi/delf/delf.py \ No newline at end of file
+/home/devi/devi/delf.git/master/delf.py \ No newline at end of file
diff --git a/bin/disasm b/bin/disasm
index 47cd4d6..30d237d 100755
--- a/bin/disasm
+++ b/bin/disasm
@@ -8,31 +8,39 @@ import sys
from capstone import *
from capstone.x86 import *
+
def SigHandler_SIGINT(signum, frame):
print()
sys.exit(0)
+
class Argparser(object):
def __init__(self):
parser = argparse.ArgumentParser()
parser.add_argument("--hex", type=str, help="the hex code")
parser.add_argument("--sp", type=str, help="separator")
- parser.add_argument("--dbg", action="store_true", help="debug", default=False)
+ parser.add_argument("--dbg", action="store_true",
+ help="debug", default=False)
self.args = parser.parse_args()
# write code here
+
+
def premain(argparser):
signal.signal(signal.SIGINT, SigHandler_SIGINT)
- #here
+ # here
code = bytes()
if argparser.args.hex:
- if argparser.args.sp: hex_str = argparser.args.hex.split(argparser.args.sp)
- else: hex_str = argparser.args.hex.split(" ")
+ if argparser.args.sp:
+ hex_str = argparser.args.hex.split(argparser.args.sp)
+ else:
+ hex_str = argparser.args.hex.split(" ")
code = [int(byte, 16) for byte in hex_str]
md = Cs(CS_ARCH_X86, CS_MODE_64)
for i in md.disasm(bytes(code), 0x0):
print(hex(i.address).ljust(7), i.mnemonic.ljust(7), i.op_str)
+
def main():
argparser = Argparser()
if argparser.args.dbg:
@@ -46,5 +54,6 @@ def main():
else:
premain(argparser)
+
if __name__ == "__main__":
main()