@@ -102,6 +102,7 @@ BOOL MasterWindows::NewSection()
102102 return false ;
103103
104104 SingleAddSection::instance ()->puInti (m_MasterStaticTextStr);
105+ m_dwOldOEP = SinglePuPEInfo::instance ()->puGetOEP ();
105106 SingleAddSection::instance ()->puModifySectioNumber ();
106107 nRet = SingleAddSection::instance ()->puModifySectionInfo (Name, SectionSize);
107108 if (!nRet) {
@@ -274,7 +275,7 @@ void MasterWindows::OnBnClickedButton1()
274275
275276 // 3. CombatShell 数据拷贝/操作
276277 m_MasterStaticTextStr = (csTargetDirectory + " CompressionMask.exe" ).GetBSTR ();
277- if (!SingleStudData::instance ()->puInit (m_MasterStaticTextStr)) {
278+ if (!SingleStudData::instance ()->puInit (m_MasterStaticTextStr, m_dwOldOEP )) {
278279 AfxMessageBox (L" studData failuer!" );
279280 return ;
280281 }
@@ -292,10 +293,10 @@ void MasterWindows::OnBnClickedButton1()
292293 m_MasterStaticTextStr = nStr;
293294 }
294295 ShowPEInfoData (m_MasterStaticTextStr);
295- AfxMessageBox (m_MasterStaticTextStr + L" Success!" );
296+ AfxMessageBox (( m_MasterStaticTextStr + L" Success!" ). GetString () );
296297 }
297298 else
298- AfxMessageBox (m_MasterStaticTextStr + L" Failure!" );
299+ AfxMessageBox (( m_MasterStaticTextStr + L" Failure!" ). GetString () );
299300}
300301
301302// PE View
@@ -362,38 +363,39 @@ void MasterWindows::OnBnClickedButton2()
362363 UpdateData (TRUE );
363364 if (m_MasterStaticTextStr.IsEmpty ())
364365 {
365- AfxMessageBox (L" 请先拖入文件" );
366+ MessageBox (L" 请先拖入文件" );
366367 return ;
367368 }
368369
369- // 判断是否我们的壳,否则不给脱壳
370+ // 判断是否我们的壳,否则不给脱壳(未检测.)
370371 UnShllerProcPath = m_MasterStaticTextStr;
371372
372373 UnShell obj_Unshell;
373374 if (!obj_Unshell.puUnShell ()) {
374- AfxMessageBox (L" puUnShell error" );
375+ MessageBox (L" puUnShell error" );
375376 return ;
376377 }
377378 if (!obj_Unshell.puRepCompressionData ()) {
378- AfxMessageBox (L" puRepCompressionData error." );
379+ MessageBox (L" puRepCompressionData error." );
379380 return ;
380381 }
381382 if (!obj_Unshell.puDeleteSectionInfo ()) {
382- AfxMessageBox (L" puDeleteSectionInfo error." );
383+ MessageBox (L" puDeleteSectionInfo error." );
383384 return ;
384385 }
385386
386387 if (obj_Unshell.puSaveUnShell ())
387388 {
388- DeleteFile (m_MasterStaticTextStr);
389389 const std::wstring sUnShellPath = CodeTool::string2wstring (obj_Unshell.puGetUnShellPath ().c_str ()).c_str ();
390+ // Clear
391+ obj_Unshell.puClose ();
392+ DeleteFile (m_MasterStaticTextStr);
390393 int nRet = CopyFile (sUnShellPath .c_str (), m_MasterStaticTextStr, FALSE );
391394 if (nRet) {
392- m_MasterStaticTextStr = sUnShellPath .c_str ();
393395 DeleteFile (sUnShellPath .c_str ());
394396 DeleteFileA (g_CombatShellDataLocalFile);
395397 }
396- AfxMessageBox (L" puSaveUnShell_Success" );
398+ MessageBox (L" puSaveUnShell_Success. " );
397399 }
398400 ShowPEInfoData (m_MasterStaticTextStr);
399401}
0 commit comments