Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private bool LoadFileIntoBuf() {
- bool bRv = false;
- using (FileStream fStream = new FileStream(this._sFilename, FileMode.Open, FileAccess.Read)) {
- int nLen = (int)fStream.Length;
- this._bBuf = new byte[nLen];
- int nRead = fStream.Read(this._bBuf, 0, nLen);
- if (nRead == nLen) bRv = true;
- }
- return bRv;
- }
- private bool CheckDOSStub() {
- PEDumper.Win32ExeLayout._IMAGE_DOS_HEADER tmpDosHdr = new Win32ExeLayout._IMAGE_DOS_HEADER(0);
- byte[] bBuf = new byte[Marshal.SizeOf(tmpDosHdr)];
- Array.Copy(this._bBuf, bBuf, bBuf.Length);
- this._imgDosHdr = new Win32ExeLayout._IMAGE_DOS_HEADER(bBuf);
- bool bUnknown = false;
- switch (this._imgDosHdr.e_magic) {
- case Win32ExeLayout.IMAGE_DOS_SIGNATURE:
- if (this._pSwitches[(int)ParamSwitches.Bits.Verbose]) Console.WriteLine("FOUND DOS Signature...");
- break;
- case Win32ExeLayout.IMAGE_OS2_SIGNATURE:
- if (this._pSwitches[(int)ParamSwitches.Bits.Verbose]) Console.WriteLine("Found OS/2 Signature...");
- break;
- default:
- if (this._pSwitches[(int)ParamSwitches.Bits.Verbose]) Console.WriteLine("Unknown Signature! {0:X2}", this._imgDosHdr.e_magic);
- bUnknown = true;
- break;
- }
- return bUnknown;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement