1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-01 00:38:09 -04:00
v2fly/common/platform/securedload/file.go

19 lines
390 B
Go
Raw Normal View History

2021-03-16 18:05:01 -04:00
package securedload
2021-03-16 19:19:00 -04:00
import "path/filepath"
2021-03-16 18:05:01 -04:00
func GetAssetSecured(name string) ([]byte, error) {
2021-03-16 19:19:00 -04:00
name = filepath.FromSlash(name)
2021-03-16 18:05:01 -04:00
var err error
for k, v := range knownProtectedLoader {
if loadedData, errLoad := v.VerifyAndLoad(name); errLoad == nil {
return loadedData, nil
} else {
err = newError(k, " is not loading executable file").Base(errLoad)
}
}
return nil, err
}