243 Commits

Author SHA1 Message Date
Andrew LeFevre b1dfe12fc5 fix bug when handling url-encoded import paths, improve error messages 2020-08-27 14:42:07 -04:00
Andrew LeFevre 8bfa79782a add go.mod 2020-08-27 08:24:31 -04:00
Andrew LeFevre 6c635acc3f add comments, make Write a method of Package 2020-08-27 08:22:00 -04:00
Andrew LeFevre 2da520b91f removed symbol sorting code, not neccesary and speeds things up a bit 2020-08-26 10:32:31 -04:00
Andrew LeFevre d63df83dee WIP on getting reading/writing working for archives with multiple objects in them/ASM objects 2020-08-25 11:11:10 -04:00
Andrew LeFevre 6444916c14 improve importcfg parsing, mostly copied code from the Go linker 2020-08-21 12:18:15 -04:00
Andrew LeFevre affce5855a initial work on allowing Parse to accept a linker's importcfg as an optimization to avoid 'go list' calls 2020-08-20 17:56:06 -04:00
Andrew LeFevre d783f9a5c6 parse archive headers, update size field of archive headers to support editing object files 2020-08-20 14:45:42 -04:00
Andrew LeFevre e070d52fc6 fix genFuncInfoSyms, now works properly 2020-08-20 10:03:04 -04:00
Andrew LeFevre 06488d6254 tweak string table detection logic (correct some offsets), simplified exported funcs a bit. Parsing and writing an objfile from github.com/lu4p/binclude works now!! 2020-08-19 15:05:44 -04:00
Andrew LeFevre 736b43b3be properly resolve import's object files using 'go list', find init sym correctly by using the package name, improve symbol string table searching logic 2020-08-19 11:18:24 -04:00
Andrew LeFevre beeb73cc56 added 2 more test cases 2020-08-18 17:17:34 -04:00
Andrew LeFevre ccfb1f895a improve logic for finding inline function names for stdlib functions and logic for sorting text symbols. Added test case 2020-08-18 16:32:03 -04:00
Andrew LeFevre b2ee1aae9e fixed init task's string ordering, added test case 2020-08-18 09:15:14 -04:00
Andrew LeFevre 342a092dea remove unused field in textSym 2020-08-18 08:06:21 -04:00
Andrew LeFevre fa7b4300b7 fix inline function symbol name resolution, add test case 2020-08-17 17:42:44 -04:00
Andrew LeFevre 56e5f34257 fix bug where symbols were not sorted correctly, added new test case 2020-08-17 15:20:58 -04:00
Andrew LeFevre 2e709d0be8 make parsing detirministic, overhaul test 2020-08-12 17:27:17 -04:00
Andrew LeFevre 45d5c770bf fixed PCDATA block by using correct ordering of functions.... tests now pass!!!!!!!! IT WORKS 2020-08-12 16:16:12 -04:00
Andrew LeFevre e2db12419b reordered string printing so the string table is identical at least for a simple hello world program 2020-08-12 16:10:24 -04:00
Andrew LeFevre f01fb25ba8 fix genFuncInfoSyms, resolve inlined call function names 2020-08-12 16:04:37 -04:00
Andrew LeFevre ea61e19a03 add more strings to string table, still missing a few 2020-08-09 20:18:49 -04:00
Andrew LeFevre e62e341d65 added comments that point to the origin of much of the code 2020-08-09 15:46:45 -04:00
Andrew LeFevre 7c908753d0 fix silly copy-pasta error, now an object file can be parsed -> written -> parsed without errors. But the parsed struct is still not identical. 2020-08-09 15:43:34 -04:00
Andrew LeFevre 559d8c28be everything is written, currently only the object header, imports, packages and dwarf files are parsed correctly from a written obj file. Also added test 2020-08-09 13:51:54 -04:00
Andrew LeFevre 52974464c4 Symbol References writing 2020-08-07 14:04:38 -04:00
Andrew LeFevre 33ebce06fd everything is written except for Symbol References 2020-08-07 13:47:38 -04:00
Andrew LeFevre d93ba3701d import and symbol writing working 2020-08-07 11:47:11 -04:00
Andrew LeFevre cd1ad3dc4b symbol definitions/references are now stored in separate slices mirroring how they are stored in object files 2020-08-06 12:20:00 -04:00
Andrew LeFevre 8dbb8aeb30 initial work on moving code from cmd/internal/goobj2 to read new Go object files 2020-07-24 13:27:57 -04:00
awgh 0feef7d976 Merge pull request #9 from C-Sto/rva_function
add rva offset conversion as function to pe file
2020-07-11 21:16:26 -07:00
C-Sto 1cecce1be4 add rva offset conversion as function to pe file 2020-07-12 11:55:30 +08:00
awgh 63af8e4051 Added NewFileFromMemory, which lets you parse a PE binary from memory instead of file layout. <experimental feature!> 2020-06-20 22:00:44 -07:00
awgh db623b874a Commenting out debug prints. Need a debug/warning/error log scheme in here. 2020-06-20 10:23:50 -07:00
awgh 3ba66a81a9 Added support for ordinal-only exports. 2020-06-20 00:51:18 -07:00
awgh 7976403b13 Added Exports() which returns an array of Export structs describing the exported functions, if there are any. 2020-06-19 23:34:00 -07:00
Vyrus 9846938ecd fixed bug dealing with rich header writes and files with no dos stub 2019-09-29 00:27:09 -07:00
awgh d472551263 Commenting out some debug logging 2019-08-05 14:26:35 -07:00
awgh 8d4fd1e576 Fixed an integer overflow causing shellcode bug in x64. 2019-08-02 23:59:45 -07:00
awgh 8de2a11f74 Fixed padding for 64bit, shellcode isn't quite working for 64bit. 2019-08-02 20:25:13 -07:00
awgh 804a7d342d Made enhancements to allow adding sections that never existed in the original file.
Added some PE consts that were missing along the way.
2019-08-02 14:52:13 -07:00
awgh 03ddc00e7a Added the ability to insert shellcode for Mach-O's. Untested, needs unit tests. 2019-03-29 23:21:54 -07:00
awgh 1394807065 Merge branch 'master' of github.com:Binject/debug 2019-03-28 01:34:13 -07:00
awgh 04ecef3cb6 Fixed a bug in the Elf writer when inserting shellcode from DYN injector. 2019-03-28 01:33:24 -07:00
jamichaels f6227f8ddf Added function SectionByName which returns the first section in f with the given name 2019-03-27 21:06:08 -07:00
jamichaels 952b463c9b Added definition for InsertionEOF to elfFile struct. 2019-03-27 20:31:52 -07:00
jamichaels 511d1a4b31 Added insertion point for Elf write for PT_NOTE injector. 2019-03-27 20:27:17 -07:00
awgh 66146efe87 1) Implemented parsing and writing of dynamic section tagged values.
2) Fixed DynStrings function to use new parsed structures instead of going back to original file.
3) Implemented the WriteFile / Bytes change in elf that was already made in pe and macho
2019-02-27 02:10:45 -08:00
awgh 20195b1f9c Merge branch 'master' of github.com:Binject/debug 2019-02-25 19:38:09 -08:00
awgh 6110c64cf0 Refactoring: Moved relocations to their own file out of file.go.
Features:  Added parsing/saving of dynamic tag/value pairs.
2019-02-25 19:37:01 -08:00