使用ILDASM.EXE工具!
寫了兩個(gè)小程序進(jìn)行測試,一個(gè)使用C#語言,另外一個(gè)使用VB.NET語言。
d:\Mesh\study\VBAppDetect>dir /b
CSharpApp.exe
VBApp.exe
d:\Mesh\study\VBAppDetect>ildasm /tok /byt CSharpApp.exe /out=CSharpApp_manifest
.txt
d:\Mesh\study\VBAppDetect>type CSharpApp_manifest.txt | find /i "Microsoft.Visua
lBasic"
啥都沒有,呵呵
d:\Mesh\study\VBAppDetect>ildasm /tok /byt VBApp.exe /out=VBApp_manifest.txt
d:\Mesh\study\VBAppDetect>type VBApp_manifest.txt | find /i "Microsoft.VisualBas
ic"
一大堆引用Microsoft.VisualBasic的方法、屬性等,說明使用了VB.NET里面的東西了。
.assembly extern /*23000002*/ Microsoft.VisualBasic
extends [Microsoft.VisualBasic/*23000002*/]Microsoft.VisualBasic.Applicat
ionServices.WindowsFormsApplicationBase/*01000001*/
IL_0002: /* 28 | (0A)000002 */ call bool [Microsoft.VisualB
asic/*23000002*/]Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicati
onBase/*01000001*/::get_UseCompatibleTextRendering() /* 0A000002 */
IL_0018: /* 6F | (0A)000004 */ callvirt instance void [Microsoft.
VisualBasic/*23000002*/]Microsoft.VisualBasic.ApplicationServices.WindowsFormsAp
plicationBase/*01000001*/::Run(string[]) /* 0A000004 */
IL_0003: /* 28 | (0A)000005 */ call instance void [Microsoft.
VisualBasic/*23000002*/]Microsoft.VisualBasic.ApplicationServices.WindowsFormsAp
plicationBase/*01000001*/::.ctor(valuetype [Microsoft.VisualBasic/*23000002*/]Mi
crosoft.VisualBasic.ApplicationServices.AuthenticationMode/*01000016*/) /* 0A000
005 */
IL_0036: /* 6F | (0A)00000A */ callvirt instance void [Microsoft.
VisualBasic/*23000002*/]Microsoft.VisualBasic.ApplicationServices.WindowsFormsAp
plicationBase/*01000001*/::set_IsSingleInstance(bool) /* 0A00000A */
.
.
.
d:\Mesh\study\VBAppDetect>