Comments (4)
Nice find. I raised #11. I'll see if I can get it fixed ASAP.
from gore.
@capnspacehook, this is a known issue. This caused when incorrect compiler version is detected for the binary.
github.com/goretk/gore.getLegacyTypes(0xc0000c6540, 0x56cec0, 0xc00000e040, 0xa, 0xffffffffffffffff, 0x8)
github.com/goretk/gore/type.go:107 +0x235
is logic for parsing versions prior to 1.7. Since the data structures in these versions are very different this can happen.
When analysing the library with the library this usually happens because the markers for different versions are included in the library.... If you know the version, you can force the assumed version by for example calling file.SetGoVersion("go1.13")
after opening the file.
Until a better way for determining the version, this is the current solution.
With the release 1.13, a functionality for extracting the version was added but it only works for 1.13 and later stripped binaries:
[gore]$ file testdata/gold/gold-linux-amd64-1.13
testdata/gold/gold-linux-amd64-1.13: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=YWmIDeHrc37MnKyHo53S/hGdyCvxmA0ZSwHA56vwG/cthDW6MiJGhvIw_Mk5x0/egx2QKll4Xf19HLolX0e, stripped
[gore]$ go version testdata/gold/gold-linux-amd64-1.13
testdata/gold/gold-linux-amd64-1.13: go1.13
[gore]$ file testdata/gold/gold-linux-amd64-1.12.0
testdata/gold/gold-linux-amd64-1.12.0: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=W11rzA8dxCieF64mk9rO/wmqBULPx6tMOdPbSBabM/X40xrZ4nVRHkrWOKbwZw/JpQDPeWBsrG9Rn_jzf3s, stripped
[gore]$ go version testdata/gold/gold-linux-amd64-1.12.0
testdata/gold/gold-linux-amd64-1.12.0: go version not found
from gore.
Ok that makes sense, thanks. I will try explicitly setting the Go version. I know some other binaries I tested threw a different error, I think related to the fact that the buildID wasn't compiled in the with the flag -ldflags "buildid="
. I will do some more testing and update the issue.
from gore.
Thanks for the quick fix! Tested the upgraded redress and the issue is fixed!
from gore.
Related Issues (20)
- Analysis fails if no build id exist in ELF binaries
- Slice out of range error when try to get types/struct HOT 4
- ARM support HOT 2
- Support for position independent executables (PIE)
- String extraction functionality
- MIPS support
- Fix the type parser
- Fix function line logic
- Don't skip built-in packages
- Use semver library for version compare
- panic: runtime error: index out of range [757869355] with length 33282560 HOT 2
- Fix map struct parsing for Go 1.7 to 1.13 HOT 1
- Extract build information if available
- GetTypes panic: runtime error: invalid memory address or nil pointer dereference. HOT 1
- support go1.18 HOT 2
- Linux type kind parsing fails HOT 11
- no pclntab located HOT 1
- GetGoRoot return ErrNoGoRootFound when running on windows
- Add go buildid to file info
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gore.