using Microsoft.VisualBasic;
public class X
{
const int PESIGNATURE = 17744;
const int MZSIGNATURE = 23117;
public bool IsWinExe(string StrFileName)
{
short rMZ;
int rOfs;
int rFree;
int rPE;
rFree = FreeFile;
FileSystem.FileOpen(rFree, StrFileName, OpenMode.Input);
FileSystem.FileClose(rFree);
FileSystem.FileOpen(rFree, StrFileName, OpenMode.Binary, OpenAccess.Read);
//UPGRADE_WARNING: Get was upgraded to FileGet and has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"'
FileSystem.FileGet(rFree, rMZ);
if ((rMZ == MZSIGNATURE))
{
//UPGRADE_WARNING: Get was upgraded to FileGet and has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"'
FileSystem.FileGet(rFree, rOfs, 61);
if ((rOfs > 61) & (rOfs < FileSystem.LOF(rFree)))
{
//UPGRADE_WARNING: Get was upgraded to FileGet and has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"'
FileSystem.FileGet(rFree, rPE, 1 + rOfs);
IsPE = (rPE == PESIGNATURE);
}
}
FileSystem.FileClose(rFree);
Xi:
return;// might not be correct. Was : Exit Function
Xe:
}
}