diff options
| author | Ajax <commial@gmail.com> | 2017-04-24 18:16:47 +0200 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2017-04-24 18:16:47 +0200 |
| commit | 9c8869368ccc7ab6d9cf2edda4739d479056df17 (patch) | |
| tree | f984ba7807e5b1699a46c64019fe618f41c98cde | |
| parent | 7ce0b4f473b2830ccc4d720455ba62c438e973c0 (diff) | |
| download | miasm-9c8869368ccc7ab6d9cf2edda4739d479056df17.tar.gz miasm-9c8869368ccc7ab6d9cf2edda4739d479056df17.zip | |
Remove PYTHONSTARTUP in end-user scripts
| -rw-r--r-- | example/disasm/full.py | 5 | ||||
| -rw-r--r-- | example/expression/simplification_add.py | 5 | ||||
| -rw-r--r-- | example/expression/simplification_tools.py | 5 | ||||
| -rw-r--r-- | example/expression/solve_condition_stp.py | 6 | ||||
| -rw-r--r-- | example/jitter/sandbox_elf_aarch64l.py | 9 | ||||
| -rw-r--r-- | example/jitter/sandbox_pe_x86_32.py | 6 | ||||
| -rw-r--r-- | example/jitter/sandbox_pe_x86_64.py | 6 | ||||
| -rw-r--r-- | example/jitter/unpack_upx.py | 6 | ||||
| -rw-r--r-- | example/jitter/x86_32.py | 6 | ||||
| -rw-r--r-- | test/arch/aarch64/arch.py | 7 | ||||
| -rw-r--r-- | test/arch/arm/arch.py | 5 | ||||
| -rw-r--r-- | test/arch/mips32/arch.py | 9 | ||||
| -rw-r--r-- | test/arch/msp430/arch.py | 6 | ||||
| -rw-r--r-- | test/arch/sh4/arch.py | 6 | ||||
| -rw-r--r-- | test/arch/x86/arch.py | 4 |
15 files changed, 3 insertions, 88 deletions
diff --git a/example/disasm/full.py b/example/disasm/full.py index 33903282..3bfb7658 100644 --- a/example/disasm/full.py +++ b/example/disasm/full.py @@ -1,4 +1,3 @@ -import os import logging from argparse import ArgumentParser from pdb import pm @@ -17,10 +16,6 @@ console_handler.setFormatter(logging.Formatter("%(levelname)-5s: %(message)s")) log.addHandler(console_handler) log.setLevel(logging.INFO) -filename = os.environ.get('PYTHONSTARTUP') -if filename and os.path.isfile(filename): - execfile(filename) - parser = ArgumentParser("Disassemble a binary") parser.add_argument('filename', help="File to disassemble") diff --git a/example/expression/simplification_add.py b/example/expression/simplification_add.py index 06b683fe..41720f3a 100644 --- a/example/expression/simplification_add.py +++ b/example/expression/simplification_add.py @@ -1,11 +1,6 @@ import miasm2.expression.expression as m2_expr from miasm2.expression.simplifications import expr_simp from pdb import pm -import os - -filename = os.environ.get('PYTHONSTARTUP') -if filename and os.path.isfile(filename): - execfile(filename) print """ Expression simplification demo: Adding a simplification: diff --git a/example/expression/simplification_tools.py b/example/expression/simplification_tools.py index 6a4ff715..258b5ce4 100644 --- a/example/expression/simplification_tools.py +++ b/example/expression/simplification_tools.py @@ -1,10 +1,5 @@ from miasm2.expression.expression import * from pdb import pm -import os - -filename = os.environ.get('PYTHONSTARTUP') -if filename and os.path.isfile(filename): - execfile(filename) print """ Expression simplification demo. diff --git a/example/expression/solve_condition_stp.py b/example/expression/solve_condition_stp.py index 0ca17faa..27b0512f 100644 --- a/example/expression/solve_condition_stp.py +++ b/example/expression/solve_condition_stp.py @@ -1,4 +1,3 @@ -import os import sys import subprocess from collections import defaultdict @@ -19,11 +18,6 @@ from miasm2.core import parse_asm from miasm2.arch.x86.disasm import dis_x86_32 as dis_engine -filename = os.environ.get('PYTHONSTARTUP') -if filename and os.path.isfile(filename): - execfile(filename) - - mn = mn_x86 parser = OptionParser(usage="usage: %prog [options] file") diff --git a/example/jitter/sandbox_elf_aarch64l.py b/example/jitter/sandbox_elf_aarch64l.py index 0a4c88db..0f028876 100644 --- a/example/jitter/sandbox_elf_aarch64l.py +++ b/example/jitter/sandbox_elf_aarch64l.py @@ -1,14 +1,7 @@ -import os +import logging from pdb import pm from miasm2.analysis.sandbox import Sandbox_Linux_aarch64l from miasm2.jitter.jitload import log_func -import logging - - -# Python auto completion -filename = os.environ.get('PYTHONSTARTUP') -if filename and os.path.isfile(filename): - execfile(filename) # Insert here user defined methods diff --git a/example/jitter/sandbox_pe_x86_32.py b/example/jitter/sandbox_pe_x86_32.py index 738e0778..3a627b19 100644 --- a/example/jitter/sandbox_pe_x86_32.py +++ b/example/jitter/sandbox_pe_x86_32.py @@ -1,12 +1,6 @@ -import os from pdb import pm from miasm2.analysis.sandbox import Sandbox_Win_x86_32 -# Python auto completion -filename = os.environ.get('PYTHONSTARTUP') -if filename and os.path.isfile(filename): - execfile(filename) - # Insert here user defined methods # Parse arguments diff --git a/example/jitter/sandbox_pe_x86_64.py b/example/jitter/sandbox_pe_x86_64.py index 8d9db88e..773c54b9 100644 --- a/example/jitter/sandbox_pe_x86_64.py +++ b/example/jitter/sandbox_pe_x86_64.py @@ -1,12 +1,6 @@ -import os from pdb import pm from miasm2.analysis.sandbox import Sandbox_Win_x86_64 -# Python auto completion -filename = os.environ.get('PYTHONSTARTUP') -if filename and os.path.isfile(filename): - execfile(filename) - # Insert here user defined methods # Parse arguments diff --git a/example/jitter/unpack_upx.py b/example/jitter/unpack_upx.py index d95c5a18..8160e51b 100644 --- a/example/jitter/unpack_upx.py +++ b/example/jitter/unpack_upx.py @@ -4,12 +4,6 @@ from pdb import pm from elfesteem import pe from miasm2.analysis.sandbox import Sandbox_Win_x86_32 - -filename = os.environ.get('PYTHONSTARTUP') -if filename and os.path.isfile(filename): - execfile(filename) - - # User defined methods def kernel32_GetProcAddress(jitter): diff --git a/example/jitter/x86_32.py b/example/jitter/x86_32.py index 91244bf6..1409d7aa 100644 --- a/example/jitter/x86_32.py +++ b/example/jitter/x86_32.py @@ -1,15 +1,9 @@ -import os from argparse import ArgumentParser from miasm2.jitter.csts import PAGE_READ, PAGE_WRITE from miasm2.analysis.machine import Machine from pdb import pm - -filename = os.environ.get('PYTHONSTARTUP') -if filename and os.path.isfile(filename): - execfile(filename) - parser = ArgumentParser(description="x86 32 basic Jitter") parser.add_argument("filename", help="x86 32 shellcode filename") parser.add_argument("-j", "--jitter", diff --git a/test/arch/aarch64/arch.py b/test/arch/aarch64/arch.py index 4fc9a3c4..ec978024 100644 --- a/test/arch/aarch64/arch.py +++ b/test/arch/aarch64/arch.py @@ -1,12 +1,7 @@ -import os, sys +import sys import time from miasm2.arch.aarch64.arch import * -filename = os.environ.get('PYTHONSTARTUP') -if filename and os.path.isfile(filename): - execfile(filename) - - reg_tests_aarch64 = [ ("XXXXXXXX MOV W1, WZR", "E1031F2A"), diff --git a/test/arch/arm/arch.py b/test/arch/arm/arch.py index d2022238..cb0e56fe 100644 --- a/test/arch/arm/arch.py +++ b/test/arch/arm/arch.py @@ -1,11 +1,6 @@ -import os import time from miasm2.arch.arm.arch import * -filename = os.environ.get('PYTHONSTARTUP') -if filename and os.path.isfile(filename): - execfile(filename) - if 0: a = bs('00') b = bs('01') diff --git a/test/arch/mips32/arch.py b/test/arch/mips32/arch.py index 0fb12e1b..ef89b279 100644 --- a/test/arch/mips32/arch.py +++ b/test/arch/mips32/arch.py @@ -1,17 +1,10 @@ -import os, sys +import sys import time from pdb import pm sys.path.append('/home/serpilliere/projet/m2_devel') from miasm2.arch.mips32.arch import * -import sys - - -filename = os.environ.get('PYTHONSTARTUP') -if filename and os.path.isfile(filename): - execfile(filename) - reg_tests_mips32 = [ ("004496D8 ADDU GP, GP, T9", diff --git a/test/arch/msp430/arch.py b/test/arch/msp430/arch.py index 613af385..b3dbac82 100644 --- a/test/arch/msp430/arch.py +++ b/test/arch/msp430/arch.py @@ -1,12 +1,6 @@ - -import os import time from miasm2.arch.msp430.arch import * -filename = os.environ.get('PYTHONSTARTUP') -if filename and os.path.isfile(filename): - execfile(filename) - def h2i(s): return s.replace(' ', '').decode('hex') diff --git a/test/arch/sh4/arch.py b/test/arch/sh4/arch.py index b7e79d30..7d3d890e 100644 --- a/test/arch/sh4/arch.py +++ b/test/arch/sh4/arch.py @@ -1,13 +1,7 @@ -import os import time from sys import stderr from miasm2.arch.sh4.arch import * -filename = os.environ.get('PYTHONSTARTUP') -if filename and os.path.isfile(filename): - execfile(filename) - - def h2i(s): return s.replace(' ', '').decode('hex') diff --git a/test/arch/x86/arch.py b/test/arch/x86/arch.py index 83039368..72884f7e 100644 --- a/test/arch/x86/arch.py +++ b/test/arch/x86/arch.py @@ -1,4 +1,3 @@ -import os import time import miasm2.expression.expression as m2_expr from miasm2.arch.x86.arch import mn_x86, deref_mem_ad, ParseAst, ast_int2expr, \ @@ -6,9 +5,6 @@ from miasm2.arch.x86.arch import mn_x86, deref_mem_ad, ParseAst, ast_int2expr, \ from miasm2.arch.x86.sem import ir_x86_16, ir_x86_32, ir_x86_64 from miasm2.core.bin_stream import bin_stream_str -filename = os.environ.get('PYTHONSTARTUP') -if filename and os.path.isfile(filename): - execfile(filename) for s in ["[EAX]", "[0x10]", "[EBX + 0x10]", |