MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / shadowPluginMatches

Function shadowPluginMatches

internal/pluginhost/loader_windows.go:231–251  ·  view source on GitHub ↗
(path string, size int64, digest string)

Source from the content-addressed store, hash-verified

229}
230
231func shadowPluginMatches(path string, size int64, digest string) bool {
232 info, errStat := os.Stat(path)
233 if errStat != nil {
234 return false
235 }
236 if !info.Mode().IsRegular() || info.Size() != size {
237 return false
238 }
239 file, errOpen := os.Open(path)
240 if errOpen != nil {
241 return false
242 }
243 defer func() {
244 _ = file.Close()
245 }()
246 hasher := sha256.New()
247 if _, errCopy := io.Copy(hasher, file); errCopy != nil {
248 return false
249 }
250 return hex.EncodeToString(hasher.Sum(nil)) == digest
251}
252
253func (c *dynamicLibraryClient) Call(ctx context.Context, method string, request []byte) ([]byte, error) {
254 if c == nil || c.api.call == 0 {

Callers 1

shadowCopyPluginToDirFunction · 0.85

Calls 2

OpenMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected