282 Commits

Author SHA1 Message Date
awgh 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
2026-01-28 15:00:15 -08:00
awgh dd7757eeb3 Add relocation editing support across ELF/Mach-O/PE with tests
- implement relocation add/replace APIs and serialization updates per format
- generate dyld rebase/bind info from Mach-O relocs with optional ordinals
- update ELF dynamic relocation tags and safe relayout handling
- add/extend relocation tests and stabilize existing test suite
2026-01-23 20:55:41 -08:00
awgh 26db73212a Merge pull request #25 from C-Sto/moreexports
add delay imports functions, refactor section retrieval
2023-05-08 12:55:19 -07:00
awgh febe44e596 Fixes issue #26, where DOS Stubs were being zeroed out incorrectly.
Thanks to kulinacs for the issue report!
2023-04-18 20:54:12 -07:00
C-Sto 6b69dda15d add delay imports functions, refactor section retrieval 2022-12-21 15:36:56 +08:00
awgh 9605c99179 Merge pull request #22 from C-Sto/patch-2
fix import
2021-10-07 01:33:45 -07:00
C_Sto c65243ec70 fix import 2021-10-07 14:31:12 +08:00
awgh cb5355878d Merge pull request #21 from C-Sto/patch-1
sanity check import address
2021-10-06 23:11:02 -07:00
C_Sto c8a66609ea sanity check import address 2021-10-07 14:08:36 +08:00
awgh 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.
2021-03-12 01:29:33 -08:00
Aw Gh c9b8b45728 Adding Exports() for Elf. 2021-02-24 20:23:42 -08:00
Aw Gh 1724e0c5d5 Added in-memory parsing and exports for Mach-O. 2021-02-24 01:54:05 -08:00
awgh 1b03ff50b8 Merge pull request #19 from Binject/peload
Peload
2021-01-01 13:07:38 -08:00
awgh 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.
2021-01-01 13:04:12 -08:00
awgh cea0c3109d Fixed a bug where the prepended length of string tables was not saved
and written out correctly.
2020-12-30 19:03:39 -08:00
awgh 26160983c6 Fixed typo in Relocate 2020-12-30 12:21:36 -08:00
awgh 6cd8cb92dc Added support for 64bit, fixed RVA writing errors. 2020-12-30 12:08:50 -08:00
awgh d9ccfe9efd Fixed read issue with RelocationBlock by adding new type
RelocationTableEntry.
2020-12-30 02:57:35 -08:00
awgh 404f72feef Fix for image base being wrong size in 64bit mode. 2020-12-30 02:40:24 -08:00
awgh cef84fa80d Continuing work on implementing base relocations for PE files. 2020-12-30 02:04:56 -08:00
awgh 60012895f1 Added base relocation structs and a function to perform base relocations on an image. 2020-12-28 00:20:58 -08:00
awgh 9a7f55dae8 Completed implementation of ImportLibraries, fixed a couple linter warnings, fixed a TODO from previous maintainers. 2020-12-27 17:07:28 -08:00
awgh e5322966df Merge pull request #18 from C-Sto/comversion
Add ability to retrieve CLR version from exe
2020-12-07 22:20:49 -08:00
C-Sto 4efde44477 Net prefix for exported function 2020-12-04 23:44:19 +08:00
C-Sto 72254acbf4 Add ability to retrieve CLR version from exe 2020-12-04 23:30:33 +08:00
Andrew LeFevre 2b8504217e Support parsing the 'importmap' directive in an importcfg file.
Also change Parse to take in a function instead of a map to give the caller additional flexibility.

Fixes #13 and #17.
2020-11-08 13:56:08 -05:00
awgh d867f0b821 Merge pull request #16 from C-Sto/stringstablefix
fix up strings table location when in memory
2020-11-01 14:33:01 -08:00
C-Sto cb72c7d000 fix in-memory PE file symbol table offset pointer on write 2020-11-01 09:53:13 +08:00
C-Sto 9cc2bb2714 use internal seek const 2020-11-01 09:43:19 +08:00
C-Sto 3de1428350 fix up strings table location when in memory 2020-10-31 20:17:30 +08:00
Andrew LeFevre cc437dcdb1 fix #14 by exporting ArchiveMember.IsDataObj to allow users to create data archive members themselves 2020-10-21 16:28:24 -04:00
Andrew LeFevre 23d735563c Create LICENSE 2020-09-28 09:16:56 -04:00
Andrew LeFevre 6349fcc2a6 expose SymKind values 2020-09-02 13:35:56 -04:00
Andrew LeFevre 65b108cdac properly close file in Write... smh 2020-09-02 13:28:09 -04:00
Andrew LeFevre 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 2020-08-30 13:33:45 -04:00
Andrew LeFevre 11235b0672 fixed not reading cgo objects correctly 2020-08-28 09:22:13 -04:00
Andrew LeFevre 1a6afe261a fix bug when handling url-encoded import paths, improve error messages 2020-08-27 15:29:48 -04:00
Andrew LeFevre d59c10f46e Merge pull request #11 from Binject/goobj2
Add reading/writing Go 1.15 object file support
2020-08-27 08:27:05 -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