This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static byte[] AES_Decrypt_block(byte[] cipherText, byte[] Key) | |
{ | |
// Declare the string used to hold the decrypted text. | |
byte[] output_buffer = new byte[cipherText.Length]; | |
using (AesManaged aesAlg = new AesManaged()) | |
{ | |
//If CBC, must initialize IV = O_{128} | |
//aesAlg.Mode = CipherMode.CBC; | |
//aesAlg.IV = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var result = Math.AddNumbers(10, 20); | |
Console.WriteLine(result); | |
Console.ReadKey(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Text; | |
using System.Security.Cryptography; | |
using System.Runtime.Serialization.Formatters.Binary; | |
class AESEnDecryption | |
{ | |
public static byte[] encrypt(byte[] bytes, string keyStr, string ivStr) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class MethodInvoker | |
{ | |
public static object InvokeMethod(string methodName, object[] paramaters = null) | |
{ | |
MethodInfo method = ResolveMethodWithName(methodName); | |
if (method == null) | |
throw new InvalidOperationException("A method with the name " + methodName + " cannot be found."); | |
if (method.IsStatic) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static partial class Util | |
{ | |
const string kDelegateInvokeMethodName = "Invoke"; | |
// http://www.codeproject.com/Tips/441743/A-look-at-marshalling-delegates-in-NET | |
public static T GetDelegateForFunctionPointer<T>(IntPtr ptr, System.Runtime.InteropServices.CallingConvention call_conv) | |
where T : class | |
{ | |
Contract.Requires<ArgumentException>(typeof(T).IsSubclassOf(typeof(Delegate))); | |
Contract.Requires<ArgumentNullException>(ptr != IntPtr.Zero); | |
Contract.Requires<ArgumentException>(call_conv != System.Runtime.InteropServices.CallingConvention.ThisCall, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Reflection; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Threading; | |
using System.Diagnostics; | |
namespace MyProgram | |
{ | |
class Program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
using System.Threading; | |
namespace NetCallerFunc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Trick to run arbitrary command when code execution policy is enforced | |
* (i.e. AppLocker or equivalent). Works on Win98 (lol) and up - tested on 7/8 | |
* | |
* To compile using CL as DLL: | |
* C:> cl.exe RunMe.c /LD /OUT:RunMe.dll | |
* To compile as PE (USE_DLL must be commented out): | |
* C:> cl.exe RunMe.c /OUT:RunMe.exe | |
* | |
* To execute under Windows: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Change Log: | |
v1.12 (2017-01-18) - Fixed OnExit not exiting | |
v1.11 (2017-01-17) - Added an internal function Ensure_Admin_And_Compiled() | |
v1.10 (2015-10-22) - Added support for sending characters that needs to press {shift} key, such as "@" or "A". | |
v1.00 (2015-07-25) | |
Dependency files: | |
WinRing0_v1.3.1.19.zip -- https://drive.google.com/file/d/0B7yNOlCgfluzMTE2UFc2ZHp5Z1E/view?usp=sharing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal static class NativeMethods { | |
public static void PreventSleep() { | |
SetThreadExecutionState(ExecutionState.EsContinuous | ExecutionState.EsSystemRequired); | |
} | |
public static void AllowSleep() { | |
SetThreadExecutionState(ExecutionState.EsContinuous); | |
} |
OlderNewer