Commit Graph

  • 4e22595eaa Add relocation CRUD and dyld bind kinds add remove APIs for ELF/Mach-O/PE relocations and relocation sections allow ELF alloc relocation sections to grow via new PT_LOAD; stabilize section write order add Mach-O scattered relocs plus weak/lazy bind stream support add PE COFF relocation helpers (symbol lookup) update README and tests master awgh 2026-01-28 15:00:15 -08:00
  • dd7757eeb3 Add relocation editing support across ELF/Mach-O/PE with tests awgh 2026-01-23 20:55:41 -08:00
  • 26db73212a Merge pull request #25 from C-Sto/moreexports awgh 2023-05-08 12:55:19 -07:00
  • febe44e596 Fixes issue #26, where DOS Stubs were being zeroed out incorrectly. awgh 2023-04-18 20:54:12 -07:00
  • 6b69dda15d add delay imports functions, refactor section retrieval C-Sto 2022-12-21 15:36:56 +08:00
  • 9605c99179 Merge pull request #22 from C-Sto/patch-2 awgh 2021-10-07 01:33:45 -07:00
  • c65243ec70 fix import C_Sto 2021-10-07 14:31:12 +08:00
  • cb5355878d Merge pull request #21 from C-Sto/patch-1 awgh 2021-10-06 23:11:02 -07:00
  • c8a66609ea sanity check import address C_Sto 2021-10-07 14:08:36 +08:00
  • 6277045c2f - Added support for IAT linking. - Fixed a bug where debug/pe would try to read certificate tables in memoryMode - Added support for Forwarder RVA. awgh 2021-03-12 01:29:33 -08:00
  • c9b8b45728 Adding Exports() for Elf. Aw Gh 2021-02-24 20:23:42 -08:00
  • 1724e0c5d5 Added in-memory parsing and exports for Mach-O. Aw Gh 2021-02-24 01:54:05 -08:00
  • 1b03ff50b8 Merge pull request #19 from Binject/peload awgh 2021-01-01 13:07:38 -08:00
  • 8d083c1f04 Fixed unit tests for PE. Fixed a regression from this branch in string table lookups. Fixed two bugs where we assumed the optional header wasn't optional. awgh 2021-01-01 13:04:12 -08:00
  • cea0c3109d Fixed a bug where the prepended length of string tables was not saved and written out correctly. awgh 2020-12-30 19:03:39 -08:00
  • 26160983c6 Fixed typo in Relocate awgh 2020-12-30 12:21:36 -08:00
  • 6cd8cb92dc Added support for 64bit, fixed RVA writing errors. awgh 2020-12-30 12:08:50 -08:00
  • d9ccfe9efd Fixed read issue with RelocationBlock by adding new type RelocationTableEntry. awgh 2020-12-30 02:57:35 -08:00
  • 404f72feef Fix for image base being wrong size in 64bit mode. awgh 2020-12-30 02:40:24 -08:00
  • cef84fa80d Continuing work on implementing base relocations for PE files. awgh 2020-12-30 02:04:56 -08:00
  • 60012895f1 Added base relocation structs and a function to perform base relocations on an image. awgh 2020-12-28 00:20:58 -08:00
  • 9a7f55dae8 Completed implementation of ImportLibraries, fixed a couple linter warnings, fixed a TODO from previous maintainers. awgh 2020-12-27 17:07:28 -08:00
  • e5322966df Merge pull request #18 from C-Sto/comversion awgh 2020-12-07 22:20:49 -08:00
  • 4efde44477 Net prefix for exported function C-Sto 2020-12-04 23:44:19 +08:00
  • 72254acbf4 Add ability to retrieve CLR version from exe C-Sto 2020-12-04 23:30:33 +08:00
  • 2b8504217e Support parsing the 'importmap' directive in an importcfg file. Andrew LeFevre 2020-11-08 13:56:08 -05:00
  • d867f0b821 Merge pull request #16 from C-Sto/stringstablefix awgh 2020-11-01 14:33:01 -08:00
  • cb72c7d000 fix in-memory PE file symbol table offset pointer on write C-Sto 2020-11-01 09:53:13 +08:00
  • 9cc2bb2714 use internal seek const C-Sto 2020-11-01 09:43:19 +08:00
  • 3de1428350 fix up strings table location when in memory C-Sto 2020-10-31 20:17:30 +08:00
  • cc437dcdb1 fix #14 by exporting ArchiveMember.IsDataObj to allow users to create data archive members themselves Andrew LeFevre 2020-10-21 16:28:24 -04:00
  • 23d735563c Create LICENSE Andrew LeFevre 2020-09-28 09:16:56 -04:00
  • 6349fcc2a6 expose SymKind values Andrew LeFevre 2020-09-02 13:35:56 -04:00
  • 65b108cdac properly close file in Write... smh Andrew LeFevre 2020-09-02 13:28:09 -04:00
  • f54480b653 copy over files from cmd/internal/bio, as bundle requires that the copied package does not use build constraints (oops). This fixes failing builds on Windows Andrew LeFevre 2020-08-30 13:33:45 -04:00
  • 11235b0672 fixed not reading cgo objects correctly Andrew LeFevre 2020-08-28 09:22:13 -04:00
  • 1a6afe261a fix bug when handling url-encoded import paths, improve error messages Andrew LeFevre 2020-08-27 14:42:07 -04:00
  • b1dfe12fc5 fix bug when handling url-encoded import paths, improve error messages goobj2 Andrew LeFevre 2020-08-27 14:42:07 -04:00
  • d59c10f46e Merge pull request #11 from Binject/goobj2 Andrew LeFevre 2020-08-27 08:27:05 -04:00
  • 8bfa79782a add go.mod Andrew LeFevre 2020-08-27 08:24:31 -04:00
  • 6c635acc3f add comments, make Write a method of Package Andrew LeFevre 2020-08-27 08:22:00 -04:00
  • 2da520b91f removed symbol sorting code, not neccesary and speeds things up a bit Andrew LeFevre 2020-08-26 10:32:31 -04:00
  • d63df83dee WIP on getting reading/writing working for archives with multiple objects in them/ASM objects Andrew LeFevre 2020-08-25 11:11:10 -04:00
  • 6444916c14 improve importcfg parsing, mostly copied code from the Go linker Andrew LeFevre 2020-08-21 12:18:15 -04:00
  • affce5855a initial work on allowing Parse to accept a linker's importcfg as an optimization to avoid 'go list' calls Andrew LeFevre 2020-08-20 17:56:06 -04:00
  • d783f9a5c6 parse archive headers, update size field of archive headers to support editing object files Andrew LeFevre 2020-08-20 14:45:42 -04:00
  • e070d52fc6 fix genFuncInfoSyms, now works properly Andrew LeFevre 2020-08-20 10:03:04 -04:00
  • 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!! Andrew LeFevre 2020-08-19 15:05:44 -04:00
  • 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 Andrew LeFevre 2020-08-19 11:18:24 -04:00
  • beeb73cc56 added 2 more test cases Andrew LeFevre 2020-08-18 17:17:34 -04:00
  • ccfb1f895a improve logic for finding inline function names for stdlib functions and logic for sorting text symbols. Added test case Andrew LeFevre 2020-08-18 16:30:34 -04:00
  • b2ee1aae9e fixed init task's string ordering, added test case Andrew LeFevre 2020-08-18 09:15:14 -04:00
  • 342a092dea remove unused field in textSym Andrew LeFevre 2020-08-18 08:06:21 -04:00
  • fa7b4300b7 fix inline function symbol name resolution, add test case Andrew LeFevre 2020-08-17 17:42:44 -04:00
  • 56e5f34257 fix bug where symbols were not sorted correctly, added new test case Andrew LeFevre 2020-08-17 15:20:58 -04:00
  • 2e709d0be8 make parsing detirministic, overhaul test Andrew LeFevre 2020-08-12 17:27:17 -04:00
  • 45d5c770bf fixed PCDATA block by using correct ordering of functions.... tests now pass!!!!!!!! IT WORKS Andrew LeFevre 2020-08-12 16:16:12 -04:00
  • e2db12419b reordered string printing so the string table is identical at least for a simple hello world program Andrew LeFevre 2020-08-12 16:10:24 -04:00
  • f01fb25ba8 fix genFuncInfoSyms, resolve inlined call function names Andrew LeFevre 2020-08-12 16:04:37 -04:00
  • ea61e19a03 add more strings to string table, still missing a few Andrew LeFevre 2020-08-09 20:18:49 -04:00
  • e62e341d65 added comments that point to the origin of much of the code Andrew LeFevre 2020-08-09 15:46:45 -04:00
  • 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. Andrew LeFevre 2020-08-09 15:43:34 -04:00
  • 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 Andrew LeFevre 2020-08-09 13:51:54 -04:00
  • 52974464c4 Symbol References writing Andrew LeFevre 2020-08-07 14:04:38 -04:00
  • 33ebce06fd everything is written except for Symbol References Andrew LeFevre 2020-08-07 13:47:38 -04:00
  • d93ba3701d import and symbol writing working Andrew LeFevre 2020-08-07 11:47:11 -04:00
  • cd1ad3dc4b symbol definitions/references are now stored in separate slices mirroring how they are stored in object files Andrew LeFevre 2020-08-06 12:20:00 -04:00
  • 6aefc612bb Merge pull request #10 from C-Sto/ismanaged awgh 2020-07-25 09:56:05 -07:00
  • faed987215 add managed check C-Sto 2020-07-26 00:27:36 +08:00
  • 8dbb8aeb30 initial work on moving code from cmd/internal/goobj2 to read new Go object files Andrew LeFevre 2020-07-24 13:27:57 -04:00
  • 0feef7d976 Merge pull request #9 from C-Sto/rva_function awgh 2020-07-11 21:16:26 -07:00
  • 1cecce1be4 add rva offset conversion as function to pe file C-Sto 2020-07-12 11:55:30 +08:00
  • 63af8e4051 Added NewFileFromMemory, which lets you parse a PE binary from memory instead of file layout. <experimental feature!> awgh 2020-06-20 22:00:44 -07:00
  • db623b874a Commenting out debug prints. Need a debug/warning/error log scheme in here. awgh 2020-06-20 10:23:50 -07:00
  • 3ba66a81a9 Added support for ordinal-only exports. awgh 2020-06-20 00:51:18 -07:00
  • 7976403b13 Added Exports() which returns an array of Export structs describing the exported functions, if there are any. awgh 2020-06-19 23:33:58 -07:00
  • 9846938ecd fixed bug dealing with rich header writes and files with no dos stub Vyrus 2019-09-29 00:27:09 -07:00
  • d472551263 Commenting out some debug logging awgh 2019-08-05 14:26:35 -07:00
  • 8d4fd1e576 Fixed an integer overflow causing shellcode bug in x64. awgh 2019-08-02 23:59:45 -07:00
  • 8de2a11f74 Fixed padding for 64bit, shellcode isn't quite working for 64bit. awgh 2019-08-02 20:25:13 -07:00
  • 804a7d342d Made enhancements to allow adding sections that never existed in the original file. Added some PE consts that were missing along the way. awgh 2019-08-02 14:52:13 -07:00
  • 03ddc00e7a Added the ability to insert shellcode for Mach-O's. Untested, needs unit tests. awgh 2019-03-29 23:21:54 -07:00
  • 1394807065 Merge branch 'master' of github.com:Binject/debug awgh 2019-03-28 01:34:13 -07:00
  • 04ecef3cb6 Fixed a bug in the Elf writer when inserting shellcode from DYN injector. awgh 2019-03-28 01:33:24 -07:00
  • f6227f8ddf Added function SectionByName which returns the first section in f with the given name jamichaels 2019-03-27 21:06:08 -07:00
  • 952b463c9b Added definition for InsertionEOF to elfFile struct. jamichaels 2019-03-27 20:31:52 -07:00
  • 511d1a4b31 Added insertion point for Elf write for PT_NOTE injector. jamichaels 2019-03-27 20:27:17 -07:00
  • 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 awgh 2019-02-27 02:10:45 -08:00
  • 20195b1f9c Merge branch 'master' of github.com:Binject/debug awgh 2019-02-25 19:38:09 -08:00
  • 6110c64cf0 Refactoring: Moved relocations to their own file out of file.go. Features: Added parsing/saving of dynamic tag/value pairs. awgh 2019-02-25 19:37:01 -08:00
  • ea48ac925e Update README.md Dan Borges 2019-02-24 22:30:04 -08:00
  • e4ff9170c8 Create README.md Dan Borges 2019-02-24 22:29:47 -08:00
  • 4716c7f660 Create README.md Dan Borges 2019-02-22 21:28:33 -08:00
  • cf7175604d Merge branch 'master' of github.com:Binject/debug awgh 2019-02-21 22:46:18 -08:00
  • 328cb9f642 Section Header Table is now broken out in the parser and writer, enabling injection to work. awgh 2019-02-21 22:45:35 -08:00
  • 88cea2f938 Merge pull request #7 from Binject/fat_work Dan Borges 2019-02-21 19:42:09 -08:00
  • 247eb13f12 clone works, although an offset is not quite right, feels like 4 bytes off somewhere. cloned binaries still run fat_work ahhh 2019-02-20 23:26:37 -08:00
  • 37e08f3b00 Got fat header cloned, time to add fat files at proper offsets ahhh 2019-02-20 20:52:00 -08:00
  • c245e95876 Adding some of the fat / universalmacho cloning functionality ahhh 2019-02-20 20:10:20 -08:00
  • b89922c4e3 Merge pull request #6 from Binject/macho_write Dan Borges 2019-02-04 07:38:35 -08:00