Commit Graph

47 Commits

Author SHA1 Message Date
Camille Mougey 9303454bbf Core: Introduce BoundedDict and its regression test 2015-02-23 17:54:59 +01:00
Camille Mougey e520a0c5ef DiGraph: Inherite DiGraph from object 2015-02-20 15:20:39 +01:00
Camille Mougey a2e461cc51 PyLint: Remove keyword redefinition, bad open mode 2015-02-18 20:42:54 +01:00
Camille Mougey d7b6cd2f8a Core: General PyLinting 2015-02-18 15:49:36 +01:00
Camille Mougey 3721f1f0cc Core/Interval: interval.cannon_list should be a staticmethod 2015-02-18 15:49:36 +01:00
Camille Mougey 965dca50ea Core/Interval: Add comments 2015-02-18 15:49:36 +01:00
Camille Mougey 797e95f538 Core/Interval: PyLint pass 2015-02-18 15:49:36 +01:00
Camille Mougey fae4d7fca6 Core/CPU: Pylint pass, remove commented code (SCM or log.debug should be used) 2015-02-18 15:49:36 +01:00
Camille Mougey 1a4d3a0c58 Core/ParseASM: Remove some warning
|invalid-name               |1           |
+---------------------------+------------+
|undefined-loop-variable    |5           |
+---------------------------+------------+
|unused-variable            |4           |
+---------------------------+------------+
|unused-import              |1           |
+---------------------------+------------+
|deprecated-lambda          |1           |
+---------------------------+------------+
|bad-builtin                |1           |
2015-02-18 15:49:36 +01:00
Camille Mougey 86e9499be5 Core/ParseASM: Remove wildcard import and too long lines 2015-02-18 15:49:36 +01:00
Camille Mougey 0fcd954e10 PyLint: Unreachable code 2015-02-16 16:40:19 +01:00
Camille Mougey f6ba0b1b60 PyLint: remove 'unnecessary-lambda' 2015-02-16 16:25:46 +01:00
Camille Mougey c4a5c9ecb0 PyLint: Remove relative imports
miasm2/jitter/jitload.py:17: [W0403(relative-import), ] Relative import 'jitcore_tcc', should be 'miasm2.jitter.jitcore_tcc'
miasm2/jitter/jitload.py:22: [W0403(relative-import), ] Relative import 'jitcore_llvm', should be 'miasm2.jitter.jitcore_llvm'
miasm2/jitter/jitload.py:27: [W0403(relative-import), ] Relative import 'jitcore_python', should be 'miasm2.jitter.jitcore_python'
miasm2/jitter/jitcore.py:20: [W0403(relative-import), ] Relative import 'csts', should be 'miasm2.jitter.csts'
miasm2/jitter/jitcore_tcc.py:7: [W0403(relative-import), ] Relative import 'jitcore', should be 'miasm2.jitter.jitcore'
miasm2/jitter/jitcore_llvm.py:4: [W0403(relative-import), ] Relative import 'llvmconvert', should be 'miasm2.jitter.llvmconvert'
miasm2/jitter/jitcore_llvm.py:5: [W0403(relative-import), ] Relative import 'jitcore', should be 'miasm2.jitter.jitcore'
miasm2/jitter/loader/elf.py:7: [W0403(relative-import), ] Relative import 'utils', should be 'miasm2.jitter.loader.utils'
miasm2/core/cpu.py:11: [W0403(relative-import), ] Relative import 'bin_stream', should be 'miasm2.core.bin_stream'
miasm2/core/cpu.py:12: [W0403(relative-import), ] Relative import 'utils', should be 'miasm2.core.utils'
miasm2/arch/sh4/arch.py:9: [W0403(relative-import), ] Relative import 'regs', should be 'miasm2.arch.sh4.regs'
miasm2/arch/msp430/sem.py:8: [W0403(relative-import), ] Relative import 'regs', should be 'miasm2.arch.msp430.regs'
miasm2/arch/msp430/arch.py:10: [W0403(relative-import), ] Relative import 'regs', should be 'miasm2.arch.msp430.regs'
miasm2/arch/msp430/arch.py:11: [W0403(relative-import), ] Relative import 'regs', should be 'miasm2.arch.msp430.regs'
miasm2/arch/msp430/disasm.py:2: [W0403(relative-import), ] Relative import 'arch', should be 'miasm2.arch.msp430.arch'
miasm2/arch/arm/arch.py:10: [W0403(relative-import), ] Relative import 'regs', should be 'miasm2.arch.arm.regs'
miasm2/arch/arm/arch.py:11: [W0403(relative-import), ] Relative import 'regs', should be 'miasm2.arch.arm.regs'
miasm2/arch/arm/disasm.py:2: [W0403(relative-import), ] Relative import 'arch', should be 'miasm2.arch.arm.arch'
miasm2/arch/x86/sem.py:26: [W0403(relative-import), ] Relative import 'regs', should be 'miasm2.arch.x86.regs'
miasm2/arch/x86/arch.py:9: [W0403(relative-import), ] Relative import 'regs', should be 'miasm2.arch.x86.regs'
miasm2/arch/x86/arch.py:10: [W0403(relative-import), ] Relative import 'regs', should be 'miasm2.arch.x86.regs'
miasm2/arch/x86/disasm.py:3: [W0403(relative-import), ] Relative import 'arch', should be 'miasm2.arch.x86.arch'
miasm2/arch/mips32/arch.py:10: [W0403(relative-import), ] Relative import 'regs', should be 'miasm2.arch.mips32.regs'
miasm2/arch/mips32/arch.py:11: [W0403(relative-import), ] Relative import 'regs', should be 'miasm2.arch.mips32.regs'
miasm2/arch/mips32/disasm.py:2: [W0403(relative-import), ] Relative import 'arch', should be 'miasm2.arch.mips32.arch'
2015-02-16 12:48:11 +01:00
Camille Mougey 8d581fe43c PyLint: Remove unused-imports
miasm2/jitter/jitload.py:4: [W0611(unused-import), ] Unused import asmbloc
miasm2/jitter/jitload.py:3: [W0611(unused-import), ] Unused import os
miasm2/jitter/loader/elf.py:4: [W0611(unused-import), ] Unused import pe
miasm2/ir/ir.py:27: [W0611(unused-import), ] Unused import DiGraph
miasm2/ir/translators/z3_ir.py:6: [W0611(unused-import), ] Unused import m2_expr
miasm2/core/parse_asm.py:5: [W0611(unused-import), ] Unused import struct
miasm2/analysis/sandbox.py:8: [W0611(unused-import), ] Unused import libimp
miasm2/analysis/sandbox.py:1: [W0611(unused-import), ] Unused import os
miasm2/analysis/sandbox.py:5: [W0611(unused-import), ] Unused import win_api_x86_32
miasm2/analysis/sandbox.py:1: [W0611(unused-import), ] Unused import sys
miasm2/expression/simplifications_cond.py:17: [W0611(unused-import), ] Unused import itertools
miasm2/arch/arm/arch.py:5: [W0611(unused-import), ] Unused import pm
miasm2/arch/x86/sem.py:23: [W0611(unused-import), ] Unused import expr_is_int_or_label
miasm2/arch/mips32/arch.py:12: [W0611(unused-import), ] Unused import pm
miasm2/arch/mips32/disasm.py:1: [W0611(unused-import), ] Unused import asm_constraint
2015-02-16 12:21:18 +01:00
Fabrice Desclaux f68d21f7d8 bin_stream: Fix default argument for bin_stream_container 2015-02-11 13:45:56 +01:00
Fabrice Desclaux 598f3609bd CPU: update api to handle IOError during disasm 2015-02-11 13:27:14 +01:00
Fabrice Desclaux 74cc70d786 bin_stream: clean code and update API
The __len__ cannot be used any more in bin_stream: Python returns an int object,
which will cap values to 0x7FFFFFFF on 32 bit systems. A binary can have a base
address higher than this, making it impossible to handle such programs.

The __len__ is replaced by a call to getlen.

Elfesteem needs an update to support 'max_addr' API in order to retrieve the
elf/pe max virtual address.
2015-02-11 13:27:14 +01:00
Camille Mougey cc48c13591 Core/ASMBloc: bloc_merge's symbol_pool arg was unused 2015-01-26 14:11:31 +01:00
Camille Mougey 2e342d6f79 Core/ASMBloc: asm_resolve_final's constrain_pos arg was unused 2015-01-26 11:26:32 +01:00
Camille Mougey 5eb379bf87 Core/ASMBloc: guessèblocs_size's symbol arg was unused 2015-01-26 11:22:34 +01:00
Camille Mougey d80cb039e9 Core/ASMBloc: dis_bloc's patch_instr_symb was no more used 2015-01-26 11:18:58 +01:00
Camille Mougey 441c3eb7ef Core/ASMBloc: resolve_symbol now returns only the resolved blocs 2015-01-26 11:08:50 +01:00
Camille Mougey d1ea12c319 Core/ASMBloc: Linting 2015-01-26 10:50:41 +01:00
Fabrice Desclaux 472ff71aa6 Graph: add dominators computation 2015-01-18 22:58:38 +01:00
Fabrice Desclaux 48581006f5 Add docstring/Fix variable name 2015-01-09 15:34:52 +01:00
Fabrice Desclaux a4ff9d4348 Graph: Add get_all_parents/del_node 2015-01-09 14:28:51 +01:00
Camille Mougey 8ba608cba2 BinStream: Unify BinStreams location 2014-12-03 22:29:33 +01:00
Fabrice Desclaux 32156a81bd Add IDA bin_stream 2014-12-03 10:44:30 +01:00
Fabrice Desclaux 2f4d1bf249 asmbloc: remove un needed mode in asm function 2014-10-08 17:59:45 +02:00
Fabrice Desclaux 87ff6f167d Asmbloc: fix bloc2graph tipo (tx to Jerome Marty) 2014-10-02 14:51:13 +02:00
Fabrice Desclaux 56161aa090 core/cpu: move bs8 2014-09-11 13:02:15 +02:00
Fabrice Desclaux 6e09df71a3 Modify irbloc destination mecanism. Rework API in consequence.
Fat patch here: some API have changed.

Each irbloc now affects a special "IRDst" register which is used to
describe the destination irbloc. It allows simple description of
architectures using delay slots. Architectures semantic and tcc/python
jitter are modified in consequence. LLVM jitter is disabled for now,
but should be patch soon.
2014-09-05 11:30:05 +02:00
serpilliere cc2b6e079a jit: move code into arch directory 2014-08-21 11:09:24 +02:00
serpilliere b8ef731f42 Core: getbits use arch attrib (and can swap bytes); getbytes simply return bytes 2014-08-21 09:23:53 +02:00
serpilliere 495970a6c5 bin_stream: fix bin_stream len test 2014-08-21 09:03:46 +02:00
serpilliere 376576de29 Add mips32 arch 2014-08-06 17:28:13 +02:00
serpilliere db8c7152ac cpu/arch: arg2str moved in instruction class 2014-08-05 11:03:56 +02:00
serpilliere 8bcd580948 Arch: remove debug output 2014-07-10 13:22:11 +02:00
serpilliere 92d3b2d51d Core/parse: allow the use of labels in data declaration
Ex:
toto:
.long main - toto
.long main ^ toto + 2
2014-07-09 11:17:36 +02:00
serpilliere 1f5c7d7fa7 Utils: missing pack struct 2014-07-09 11:09:39 +02:00
serpilliere 6abe57ac02 Core: $ symbol can be customized for relative offset tricks
For exemple, in arm:
LDR R1, [PC, label-$]
Here, $ will be replaced by label - (offset + 8)
So R1 will be loaded by dword at address label
2014-07-03 10:30:46 +02:00
serpilliere b22dcfbca8 cpu: continue remove some lambda (to allow pickling) 2014-06-25 15:07:51 +02:00
serpilliere 9b11210e07 bin_stream: wrap is_addr_in to allow bs pickling 2014-06-25 14:24:48 +02:00
serpilliere 259dcc7ee8 Cpu: remove unsused var; dis/fromstring default attrib is none 2014-06-25 14:21:32 +02:00
serpilliere 664d190659 Asmbloc: fix get_flow_instr for non zero delayslot arch 2014-06-24 15:07:38 +02:00
serpilliere f328270d56 Cpu: bs_mod_name accept dict 2014-06-24 15:06:26 +02:00
serpilliere ed5c3668cc Miasm v2
* API has changed, so old scripts need updates
* See example for API usage
* Use tcc or llvm for jit emulation
* Go to test and run test_all.py to check install

Enjoy !
2014-06-03 10:27:56 +02:00