Skip to content

Commit

Permalink
refactor: use GoFile.Bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxilly committed Oct 12, 2024
1 parent 4934470 commit 0500e8a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions file.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,15 +404,11 @@ func (f *GoFile) getPCLNTABDataBySymbol() (uint64, []byte, error) {
if end < start {
return 0, nil, errors.New("invalid pclntab symbols")
}
sectStart, data, err := f.fh.getSectionDataFromAddress(start)
data, err := f.Bytes(start, end-start)
if err != nil {
return 0, nil, err
}
// ensure that the pclntab is within the same section
if end-sectStart > uint64(len(data)) {
return 0, nil, errors.New("pclntab out of bounds")
}
return start, data[start-sectStart : end-sectStart], nil
return start, data, nil
}

func (f *GoFile) initPclntab() error {
Expand Down

0 comments on commit 0500e8a

Please sign in to comment.