Is the detection DLL 32/64 bits?
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 () + "is 32-bit PE file", "test Result");} else if (machine = = 0x8664) {MessageBox (Filedialog->getfilename () + "is 64-bit PE file", "test Result");} Else{messagebox ("Failed to recognize:" +filedialog->getfilename () + "How many bits of the PE file! "," test Result ");}}}
Detection DLL is 32/64 bits?