├── Sharprompt-2.3.0
├── .gitattributes
├── .github
│ ├── FUNDING.yml
│ └── workflows
│ │ ├── build.yml
│ │ └── publish.yml
├── Sharprompt
│ ├── ConfirmOptions.cs
│ ├── PasswordOptions.cs
│ ├── InputOptions.cs
│ ├── SelectOptions.cs
│ ├── ListOptions.cs
│ ├── MultiSelectOptions.cs
│ ├── Internal
│ │ ├── NativeMethods.cs
│ │ ├── Optional.cs
│ │ ├── ValidationAttributeAdapter.cs
│ │ ├── EnumValue.cs
│ │ ├── Paginator.cs
│ │ └── OffscreenBuffer.cs
│ ├── Drivers
│ │ ├── IConsoleDriver.cs
│ │ └── DefaultConsoleDriver.cs
│ ├── Symbol.cs
│ ├── Sharprompt.csproj
│ ├── Prompt.Customize.cs
│ ├── Forms
│ │ ├── FormRenderer.cs
│ │ ├── FormBase.cs
│ │ ├── PasswordForm.cs
│ │ ├── SelectForm.cs
│ │ ├── ConfirmForm.cs
│ │ ├── InputForm.cs
│ │ ├── ListForm.cs
│ │ └── MultiSelectForm.cs
│ ├── Validators.cs
│ ├── Prompt.AutoForms.cs
│ └── Prompt.Basic.cs
├── Sharprompt.Example
│ ├── ExampleType.cs
│ ├── Sharprompt.Example.csproj
│ ├── Models
│ │ ├── MyEnum.cs
│ │ └── MyFormModel.cs
│ └── Program.cs
├── LICENSE
├── Sharprompt.sln
├── README.md
├── .editorconfig
└── .gitignore
├── Dis2Msil
├── Dis2Msil.Test
│ ├── App.config
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── Dis2Msil.Test.csproj
├── Dis2Msil
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Dis2Msil.csproj
│ ├── Globals.cs
│ ├── ILInstruction.cs
│ └── MethodBodyReader.cs
└── Dis2Msil.sln
├── JITK
├── Core
│ ├── SJITHook
│ │ ├── VTableAddrProvider.cs
│ │ ├── ClrjitAddrProvider.cs
│ │ ├── MscorjitAddrProvider.cs
│ │ ├── JITHook.cs
│ │ ├── JITHook64.cs
│ │ └── Data.cs
│ ├── Command
│ │ ├── Clear.cs
│ │ ├── Quit.cs
│ │ ├── Command.cs
│ │ ├── FileClear.cs
│ │ ├── DisasH.cs
│ │ ├── About.cs
│ │ ├── FileArgument.cs
│ │ ├── ListBreakpoint.cs
│ │ ├── Help.cs
│ │ ├── FileAssign.cs
│ │ ├── StepFuncG.cs
│ │ ├── InfoF.cs
│ │ ├── DefBreakPoint.cs
│ │ ├── InfoA.cs
│ │ ├── Disas.cs
│ │ ├── Continue.cs
│ │ └── CommandEngine.cs
│ ├── Style.cs
│ └── Context.cs
├── packages.config
├── App.config
├── Properties
│ └── AssemblyInfo.cs
├── Program.cs
└── JITK.csproj
├── README.md
├── JITK.sln
├── .gitattributes
└── .gitignore
/Sharprompt-2.3.0/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/Sharprompt-2.3.0/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: shibayan
4 |
--------------------------------------------------------------------------------
/Dis2Msil/Dis2Msil.Test/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Sharprompt-2.3.0/Sharprompt/ConfirmOptions.cs:
--------------------------------------------------------------------------------
1 | namespace Sharprompt
2 | {
3 | public class ConfirmOptions
4 | {
5 | public string Message { get; set; }
6 |
7 | public bool? DefaultValue { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/JITK/Core/SJITHook/VTableAddrProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace JITK.Core.SJITHook
4 | {
5 | public abstract class VTableAddrProvider
6 | {
7 | internal delegate IntPtr GetJit();
8 | public abstract IntPtr VTableAddr { get; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/JITK/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Sharprompt-2.3.0/Sharprompt.Example/ExampleType.cs:
--------------------------------------------------------------------------------
1 | namespace Sharprompt.Example
2 | {
3 | public enum ExampleType
4 | {
5 | Input,
6 | Confirm,
7 | Password,
8 | Select,
9 | MultiSelect,
10 | SelectWithEnum,
11 | MultiSelectWithEnum,
12 | List,
13 | AutoForms
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Sharprompt-2.3.0/Sharprompt.Example/Sharprompt.Example.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net5.0
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Sharprompt-2.3.0/Sharprompt/PasswordOptions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.DataAnnotations;
4 |
5 | namespace Sharprompt
6 | {
7 | public class PasswordOptions
8 | {
9 | public string Message { get; set; }
10 |
11 | public IList> Validators { get; } = new List>();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/JITK/Core/Command/Clear.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace JITK.Core.Command
4 | {
5 | class Clear : Command
6 | {
7 | override public string HelpText { get { return "Clear Console"; } }
8 | override public string Name { get { return "clear"; } }
9 | override public ArgumentSize ArgSize { get { return ArgumentSize.None; } }
10 | override public void Action()
11 | {
12 | Console.Clear();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Sharprompt-2.3.0/Sharprompt/InputOptions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.DataAnnotations;
4 |
5 | namespace Sharprompt
6 | {
7 | public class InputOptions
8 | {
9 | public string Message { get; set; }
10 |
11 | public object DefaultValue { get; set; }
12 |
13 | public IList> Validators { get; } = new List>();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/JITK/Core/Command/Quit.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace JITK.Core.Command
4 | {
5 | class Quit : Command
6 | {
7 | override public string HelpText { get { return "Suspend JIT Killer"; } }
8 | override public string Name { get { return "quit"; } }
9 | override public ArgumentSize ArgSize { get { return ArgumentSize.None; } }
10 | override public void Action()
11 | {
12 | Environment.Exit(0);
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Sharprompt-2.3.0/Sharprompt.Example/Models/MyEnum.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 |
3 | namespace Sharprompt.Example.Models
4 | {
5 | public enum MyEnum
6 | {
7 | [Display(Name = "Foo value", Order = 3)]
8 | Foo,
9 |
10 | [Display(Name = "Bar value", Order = 2)]
11 | Bar,
12 |
13 | [Display(Name = "Baz value", Order = 1)]
14 | Baz,
15 |
16 | [Display(Name = "Test value")]
17 | Test
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Sharprompt-2.3.0/Sharprompt/SelectOptions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Sharprompt
5 | {
6 | public class SelectOptions
7 | {
8 | public string Message { get; set; }
9 |
10 | public IEnumerable Items { get; set; }
11 |
12 | public object DefaultValue { get; set; }
13 |
14 | public int? PageSize { get; set; }
15 |
16 | public Func TextSelector { get; set; } = x => x.ToString();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/JITK/Core/Command/Command.cs:
--------------------------------------------------------------------------------
1 | namespace JITK.Core.Command
2 | {
3 | public enum ArgumentSize
4 | {
5 | None, //No argument
6 | Single,
7 | Poly, //More argument
8 | Opt //Optional argument
9 | }
10 | public abstract class Command
11 | {
12 | abstract public string HelpText { get; }
13 | abstract public string Name { get; }
14 | abstract public ArgumentSize ArgSize { get; }
15 | abstract public void Action();
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/JITK/Core/Command/FileClear.cs:
--------------------------------------------------------------------------------
1 | namespace JITK.Core.Command
2 | {
3 | class FileClear : Command
4 | {
5 | override public string HelpText { get { return "Path Clear"; } }
6 | override public string Name { get { return "fc"; } }
7 | override public ArgumentSize ArgSize { get { return ArgumentSize.None; } }
8 | override public void Action()
9 | {
10 | Context.filePath = "";
11 | Style.WriteFormatted("[^] filePath Cleaned.\n");
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/JITK/Core/Command/DisasH.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace JITK.Core.Command
4 | {
5 | class DisasH : Command
6 | {
7 | override public string HelpText { get { return "Print method body as hex"; } }
8 | override public string Name { get { return "disash"; } }
9 | override public ArgumentSize ArgSize { get { return ArgumentSize.None; } }
10 | override public void Action()
11 | {
12 | Console.WriteLine(Context.currentMethodBody);
13 |
14 | }
15 |
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/JITK/Core/Command/About.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace JITK.Core.Command
4 | {
5 | class About : Command
6 | {
7 | override public string HelpText { get { return "About JITK"; } }
8 | override public string Name { get { return "about"; } }
9 | override public ArgumentSize ArgSize { get { return ArgumentSize.None; } }
10 | override public void Action()
11 | {
12 | Style.WriteFormatted("JITK - JIT Killer is hooker for clrjit. Created by rhotav \n github.com/rhotav \n", ConsoleColor.Blue);
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/JITK/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Sharprompt-2.3.0/Sharprompt/ListOptions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.DataAnnotations;
4 |
5 | namespace Sharprompt
6 | {
7 | public class ListOptions
8 | {
9 | public string Message { get; set; }
10 |
11 | public IEnumerable DefaultValues { get; set; }
12 |
13 | public int Minimum { get; set; } = 1;
14 |
15 | public int Maximum { get; set; } = int.MaxValue;
16 |
17 | public IList> Validators { get; } = new List>();
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Sharprompt-2.3.0/Sharprompt/MultiSelectOptions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Sharprompt
5 | {
6 | public class MultiSelectOptions
7 | {
8 | public string Message { get; set; }
9 |
10 | public IEnumerable Items { get; set; }
11 |
12 | public IEnumerable DefaultValues { get; set; }
13 |
14 | public int? PageSize { get; set; }
15 |
16 | public int Minimum { get; set; } = 1;
17 |
18 | public int Maximum { get; set; } = int.MaxValue;
19 |
20 | public Func TextSelector { get; set; } = x => x.ToString();
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/JITK/Core/Command/FileArgument.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace JITK.Core.Command
4 | {
5 | class FileArgument : Command
6 | {
7 | override public string HelpText { get { return "Assign File Argument/s"; } }
8 | override public string Name { get { return "fg"; } }
9 | override public ArgumentSize ArgSize { get { return ArgumentSize.Poly; } }
10 | override public void Action()
11 | {
12 | foreach (string arguments in CommandEngine.arg)
13 | {
14 | Context.arguments += $"{arguments} ";
15 | }
16 | Style.WriteFormatted($"[^] Arguments assigned.\n");
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Sharprompt-2.3.0/Sharprompt/Internal/NativeMethods.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace Sharprompt.Internal
5 | {
6 | internal static class NativeMethods
7 | {
8 | public const int STD_OUTPUT_HANDLE = -11;
9 | public const int ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004;
10 |
11 | [DllImport("kernel32.dll")]
12 | public static extern IntPtr GetStdHandle(int nStdHandle);
13 |
14 | [DllImport("kernel32.dll")]
15 | public static extern bool GetConsoleMode(IntPtr hConsoleHandle, out int dwMode);
16 |
17 | [DllImport("kernel32.dll")]
18 | public static extern bool SetConsoleMode(IntPtr hConsoleHandle, int dwMode);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/JITK/Core/Command/ListBreakpoint.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using JITK.Core;
3 | using System.Collections.Generic;
4 |
5 | namespace JITK.Core.Command
6 | {
7 | class ListBreakpoint : Command
8 | {
9 | override public string HelpText { get { return "List All Breakpoint"; } }
10 | override public string Name { get { return "bl"; } }
11 | override public ArgumentSize ArgSize { get { return ArgumentSize.None; } }
12 | override public void Action()
13 | {
14 | foreach (KeyValuePair bps in Context.breakPoints)
15 | {
16 | Style.WriteFormatted($"ID: {bps.Key} -- Token: {bps.Value}\n", ConsoleColor.DarkGray);
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/JITK/Core/Command/Help.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace JITK.Core.Command
5 | {
6 | class Help : Command
7 | {
8 | override public string HelpText { get { return "Help"; } }
9 | override public string Name { get { return "help"; } }
10 | override public ArgumentSize ArgSize { get { return ArgumentSize.None; } }
11 | override public void Action()
12 | {
13 | string result = "";
14 | foreach (KeyValuePair com in CommandEngine.commands)
15 | {
16 | result += com.Key + " -- " + com.Value.HelpText + " \n";
17 | }
18 | Style.WriteFormatted(result);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/JITK/Core/SJITHook/ClrjitAddrProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace JITK.Core.SJITHook
5 | {
6 | public sealed class ClrjitAddrProvider : VTableAddrProvider
7 | {
8 | [DllImport("Clrjit.dll", CallingConvention = CallingConvention.StdCall, PreserveSig = true)]
9 | private static extern IntPtr getJit();
10 |
11 | public override IntPtr VTableAddr
12 | {
13 | get
14 | {
15 | IntPtr pVTable = getJit();
16 | if (pVTable == IntPtr.Zero)
17 | throw new Exception("Could not retrieve address for getJit");
18 |
19 | return pVTable;
20 | }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/JITK/Core/SJITHook/MscorjitAddrProvider.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace JITK.Core.SJITHook
5 | {
6 | public sealed class MscorjitAddrProvider : VTableAddrProvider
7 | {
8 | [DllImport("mscorjit.dll", CallingConvention = CallingConvention.StdCall, PreserveSig = true)]
9 | private static extern IntPtr getJit();
10 |
11 | public override IntPtr VTableAddr
12 | {
13 | get
14 | {
15 | IntPtr pVTable = getJit();
16 | if (pVTable == IntPtr.Zero)
17 | throw new Exception("Could not retrieve address for getJit");
18 |
19 | return pVTable;
20 | }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Sharprompt-2.3.0/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Build
2 |
3 | on:
4 | push:
5 | branches: [ master ]
6 | pull_request:
7 | branches: [ master ]
8 |
9 | env:
10 | DOTNET_VERSION: 5.0.x
11 |
12 | jobs:
13 | build:
14 | runs-on: ubuntu-latest
15 | steps:
16 | - uses: actions/checkout@v2
17 |
18 | - name: Use .NET Core ${{ env.DOTNET_VERSION }}
19 | uses: actions/setup-dotnet@v1
20 | with:
21 | dotnet-version: ${{ env.DOTNET_VERSION }}
22 |
23 | - name: Install .NET Core format tool
24 | run: dotnet tool update -g dotnet-format
25 |
26 | - name: Build project
27 | run: dotnet build -c Release
28 |
29 | - name: Lint C# code
30 | run: dotnet format --check --verbosity detailed
31 |
--------------------------------------------------------------------------------
/Sharprompt-2.3.0/Sharprompt/Drivers/IConsoleDriver.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Sharprompt.Drivers
4 | {
5 | internal interface IConsoleDriver : IDisposable
6 | {
7 | void Beep();
8 | void Reset();
9 | void ClearLine(int top);
10 | ConsoleKeyInfo ReadKey();
11 | void Write(string value, ConsoleColor color);
12 | void WriteLine();
13 | (int left, int top) GetCursorPosition();
14 | void SetCursorPosition(int left, int top);
15 | bool KeyAvailable { get; }
16 | bool CursorVisible { get; set; }
17 | int CursorLeft { get; }
18 | int CursorTop { get; }
19 | int BufferWidth { get; }
20 | int BufferHeight { get; }
21 | Action RequestCancellation { get; set; }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Sharprompt-2.3.0/Sharprompt/Internal/Optional.cs:
--------------------------------------------------------------------------------
1 | namespace Sharprompt.Internal
2 | {
3 | internal readonly struct Optional
4 | {
5 | public Optional(T value)
6 | {
7 | HasValue = true;
8 | Value = value;
9 | }
10 |
11 | public bool HasValue { get; }
12 |
13 | public T Value { get; }
14 |
15 | public static implicit operator T(Optional optional) => optional.Value;
16 |
17 | public static readonly Optional Empty = new Optional();
18 |
19 | public static Optional Create(T value)
20 | {
21 | return value == null ? Empty : new Optional(value);
22 | }
23 |
24 | public static Optional Create(object value)
25 | {
26 | return value == null ? Empty : new Optional((T)value);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/JITK/Core/Command/FileAssign.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace JITK.Core.Command
4 | {
5 | class FileAssign : Command
6 | {
7 | override public string HelpText { get { return "Assign File"; } }
8 | override public string Name { get { return "f"; } }
9 | override public ArgumentSize ArgSize { get { return ArgumentSize.Single; } }
10 | override public void Action()
11 | {
12 | if (Context.IsNet(CommandEngine.arg[0]))
13 | {
14 | Context.filePath = CommandEngine.arg[0];
15 | Style.WriteFormatted($"[^] {Context.filePath} assigned to the file path.\n");
16 | }
17 | else
18 | {
19 | Style.WriteFormatted("[!] Upss! This file is not .NET! Please specify another assembly!", ConsoleColor.Red);
20 | }
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Sharprompt-2.3.0/.github/workflows/publish.yml:
--------------------------------------------------------------------------------
1 | name: Publish
2 |
3 | on:
4 | push:
5 | tags: [ v* ]
6 |
7 | env:
8 | DOTNET_VERSION: 5.0.x
9 |
10 | jobs:
11 | publish:
12 | runs-on: ubuntu-latest
13 | steps:
14 | - uses: actions/checkout@v2
15 |
16 | - name: Use .NET Core ${{ env.DOTNET_VERSION }}
17 | uses: actions/setup-dotnet@v1
18 | with:
19 | dotnet-version: ${{ env.DOTNET_VERSION }}
20 |
21 | - name: Setup Version
22 | id: setup_version
23 | run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
24 |
25 | - name: Pack NuGet Package
26 | run: dotnet pack Sharprompt/Sharprompt.csproj -c Release -o ./dist -p:Version=${{ steps.setup_version.outputs.VERSION }}
27 |
28 | - name: Publish
29 | run: dotnet nuget push dist/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
30 |
--------------------------------------------------------------------------------
/Sharprompt-2.3.0/Sharprompt/Symbol.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace Sharprompt
5 | {
6 | public class Symbol
7 | {
8 | public Symbol(string value, string fallbackValue)
9 | {
10 | _value = value;
11 | _fallbackValue = fallbackValue;
12 | }
13 |
14 | private readonly string _value;
15 | private readonly string _fallbackValue;
16 |
17 | public override string ToString()
18 | {
19 | return IsUnicodeSupported ? _value : _fallbackValue;
20 | }
21 |
22 | public static implicit operator string(Symbol symbol) => symbol.ToString();
23 |
24 | private static bool IsUnicodeSupported => !RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || Console.OutputEncoding.CodePage == 1200 || Console.OutputEncoding.CodePage == 65001;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Sharprompt-2.3.0/Sharprompt/Internal/ValidationAttributeAdapter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel.DataAnnotations;
3 |
4 | namespace Sharprompt.Internal
5 | {
6 | internal class ValidationAttributeAdapter
7 | {
8 | public ValidationAttributeAdapter(ValidationAttribute validationAttribute)
9 | {
10 | _validationAttribute = validationAttribute;
11 | }
12 |
13 | private readonly ValidationAttribute _validationAttribute;
14 |
15 | public Func