sashs / Ropper

Display information about files in different file formats and find gadgets to build rop chains for different architectures (x86/x86_64, ARM/ARM64, MIPS, PowerPC, SPARC64). For disassembly ropper uses the awesome Capstone Framework.
https://scoding.de/ropper
BSD 3-Clause "New" or "Revised" License
1.87k stars 206 forks source link

Create .travis.yml #105

Closed XVilka closed 5 years ago

XVilka commented 5 years ago

Initial draft to address https://github.com/sashs/Ropper/issues/104

It requires to create requirements.txt though

XVilka commented 5 years ago

Ok, I added requirements.txt and fixed the sample. And it builds, but there are some failing tests, it is out of the scope of this PR though, it will be easier to fix the tests anyway, once the PR is merged: See my fork build for this branch: https://travis-ci.org/XVilka/Ropper/builds/562937313

[LOAD] removing double gadgets... 100%
[ERROR] Architecture is not supported: invalid
Supported architectures are: x86, x86_64, MIPS, MIPS64, ARM, ARMTHUMB, ARM64, PPC, PPC64, SPARC64
...
[INFO] Filter gadgets
[ERROR] length of badbytes has to be even
[INFO] Filter gadgets
[ERROR] color has to be an instance of bool
[ERROR] detailed has to be an instance of bool
...
XVilka commented 5 years ago

Also note the ton of the complaints by flake8. You can fix most of them with autopep8 tool automatically.

./sample.py:5:19: E203 whitespace before ':'
./sample.py:6:13: E127 continuation line over-indented for visual indent
./sample.py:7:18: E203 whitespace before ':'
./sample.py:8:25: E203 whitespace before ':'
./sample.py:9:19: E203 whitespace before ':'
./sample.py:10:23: E203 whitespace before ':'
./sample.py:10:32: E261 at least two spaces before inline comment
./sample.py:14:1: E266 too many leading '#' for block comment
./sample.py:21:1: E266 too many leading '#' for block comment
./sample.py:24:51: E231 missing whitespace after ','
./sample.py:24:65: E261 at least two spaces before inline comment
./sample.py:25:55: E231 missing whitespace after ','
./sample.py:27:1: E266 too many leading '#' for block comment
./sample.py:49:1: E266 too many leading '#' for block comment
./sample.py:52:20: W291 trailing whitespace
./sample.py:60:20: W291 trailing whitespace
./sample.py:63:20: W291 trailing whitespace
./sample.py:67:20: W291 trailing whitespace
./sample.py:69:1: E266 too many leading '#' for block comment
./sample.py:70:21: E261 at least two spaces before inline comment
./sample.py:73:1: E266 too many leading '#' for block comment
./sample.py:77:1: E266 too many leading '#' for block comment
./sample.py:78:35: E261 at least two spaces before inline comment
./sample.py:84:1: E266 too many leading '#' for block comment
./sample.py:85:57: E261 at least two spaces before inline comment
./sample.py:93:1: E266 too many leading '#' for block comment
./sample.py:103:1: E266 too many leading '#' for block comment
./sample.py:117:1: E266 too many leading '#' for block comment
./sample.py:127:1: E266 too many leading '#' for block comment
./test.py:1:1: F403 'from testcases.test_general import *' used; unable to detect undefined names
./test.py:1:1: F401 'testcases.test_general.*' imported but unused
./test.py:2:1: F403 'from testcases.test_x86_64 import *' used; unable to detect undefined names
./test.py:2:1: F401 'testcases.test_x86_64.*' imported but unused
./test.py:3:1: F403 'from testcases.test_x86 import *' used; unable to detect undefined names
./test.py:3:1: F401 'testcases.test_x86.*' imported but unused
./test.py:4:1: F403 'from testcases.test_arm import *' used; unable to detect undefined names
./test.py:4:1: F401 'testcases.test_arm.*' imported but unused
./test.py:5:1: F403 'from testcases.test_arm64 import *' used; unable to detect undefined names
./test.py:5:1: F401 'testcases.test_arm64.*' imported but unused
./test.py:6:1: F403 'from testcases.test_mips import *' used; unable to detect undefined names
./test.py:6:1: F401 'testcases.test_mips.*' imported but unused
./test.py:7:1: F403 'from testcases.test_ppc import *' used; unable to detect undefined names
./test.py:7:1: F401 'testcases.test_ppc.*' imported but unused
./test.py:8:1: F403 'from testcases.test_console import *' used; unable to detect undefined names
./test.py:8:1: F401 'testcases.test_console.*' imported but unused
./Ropper.py:24:1: E402 module level import not at top of file
./setup.py:22:1: E722 do not use bare 'except'
./ropper/service.py:30:1: F401 'ropper.common.utils.getFileNameFromPath' imported but unused
./ropper/service.py:31:1: F401 'ropper.common.coloredstring.Color' imported but unused
./ropper/service.py:40:1: F401 'ropper.semantic.SemanticInformation' imported but unused
./ropper/service.py:41:1: F401 'tempfile' imported but unused
./ropper/service.py:47:1: E302 expected 2 blank lines, found 1
./ropper/service.py:53:10: E231 missing whitespace after ','
./ropper/service.py:65:1: C901 'filterBadBytes' is too complex (16)
./ropper/service.py:73:9: E722 do not use bare 'except'
./ropper/service.py:89:18: E231 missing whitespace after ','
./ropper/service.py:112:38: E231 missing whitespace after ','
./ropper/service.py:164:5: C901 'Options.__checkOptions' is too complex (22)
./ropper/service.py:177:18: E711 comparison to None should be 'if cond is not None:'
./ropper/service.py:179:20: E711 comparison to None should be 'if cond is None:'
./ropper/service.py:193:16: E711 comparison to None should be 'if cond is not None:'
./ropper/service.py:195:18: E711 comparison to None should be 'if cond is None:'
./ropper/service.py:207:21: E711 comparison to None should be 'if cond is not None:'
./ropper/service.py:209:23: E711 comparison to None should be 'if cond is None:'
./ropper/service.py:213:21: E711 comparison to None should be 'if cond is not None:'
./ropper/service.py:215:23: E711 comparison to None should be 'if cond is None:'
./ropper/service.py:219:30: E711 comparison to None should be 'if cond is not None:'
./ropper/service.py:221:32: E711 comparison to None should be 'if cond is None:'
./ropper/service.py:239:37: E231 missing whitespace after ':'
./ropper/service.py:308:44: E225 missing whitespace around operator
./ropper/service.py:316:97: E231 missing whitespace after ','
./ropper/service.py:316:128: E501 line too long (144 > 127 characters)
./ropper/service.py:336:55: E231 missing whitespace after ','
./ropper/service.py:337:69: E231 missing whitespace after ','
./ropper/service.py:340:53: E231 missing whitespace after ','
./ropper/service.py:341:65: E231 missing whitespace after ','
./ropper/service.py:344:33: E231 missing whitespace after ','
./ropper/service.py:345:69: E231 missing whitespace after ','
./ropper/service.py:354:5: E303 too many blank lines (2)
./ropper/service.py:355:9: F841 local variable 'nan' is assigned to but never used
./ropper/service.py:355:12: E225 missing whitespace around operator
./ropper/service.py:362:40: E231 missing whitespace after ','
./ropper/service.py:364:48: E231 missing whitespace after ','
./ropper/service.py:370:5: E303 too many blank lines (2)
./ropper/service.py:370:5: C901 'RopperService.__loadCache' is too complex (29)
./ropper/service.py:372:9: F841 local variable 'nan' is assigned to but never used
./ropper/service.py:372:12: E225 missing whitespace around operator
./ropper/service.py:386:62: E225 missing whitespace around operator
./ropper/service.py:392:25: E117 over-indented
./ropper/service.py:396:41: E231 missing whitespace after ','
./ropper/service.py:398:60: E231 missing whitespace after ','
./ropper/service.py:402:37: E231 missing whitespace after ','
./ropper/service.py:404:59: E231 missing whitespace after ','
./ropper/service.py:406:68: E231 missing whitespace after ','
./ropper/service.py:408:128: E501 line too long (137 > 127 characters)
./ropper/service.py:412:56: E231 missing whitespace after ','
./ropper/service.py:416:33: E231 missing whitespace after ','
./ropper/service.py:420:22: E225 missing whitespace around operator
./ropper/service.py:439:9: F841 local variable 'e' is assigned to but never used
./ropper/service.py:445:33: E231 missing whitespace after ','
./ropper/service.py:450:5: E303 too many blank lines (2)
./ropper/service.py:495:5: E303 too many blank lines (2)
./ropper/service.py:503:17: E225 missing whitespace around operator
./ropper/service.py:517:38: E225 missing whitespace around operator
./ropper/service.py:517:74: E225 missing whitespace around operator
./ropper/service.py:538:40: E231 missing whitespace after ','
./ropper/service.py:590:14: E231 missing whitespace after ','
./ropper/service.py:595:14: E111 indentation is not a multiple of four
./ropper/service.py:595:14: E117 over-indented
./ropper/service.py:599:5: C901 'RopperService.loadGadgetsFor' is too complex (12)
./ropper/service.py:614:29: E711 comparison to None should be 'if cond is None:'
./ropper/service.py:622:13: E265 block comment should start with '# '
./ropper/service.py:625:9: E303 too many blank lines (2)
./ropper/service.py:659:44: E261 at least two spaces before inline comment
./ropper/service.py:663:73: E711 comparison to None should be 'if cond is not None:'
./ropper/service.py:664:33: E201 whitespace after '('
./ropper/service.py:664:56: E203 whitespace before ','
./ropper/service.py:687:21: E117 over-indented
./ropper/service.py:723:13: E741 ambiguous variable name 'l'
./ropper/service.py:725:17: E741 ambiguous variable name 'l'
./ropper/service.py:736:23: E271 multiple spaces after keyword
./ropper/service.py:741:17: E303 too many blank lines (2)
./ropper/service.py:741:128: E501 line too long (130 > 127 characters)
./ropper/service.py:764:128: E501 line too long (174 > 127 characters)
./ropper/service.py:794:1: E303 too many blank lines (3)
./ropper/search.py:31:5: F401 'archinfo' imported but unused
./ropper/search.py:32:5: F401 'pyvex' imported but unused
./ropper/search.py:33:1: E722 do not use bare 'except'
./ropper/search.py:38:1: F401 'ropper.gadget.Category' imported but unused
./ropper/search.py:39:1: F401 'ropper.semantic.Analyser' imported but unused
./ropper/search.py:39:1: F401 'ropper.semantic.create_register_expression' imported but unused
./ropper/search.py:39:1: F401 'ropper.semantic.create_number_expression' imported but unused
./ropper/search.py:40:1: F401 'time' imported but unused
./ropper/search.py:41:1: F401 'sys' imported but unused
./ropper/search.py:46:26: W605 invalid escape sequence '\['
./ropper/search.py:46:41: W605 invalid escape sequence '\]'
./ropper/search.py:46:47: W605 invalid escape sequence '\+'
./ropper/search.py:46:49: W605 invalid escape sequence '\*'
./ropper/search.py:46:51: W605 invalid escape sequence '\-'
./ropper/search.py:46:60: W605 invalid escape sequence '\['
./ropper/search.py:46:75: W605 invalid escape sequence '\]'
./ropper/search.py:49:37: E231 missing whitespace after ','
./ropper/search.py:50:36: E231 missing whitespace after ','
./ropper/search.py:51:36: E231 missing whitespace after ','
./ropper/search.py:52:36: E231 missing whitespace after ','
./ropper/search.py:53:36: E231 missing whitespace after ','
./ropper/search.py:54:36: E231 missing whitespace after ','
./ropper/search.py:55:36: E231 missing whitespace after ','
./ropper/search.py:56:36: E231 missing whitespace after ','
./ropper/search.py:57:36: E231 missing whitespace after ','
./ropper/search.py:80:36: E231 missing whitespace after ','
./ropper/search.py:81:36: E231 missing whitespace after ','
./ropper/search.py:83:36: E231 missing whitespace after ','
./ropper/search.py:84:36: E231 missing whitespace after ','
./ropper/search.py:89:35: E231 missing whitespace after ','
./ropper/search.py:106:9: F841 local variable 'clobber_reg' is assigned to but never used
./ropper/search.py:112:5: C901 'Searcher.semanticSearch' is too complex (14)
./ropper/search.py:112:58: E203 whitespace before ','
./ropper/search.py:112:59: E231 missing whitespace after ','
./ropper/search.py:121:9: F841 local variable 'to_return' is assigned to but never used
./ropper/search.py:123:9: F841 local variable 'max_count' is assigned to but never used
./ropper/search.py:137:17: E265 block comment should start with '# '
./ropper/search.py:142:17: E122 continuation line missing indentation or outdented
./ropper/search.py:143:17: E122 continuation line missing indentation or outdented
./ropper/search.py:147:21: F841 local variable 'set_reg' is assigned to but never used
./ropper/search.py:148:21: F841 local variable 'slice_instructions' is assigned to but never used
./ropper/search.py:153:21: F841 local variable 'expr_len' is assigned to but never used
./ropper/search.py:155:21: F841 local variable 'tmp' is assigned to but never used
./ropper/search.py:158:24: E114 indentation is not a multiple of four (comment)
./ropper/search.py:159:24: E114 indentation is not a multiple of four (comment)
./ropper/search.py:160:24: E114 indentation is not a multiple of four (comment)
./ropper/search.py:169:25: F841 local variable 'found' is assigned to but never used
./ropper/search.py:184:5: E303 too many blank lines (2)
./ropper/search.py:184:46: E251 unexpected spaces around keyword / parameter equals
./ropper/search.py:184:48: E251 unexpected spaces around keyword / parameter equals
./ropper/search.py:186:9: F841 local variable 'filtered' is assigned to but never used
./ropper/search.py:203:38: E703 statement ends with a semicolon
./ropper/search.py:206:46: E251 unexpected spaces around keyword / parameter equals
./ropper/search.py:206:48: E251 unexpected spaces around keyword / parameter equals
./ropper/search.py:208:9: F841 local variable 'filtered' is assigned to but never used
./ropper/search.py:212:9: F841 local variable 'fg' is assigned to but never used
./ropper/search.py:225:38: E703 statement ends with a semicolon
./ropper/search.py:231:35: E231 missing whitespace after ','
./ropper/search.py:236:1: E302 expected 2 blank lines, found 1
./ropper/search.py:239:35: E231 missing whitespace after ','
./ropper/search.py:240:37: E231 missing whitespace after ','
./ropper/search.py:241:38: E231 missing whitespace after ','
./ropper/search.py:242:38: E231 missing whitespace after ','
./ropper/search.py:243:38: E231 missing whitespace after ','
./ropper/search.py:244:38: E231 missing whitespace after ','
./ropper/search.py:245:38: E231 missing whitespace after ','
./ropper/search.py:246:38: E231 missing whitespace after ','
./ropper/search.py:250:46: E251 unexpected spaces around keyword / parameter equals
./ropper/search.py:250:48: E251 unexpected spaces around keyword / parameter equals
./ropper/search.py:256:1: E302 expected 2 blank lines, found 1
./ropper/search.py:260:36: E231 missing whitespace after ','
./ropper/search.py:260:38: W605 invalid escape sequence '\$'
./ropper/arch.py:29:1: F403 'from ropper.common.abstract import *' used; unable to detect undefined names
./ropper/arch.py:33:1: F401 're.compile' imported but unused
./ropper/arch.py:34:1: F403 'from capstone import *' used; unable to detect undefined names
./ropper/arch.py:37:5: F401 'sys' imported but unused
./ropper/arch.py:39:1: E722 do not use bare 'except'
./ropper/arch.py:45:1: E722 do not use bare 'except'
./ropper/arch.py:48:1: E302 expected 2 blank lines, found 1
./ropper/arch.py:57:1: E302 expected 2 blank lines, found 1
./ropper/arch.py:60:1: E302 expected 2 blank lines, found 1
./ropper/arch.py:60:20: F405 'AbstractSingleton' may be undefined, or defined from star imports: capstone, ropper.common.abstract
./ropper/arch.py:69:29: E231 missing whitespace after ','
./ropper/arch.py:117:5: E303 too many blank lines (2)
./ropper/arch.py:179:47: E201 whitespace after '('
./ropper/arch.py:179:48: F405 'CS_ARCH_X86' may be undefined, or defined from star imports: capstone, ropper.common.abstract
./ropper/arch.py:179:61: F405 'CS_MODE_32' may be undefined, or defined from star imports: capstone, ropper.common.abstract
./ropper/arch.py:189:45: E261 at least two spaces before inline comment
./ropper/arch.py:190:25: E127 continuation line over-indented for visual indent
./ropper/arch.py:190:56: E261 at least two spaces before inline comment
./ropper/arch.py:191:56: E261 at least two spaces before inline comment
./ropper/arch.py:197:25: E124 closing bracket does not match visual indentation
./ropper/arch.py:209:61: E231 missing whitespace after ','
./ropper/arch.py:210:61: E231 missing whitespace after ','
./ropper/arch.py:234:13: E265 block comment should start with '# '
./ropper/arch.py:235:13: E265 block comment should start with '# '
./ropper/arch.py:239:41: E231 missing whitespace after ','
./ropper/arch.py:239:48: E231 missing whitespace after ','
./ropper/arch.py:239:57: E231 missing whitespace after ','
./ropper/arch.py:243:44: E203 whitespace before ':'

There are thousands of the lines

sashs commented 5 years ago

I will look at those warning later.