Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSI: parse multiple sections correctly #27

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add hexToBytes helper
tmm1 committed Apr 7, 2021
commit 9d2253cb75db9bb778cb66dd97b2000a3f9309dc
10 changes: 10 additions & 0 deletions data_psi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@ package astits

import (
"bytes"
"encoding/hex"
"strings"
"testing"

"github.com/asticode/go-astikit"
"github.com/stretchr/testify/assert"
)

func hexToBytes(in string) []byte {
o, err := hex.DecodeString(strings.ReplaceAll(in, "\n", ""))
if err != nil {
panic(err)
}
return o
}

var psi = &PSIData{
PointerField: 4,
Sections: []*PSISection{
Expand Down