github.com/eh-steve/goloader@v0.0.0-20240111193454-90ff3cfdae39/obj/utils.go (about) 1 package obj 2 3 func findFileTab(filename string, namemap map[string]int, filetab []uint32) uint32 { 4 tab := namemap[filename] 5 for index, value := range filetab { 6 if uint32(tab) == value { 7 return uint32(index) 8 } 9 } 10 return 1<<32 - 1 11 } 12 13 func grow(bytes *[]byte, size int) { 14 if len(*bytes) < size { 15 *bytes = append(*bytes, make([]byte, size-len(*bytes))...) 16 } 17 }