『壹』 有關於Visual Studio 2005 EXE程序反編譯成可用代碼的問題~!~
你應該選擇使用靜態庫啊。動態庫你要運行必須連相關的dll一起拷貝到別人電腦上去!
還有一些特別的情況,雖然是針對VC2005的,但是對VC6也有參考價值。
前面一些是我在網上找的,後面的有些是我自己現添加的,希望對你有幫助!
報錯"由於應用程序配置不正確,應用程序未能啟動.重新安裝應用程序可能會糾正這個問題"
//------------------------------------------------------
這個問題主要出現在XP環境下運行由Visual C++2003/2005編譯的MFC程序時
問題現象是XP運行此類程序時,報錯"由於應用程序配置不正確,應用程序未能啟動.重新安裝應用程序可能會糾正這個問題"
這個問題似乎許多人遇見過.在CSDN和微軟社區裡面都有人提到.但是沒有完整的解決方案
這個問題的解決一共會遇見2個子問題
最早出現這個錯誤我和許多人認為的一樣
認為是缺乏DLL庫文件導致.但是在測試機復制了DLL甚至安裝了.net framework 2.0以後
都無法解決問題,最後確認不是由缺乏DLL所致
因為程序是純win32的應用程,非託管代碼,所以也無需.net framework
Visual C++2003/2005默認的MFC程序是使用動態MFC庫(Use MFC in a Shared DLL)來鏈接的
而動態MFC庫使用的是Multi-threaded DLL (/MD)
由於XP對於PE文件格式監測更加嚴格.
就會導致部分使用多線程DLL的可執行文件在調用的時候出錯
修改項目屬性的編譯開關
Project->Property->configuration Properties->C/C++->Code Generation->Runtime Library
修改成Multi-threaded (/MT)
修改了Runtime類型以後
需要將MFC的編譯類型也改成靜態庫
Project->Property->configuration Properties->General->Use of MFC
修改成Use MFC in a Static Library
一部分情況下在這步就能解決問題
另外一部分情況會遇見如下情況
編譯器報錯
CODE:
nafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z) already defined in libcpmt.lib(newaop.obj)
[Copy to clipboard]
產生這個問題的原因是庫依賴關系
在Project->Property->configuration Properties->Linker->Command Line
加入編譯開關/verbose:lib可以顯示詳細的庫鏈接順序
CODE:
------ Build started: Project: PerfMonDemo, Configuration: Release Win32 ------
Linking...
Searching libraries
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\pdh.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\lib\DelayImp.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\lib\libcpmt.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\nafxcw.lib:
nafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z) already defined in libcpmt.lib(newaop.obj)
Searching d:\Program Files\Microsoft Visual Studio 8\VC\lib\libcmt.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\kernel32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\user32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\gdi32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\msimg32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comdlg32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\winspool.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\advapi32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shell32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comctl32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shlwapi.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\uuid.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\oledlg.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ole32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\oleaut32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\urlmon.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\lib\OLDNAMES.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\atls.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ws2_32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\mswsock.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\oleacc.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\pdh.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\lib\DelayImp.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\lib\libcpmt.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\nafxcw.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\lib\libcmt.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\kernel32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\user32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\gdi32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\msimg32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comdlg32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\winspool.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\advapi32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shell32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comctl32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shlwapi.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\uuid.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\oledlg.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ole32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\oleaut32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\urlmon.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\lib\OLDNAMES.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\atls.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ws2_32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\mswsock.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\oleacc.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\pdh.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\lib\DelayImp.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\lib\libcpmt.lib:
Finished searching libraries
Searching libraries
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\pdh.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\lib\DelayImp.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\lib\libcpmt.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\nafxcw.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\lib\libcmt.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\kernel32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\user32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\gdi32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\msimg32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comdlg32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\winspool.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\advapi32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shell32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comctl32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shlwapi.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\uuid.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\oledlg.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ole32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\oleaut32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\urlmon.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\lib\OLDNAMES.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\atls.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ws2_32.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\mswsock.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\oleacc.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib\pdh.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\lib\DelayImp.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\lib\libcpmt.lib:
Searching d:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\nafxcw.lib:
Finished searching libraries
.\Release/PerfMonDemo.exe : fatal error LNK1169: one or more multiply defined symbols found
Build log was saved at "file://d:\Dev\Performance Monitor\Release\BuildLog.htm"
PerfMonDemo - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
[Copy to clipboard]
我們發現在libcpmt.lib聲明過的operator new在nafxcw.lib中再次定義
解決方法如下
Project->Property->configuration Properties->Linker->Input->Additional Dependencies
加入
nafxcw.lib
libcpmt.lib
Project->Property->configuration Properties->Linker->Input->Ignore Specific Library
加入
nafxcw.lib
libcpmt.lib
這樣鏈接程序就不會先按照默認順序來連接這兩個庫文件
而是在最後在加入對他們的引用.這樣就避免了這個問題
下面是一張可能發生沖突的列表
若要使用此運行時庫 請忽略這些庫
單線程 (libc.lib) libcmt.lib、msvcrt.lib、libcd.lib、libcmtd.lib、msvcrtd.lib
多線程 (libcmt.lib) libc.lib、msvcrt.lib、libcd.lib、libcmtd.lib、msvcrtd.lib
使用 DLL 的多線程 (msvcrt.lib) libc.lib、libcmt.lib、libcd.lib、libcmtd.lib、msvcrtd.lib
調試單線程 (libcd.lib) libc.lib、libcmt.lib、msvcrt.lib、libcmtd.lib、msvcrtd.lib
調試多線程 (libcmtd.lib) libc.lib、libcmt.lib、msvcrt.lib、libcd.lib、msvcrtd.lib
使用 DLL 的調試多線程 (msvcrtd.lib) libc.lib、libcmt.lib、msvcrt.lib、libcd.lib、libcmtd.lib
//本人曾經對上面的方法進行測試,修改後可能出現XX無法解析的情況,請大家使用MSDN查找該函數,並且找到該函數對應的lib庫文件。將其添加到附加依賴項或者是用#pragma comment(lib,"xxx.lib")將其添加到代碼中!
『貳』 反編譯就真的那麼難
C#的程序很好反編譯,基本能還原成原代碼,
『叄』 android app可以破解so嗎
java語言很容易返編譯
但是我們通常會做一些保持,例如代碼混淆
android就支持的,只要你在
project.properties文件中
去掉這行的注釋就可以混淆了,混淆了的代碼反編譯後,全是a b c d ,很難看的明白
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
這個文件中有說明
另外,如果涉及安全的東西,建議用jni編寫,打包成so庫供java調用,這樣就增加了反編譯的難度