diff --git a/go.mod b/go.mod index 59b93d1..e7cd5b1 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/dblohm7/wingoes -go 1.21 +go 1.22 require ( github.com/tc-hib/winres v0.2.1 diff --git a/pe/pe.go b/pe/pe.go index b6bcdda..9343c81 100644 --- a/pe/pe.go +++ b/pe/pe.go @@ -296,7 +296,7 @@ func readStructArray[T any, R rvaType](r peReader, rva R, count int) ([]T, error if !ok { return nil, ErrInvalidBinary } - szT := uint32(reflect.ArrayOf(count, reflect.TypeOf((*T)(nil)).Elem()).Size()) + szT := uint32(reflect.ArrayOf(count, reflect.TypeFor[T]()).Size()) if addr2, ok := addOffset(addr, szT); !ok || addr2 >= v.Limit() { return nil, ErrInvalidBinary }