Use a using statement to make sure the file is closed when we return
This commit is contained in:
parent
4f34e5c374
commit
dba8d8ebef
|
@ -152,9 +152,10 @@ namespace de4dot.code.deobfuscators.CliSecure {
|
||||||
if ((module.Attributes & ModuleAttributes.ILOnly) != 0)
|
if ((module.Attributes & ModuleAttributes.ILOnly) != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var peImage = new PeImage(new FileStream(module.FullyQualifiedName, FileMode.Open, FileAccess.Read, FileShare.Read));
|
using (var file = new FileStream(module.FullyQualifiedName, FileMode.Open, FileAccess.Read, FileShare.Read)) {
|
||||||
foundSig = MethodsDecrypter.detect(peImage);
|
var peImage = new PeImage(file);
|
||||||
return foundSig;
|
return foundSig = MethodsDecrypter.detect(peImage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool hasPinvokeMethod(TypeDefinition type, string methodName) {
|
static bool hasPinvokeMethod(TypeDefinition type, string methodName) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user