本帖最后由 BitterLotus 于 2021-6-25 19:30 编辑
- //搞任务管理器的
- .method private hidebysig instance void ManageTaskManager(int32 arg)
- // CODE XREF: Shuttingdown.Form1__Form1_Load+29↑p
- {
- .maxstack 4
- .locals init (class [mscorlib]Microsoft.Win32.RegistryKey V0,
- class [mscorlib]Microsoft.Win32.RegistryKey V1)
- ldsfld class [mscorlib]Microsoft.Win32.RegistryKey [mscorlib]Microsoft.Win32.Registry::CurrentUser // Push the value of field on the stack
- stloc.0 // Pop value from stack into local variable 0
- ldloc.0 // Load local variable 0 onto stack
- ldstr aSoftwareMicros_0 // "Software\\Microsoft\\Windows\\CurrentVe"...
- ldc.i4.1 // Push 1 onto the stack as I4
- callvirt instance class [mscorlib]Microsoft.Win32.RegistryKey [mscorlib]Microsoft.Win32.RegistryKey::OpenSubKey(string, bool) // Call a method associated with obj
- stloc.1 // Pop value from stack into local variable 1
- ldloc.1 // Load local variable 1 onto stack
- brtrue.s loc_142 // Branch to target if value is non-zero (true), short form
- ldloc.0 // Load local variable 0 onto stack
- ldstr aSoftwareMicros_0 // "Software\\Microsoft\\Windows\\CurrentVe"...
- callvirt instance class [mscorlib]Microsoft.Win32.RegistryKey [mscorlib]Microsoft.Win32.RegistryKey::CreateSubKey(string) // Call a method associated with obj
- stloc.1 // Pop value from stack into local variable 1
复制代码
别问为什么不用DnSpy,问就是懒得下。这玩意竟然用了SunnyUI。。
- //倒计时,利用的是加秒数而非Timer。。。
- .method public hidebysig specialname rtspecialname instance void .ctor()
- {
- .maxstack 2
- .locals init (valuetype [mscorlib]System.DateTime V0,
- valuetype [mscorlib]System.DateTime V1,
- valuetype [mscorlib]System.DateTime V2)
- ldarg.0 // Load argument 0 onto stack
- call instance void [mscorlib]System.Object::.ctor() // Call a method
- call valuetype [mscorlib]System.DateTime [mscorlib]System.DateTime::get_Now() // Call a method
- stloc.0 // Pop value from stack into local variable 0
- ldloca.s 0 // Load address of local variable, short form
- call instance valuetype [mscorlib]System.DateTime [mscorlib]System.DateTime::get_Date() // Call a method
- stloc.2 // Pop value from stack into local variable 2
- ldloca.s 2 // Load address of local variable, short form
- ldc.r8 1.0 // Push num of type R8 onto the stack as F
- call instance valuetype [mscorlib]System.DateTime [mscorlib]System.DateTime::AddDays(float64) // Call a method
- stloc.2 // Pop value from stack into local variable 2
- ldloca.s 2 // Load address of local variable, short form
- ldc.r8 -1.0 // Push num of type R8 onto the stack as F
- call instance valuetype [mscorlib]System.DateTime [mscorlib]System.DateTime::AddSeconds(float64) // Call a method
- stloc.1 // Pop value from stack into local variable 1
- ldarg.0 // Load argument 0 onto stack
- ldloc.1 // Load local variable 1 onto stack
- call instance void ShutdownHelper::set_End(valuetype [mscorlib]System.DateTime value) // Call a method
- ret // Return from method, possibly returning a value
- }
复制代码
- //重启部分关键代码
- .method public hidebysig instance void Exec(string str)
- {
- .maxstack 3
- .locals init (class [System]System.Diagnostics.Process V0)
- .try {
- newobj instance void [System]System.Diagnostics.Process::.ctor() // Create a new object
- stloc.0 // Pop value from stack into local variable 0
- .try {
- ldloc.0 // Load local variable 0 onto stack
- callvirt instance class [System]System.Diagnostics.ProcessStartInfo [System]System.Diagnostics.Process::get_StartInfo() // Call a method associated with obj
- ldstr aCmdExe // "cmd.exe"
- callvirt instance void [System]System.Diagnostics.ProcessStartInfo::set_FileName(string) // Call a method associated with obj
- ldloc.0 // Load local variable 0 onto stack
- callvirt instance class [System]System.Diagnostics.ProcessStartInfo [System]System.Diagnostics.Process::get_StartInfo() // Call a method associated with obj
- ldc.i4.0 // Push 0 onto the stack as I4
- callvirt instance void [System]System.Diagnostics.ProcessStartInfo::set_UseShellExecute(bool) // Call a method associated with obj
- ldloc.0 // Load local variable 0 onto stack
- callvirt instance class [System]System.Diagnostics.ProcessStartInfo [System]System.Diagnostics.Process::get_StartInfo() // Call a method associated with obj
- ldc.i4.1 // Push 1 onto the stack as I4
- callvirt instance void [System]System.Diagnostics.ProcessStartInfo::set_RedirectStandardInput(bool) // Call a method associated with obj
- ldloc.0 // Load local variable 0 onto stack
- callvirt instance class [System]System.Diagnostics.ProcessStartInfo [System]System.Diagnostics.Process::get_StartInfo() // Call a method associated with obj
- ldc.i4.1 // Push 1 onto the stack as I4
- callvirt instance void [System]System.Diagnostics.ProcessStartInfo::set_RedirectStandardOutput(bool) // Call a method associated with obj
- ldloc.0 // Load local variable 0 onto stack
- callvirt instance class [System]System.Diagnostics.ProcessStartInfo [System]System.Diagnostics.Process::get_StartInfo() // Call a method associated with obj
- ldc.i4.1 // Push 1 onto the stack as I4
- callvirt instance void [System]System.Diagnostics.ProcessStartInfo::set_RedirectStandardError(bool) // Call a method associated with obj
- ldloc.0 // Load local variable 0 onto stack
- callvirt instance class [System]System.Diagnostics.ProcessStartInfo [System]System.Diagnostics.Process::get_StartInfo() // Call a method associated with obj
- ldc.i4.1 // Push 1 onto the stack as I4
- callvirt instance void [System]System.Diagnostics.ProcessStartInfo::set_CreateNoWindow(bool) // Call a method associated with obj
- ldloc.0 // Load local variable 0 onto stack
- callvirt instance bool [System]System.Diagnostics.Process::Start() // Call a method associated with obj
- pop // Pop a value from the stack
- ldloc.0 // Load local variable 0 onto stack
- callvirt instance class [mscorlib]System.IO.StreamWriter [System]System.Diagnostics.Process::get_StandardInput() // Call a method associated with obj
- ldarg.1 // Load argument 1 onto stack
- ldstr aExit // "&exit"
- call string [mscorlib]System.String::Concat(string, string) // Call a method
- callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string) // Call a method associated with obj
- ldloc.0 // Load local variable 0 onto stack
- callvirt instance class [mscorlib]System.IO.StreamWriter [System]System.Diagnostics.Process::get_StandardInput() // Call a method associated with obj
- ldc.i4.1 // Push 1 onto the stack as I4
- callvirt instance void [mscorlib]System.IO.StreamWriter::set_AutoFlush(bool) // Call a method associated with obj
- ldloc.0 // Load local variable 0 onto stack
- callvirt instance void [System]System.Diagnostics.Process::WaitForExit() // Call a method associated with obj
- ldloc.0 // Load local variable 0 onto stack
- callvirt instance void [System]System.Diagnostics.Process::Close() // Call a method associated with obj
- leave.s loc_5C3 // Exit a protected region of code, short form
- }
- .method public hidebysig instance void Restart()
- {
- .maxstack 8
- ldarg.0 // Load argument 0 onto stack
- ldstr aShutdownRFT0 // "shutdown -r -f -t 0"
- call instance void ShutdownHelper::Exec(string str) // Call a method
- ret // Return from method, possibly returning a value
- }
复制代码
- //自启的部分的代码
- loc_65:
- ldarg.0 // Load argument 0 onto stack
- ldarg.0 // Load argument 0 onto stack
- ldstr asc_1016 // "\"
- callvirt instance int32 [mscorlib]System.String::LastIndexOf(string) // Call a method associated with obj
- ldc.i4.1 // Push 1 onto the stack as I4
- add // Add two values, returning a new value
- callvirt instance string [mscorlib]System.String::Substring(int32) // Call a method associated with obj
- stloc.1 // Pop value from stack into local variable 1
- ldsfld class [mscorlib]Microsoft.Win32.RegistryKey [mscorlib]Microsoft.Win32.Registry::LocalMachine // Push the value of field on the stack
- ldstr aSoftwareMicros // "SOFTWARE\\Microsoft\\Windows\\CurrentVe"...
- ldc.i4.1 // Push 1 onto the stack as I4
- callvirt instance class [mscorlib]Microsoft.Win32.RegistryKey [mscorlib]Microsoft.Win32.RegistryKey::OpenSubKey(string, bool) // Call a method associated with obj
- stloc.0 // Pop value from stack into local variable 0
- ldloc.0 // Load local variable 0 onto stack
- brtrue.s loc_9D // Branch to target if value is non-zero (true), short form
复制代码
总结:重启直接调CMD大法好,或许设置注册表也可以。直接搞一个多线程,让卡巴反应不过来。
|