Commit Graph

50 Commits

Author SHA1 Message Date
James Gross 6de41d2f23 Fix vstruct number issue (#412)
Squash a few bugs in vstruct related to negative numbers and unformatted values.
2021-07-31 00:09:44 -04:00
James Gross 726afe014a Yet Another Grabbag Bugfix PR (#404)
* Get vtrace and other unittests working on windows
* tests for vivisect.reports
* PE.carve bytes/string IO fix
* lots of fixes to the intel emulators per the lockstepper test which only runs on windows.
* utilitize some common hex functionality
2021-07-06 10:54:26 -04:00
James Gross 888d683663 Py3 Cleanup (#353)
* clean up the emulators a bit. tried to use safemem to fix the bug, but that didn't work as intended.

* ton of cleanup and test cleanup. and also emulator fix

* found the edge case

* Make the dirs on a save just in case

* fix issue with v_zwstr in vstruct parsing and cleanup

* Bunch of little fixups from division fixes for py2/3 stuff, a set of new intel instructions (from decoding all the way up to symboliks), to PE loading

* Docstring updates, more unittests for vstruct, extension fix, memcanvas fix for certain edge cases. Overall: incorporating feedback from @willi and @atlas

* custom log level

* envi config encoding per @willi, getting memoryview hotkeys working again for the same reason mouse was broken
2021-02-12 22:55:03 -05:00
James Gross a7b5f8deef Py3 cutover (try number: who knows?) (#328)
Massive cutover to python3 (baseline is 3.9.1, but is also tested/working on 3.7.x). This merge is a breaking change for any downstream consumers, as the python 2->3 strings/bytes change is central. Most APIs should still work roughly as intended, as I didn't majorly re-organize the codebase, so most APIs live where they lived before. But a changelog/migration guide will be included in the next PR for this.

This PR will constitute most if not all of the v1.0.0 release that is forthcoming soon.
2021-02-03 14:37:09 -05:00
atlas0fd00m 955491fbfb srec parser support (#343)
* initial commit of SREC file parser

* vivbin really wants to read in more than one option at a time!

* minor SREC parser bugfixes

* cleanup and logging

* updates per @rakuy0

* bugfix

* cleanup and unittest per @rakuyo

* cleanup

* updates per @rakuy0

* bugfix: imported constants

* updates to SREC and IHEX for hashing and improved parsing.

* div comment per @rakuy0

* reduce log clutter on makePointers where pointers already exist (at the same location)
2021-01-30 01:35:46 -05:00
atlas0fd00m b46509bad0 streamlined testelf, loading one workspace at a time. (#340)
* streamlined testelf, loading one workspace at a time.

* merge fail

* updates

* bugfix

* your hex and blob unittests, and a bugfix for ihex parsing.

* bugfix per @rakuyo

* bugfix (newrel) and cleanup.

* fix wrong handling of IHEX_REC_STARTSEG
2021-01-18 09:40:41 -05:00
upside2 1ae0fb1536 Refactor parseimports (#331)
* Added support for delay imports

* Refactor parseImports and parseDelayImports - behavior is unchanged

* clear lists, fix typo

* return the imports_list instead of passing it

* Store delay imports in VaSet so they can be identified among all the imports

Co-authored-by: Matt Williams <matthew.williams@fireeye.com>
Co-authored-by: todd.plantenga <>
Co-authored-by: James Gross <45212823+rakuy0@users.noreply.github.com>
2021-01-12 17:32:50 -05:00
James Gross 80de840881 Even More Syntax Cleanup (#293)
A lot of cleanup things in prep for a python 3 transition. Getting rid of the old exception syntax, converting prints over to logging, cutting random scraps of code to be proper unit tests,  cut away some older bits of code, etc.

This still works in python2. It's just a lot of tidying up. There are no major functionality changes.
2020-09-08 13:00:06 -04:00
rakuyo 7e05e03bac more tests 2020-08-13 17:29:02 -04:00
rakuyo 385798a0d2 save work and move init files to new pr 2020-08-03 17:14:03 -04:00
James Gross 402e944e0b Py3 Task #1 (#289)
* no more xrange

* travis ci

* cleanup per review. And a test to prove that pycparser still works as intended.

* msgpack 1.0 compat and pin requirements
2020-07-17 12:44:30 -04:00
atlas c8e6d4038b just adding a few defines i got from apple's opensource repos. 2020-04-06 16:23:45 -04:00
atlas 5c8f67f005 dramatic performance improvements, sanity checking. 2019-07-29 18:22:15 -04:00
rakuyo 758495a90f Fix a bunch of flake8 and whitespace issues. And also fix some of the unittests that weren't passing 2019-03-20 09:54:39 -04:00
atlas a1b2937d71 ok, put it all back the way it was, with just the bug fix. now, we should account for the mandatory 4-byte alignment, but not rock the boat too heavily. ;) 2019-01-08 12:05:31 -05:00
atlas b391743f88 corrected calculations. not as pretty, but less buggy. 2019-01-07 21:41:09 -05:00
atlas 5b26db69df one solution, using strings as i suspect is more accurate. 2019-01-07 20:36:36 -05:00
atlas 68550e31c9 clean up and attempt at joint PyQt4 and PyQt5 2018-04-04 23:28:07 -04:00
atlas 97616b7fad save game. simple translation, then modification of Constructors. with minimal changes, we're mostly operational 2017-12-05 16:10:48 -05:00
Jay Smith 59e8278c41 Forcing string return for __str__ to allow setting an integer field's enum to be a v_bitmask, which returns a list of labels from vsReverseMapping() 2016-12-06 13:14:41 -05:00
Jay Smith 0e4a69cb60 Adding more DNS, packet, and IP record type values. Adding AAAA records to DNS messages 2016-06-27 14:59:14 -04:00
Joshua Homan 1a7535df2e Adding big endian support for ELF 2015-12-01 13:23:41 -06:00
Joshua Homan e757babf04 Fix for VStruct __mul__ to copy itself 2015-11-20 10:26:56 -06:00
Jay Smith d9d8861c7b Some def additions to inet, pcap, and win32 2015-10-28 11:34:00 -04:00
invisigoth 5172e60cf9 Merge branch 'master' of https://github.com/vivisect/vivisect 2015-07-16 21:46:01 -04:00
invisigoth 4f320bab0e added __setitem__ to vstruct and vsParseFd for zstr 2015-07-16 21:45:53 -04:00
invisig0th 39e2eaa0a7 Merge pull request #67 from williballenthin/vstruct-enum-uints
VStruct enum uints
2015-07-16 21:41:12 -04:00
Willi Ballenthin 550df81d22 vstruct: prims: pull enum support into v_number 2015-07-16 10:30:01 -04:00
invisig0th 2a151ecdec Merge pull request #66 from williballenthin/vstruct-struck-typo
VStruct struck typo
2015-06-07 20:41:24 -04:00
Willi Ballenthin 132fc25d24 vstruct: add __hash__ for vstruct primitives. closes #59. 2015-06-03 10:46:12 -04:00
Willi Ballenthin 836b4bdafb vstruct: add enum_uint* variants that stringify to their constant names 2015-06-03 10:36:09 -04:00
Willi Ballenthin a445a1e24d vstruct/primitives.py: fix typo, s/struck/struct/ 2015-06-03 10:32:44 -04:00
invisigoth a56e69a973 last (hopefully) merge from viv mercurial 2015-04-08 13:30:31 -04:00
l1berty b7eca681a1 initial vstruct minidump support 2015-01-20 19:30:43 -05:00
invisig0th 06de528eff Merge pull request #34 from vivisect/l1berty_vstruct_ctor_fix
fix bug, call correct ctor
2015-01-01 19:11:36 -05:00
l1berty 6272790794 fix bug, call correct ctor 2015-01-01 19:01:23 -05:00
l1berty e94cae76ec compute 'expected' bitwise result instead of exception 2015-01-01 10:02:13 -05:00
l1berty c2a78b1425 fixed setting of integers that could not be represented by the vstruct number types (and hence could not be subsequently vsEmit'd). added min/max checks in vsSetValue, added new signed number type, overrided vsSetValue in bitfield to reflect new behavior, added dynamically generated testcases, minor cleanup 2014-12-10 17:32:17 -05:00
invisig0th 43d9b8f384 Merge pull request #12 from atlas0fd00m/bitfield.vsEmit
Add bitfield.vsEmit() to vstruct core
2014-11-24 13:33:00 -05:00
atlas b8c2613b5b visi's uber-fast update for VBitField.vsEmit() 2014-11-24 12:27:04 -05:00
atlas f2b23bf713 bitfield __main__ removal 2014-11-20 22:27:57 -05:00
atlas 9b483157a7 Add bitfield.vsEmit() to vstruct core 2014-11-19 03:11:04 -05:00
l1berty b91148148a return field obj along with name, update tests 2014-11-18 22:31:42 -05:00
l1berty 74f320e138 add new vstruct method vsGetFieldByOffset and unittests 2014-11-18 18:39:08 -05:00
invisigoth 19458cae6a merged deltas from a downstream hg repo 2014-11-16 22:11:59 -05:00
piggum 5aa8b8a893 added win8.0 wow64 nt symbols 2014-11-16 21:03:41 -05:00
invisigoth 21c8c4eeeb added ntdll/ntoskrnl vstruct defs for win 8.1 amd64 / wow64 2014-11-15 06:50:37 -05:00
invisigoth a32678f466 ntdll / ntoskrnl structs autogened for windows 8.1 i386 2014-11-15 00:14:05 -05:00
invisigoth 8ea56cd4fb ported unit tests from mercurial 2014-11-14 20:20:33 -05:00
invisigoth be146cabd2 initial import from hg 2014-11-14 16:59:32 -05:00