Is the dll detected 32/64-bit ?, Dll32

Source: Internet
Author: User

Is the dll detected 32/64-bit ?, Dll32

Is the dll detected 32/64-bit?


Void CCheck32Or64Dlg: OnButton2 () {CString fileName = ""; CFileDialog * fileDialog = new CFileDialog (TRUE, NULL, NULL, OFN_HIDEREADONLY, "Dll Files (*. dll) | *. dll | Exe Files (*. exe) | *. exe | ", NULL); if (fileDialog-> DoModal () = IDOK) {fileName = fileDialog-> GetPathName (); byte buf [4]; CFile file (fileName, CFile: modeRead); file. seek (0x40-4, 0); file. read (buf, 4); int a, B, c, d; a = int (buf [0]); B = int (buf [1]) * 256; c = int (buf [2]) * 256*256; d = int (buf [3]) * 256*256*256; int sum = a + B + c + d; file. seek (sum + 4, 0); byte bufMachine [2]; file. read (bufMachine, 2); int machine = (int) bufMachine [0] + (int) (bufMachine [1]) * 256; if (machine = 0x14C) {MessageBox (fileDialog-> GetFileName () + "32-bit PE file", "detection result");} else if (machine = 0x8664) {MessageBox (fileDialog-> GetFileName () + "is a 64-bit PE file", "detection result");} else {MessageBox ("unidentifiable: "+ fileDialog-> GetFileName () +" Number of PES File! "," Detection result ");}}}


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.