├── .gitattributes ├── AssemblyInfo.cs ├── Program.cs ├── README.md ├── app.config ├── simple-debugger.csproj └── simple-debugger.sln /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | [assembly: AssemblyTitle("SimpleDebugger")] 5 | [assembly: AssemblyDescription("")] 6 | [assembly: AssemblyConfiguration("")] 7 | [assembly: AssemblyCompany("")] 8 | [assembly: AssemblyProduct("SimpleDebugger")] 9 | [assembly: AssemblyCopyright("Copyright © 2017")] 10 | [assembly: AssemblyTrademark("")] 11 | [assembly: ComVisible(false)] 12 | [assembly: Guid("340d61fd-ef4c-4466-8772-aaae36de3cbd")] 13 | [assembly: AssemblyFileVersion("1.0.0.0")] 14 | [assembly: AssemblyVersion("1.0.0.0")] 15 | -------------------------------------------------------------------------------- /Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Win32; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Diagnostics; 5 | using System.Linq; 6 | using System.Reflection; 7 | using System.Runtime.InteropServices; 8 | using System.Text.RegularExpressions; 9 | using System.Threading; 10 | 11 | namespace SimpleDebugger 12 | { 13 | internal static class Program 14 | { 15 | private const string TargetProcessName = "LeagueClientUx.exe"; 16 | 17 | private static void Main(string[] args) 18 | { 19 | if (args.Length == 0) 20 | { 21 | Program.Menu(); 22 | } 23 | else 24 | { 25 | Program.AllocConsole(); 26 | string lpApplicationName = args[0]; 27 | string input = "\"" + ((IEnumerable)args).Skip(1).Aggregate((Func)((x, y) => x + "\" \"" + y)) + "\""; 28 | string str = Regex.Match(input, "(\"--remoting-auth-token=)([^\"]*)(\")").Groups[2].Value; 29 | Console.WriteLine("Using Port: " + int.Parse(Regex.Match(input, "(\"--app-port=)([^\"]*)(\")").Groups[2].Value).ToString()); 30 | Console.WriteLine("Using Auth: " + str); 31 | Console.WriteLine("CurrentDir: " + Environment.CurrentDirectory); 32 | Console.WriteLine(new string('-', Console.BufferWidth - 1)); 33 | Console.WriteLine("App: " + lpApplicationName); 34 | Console.WriteLine("Args: " + input); 35 | string lpCommandLine = input.Replace("\"--no-proxy-server\"", ""); 36 | Console.WriteLine(new string('-', Console.BufferWidth - 1)); 37 | Console.WriteLine("App: " + lpApplicationName); 38 | Console.WriteLine("Args: " + lpCommandLine); 39 | Program.STARTUPINFO lpStartupInfo = new Program.STARTUPINFO(); 40 | Program.PROCESS_INFORMATION lpProcessInformation; 41 | 42 | 43 | //if (!Program.CreateProcess(lpApplicationName, lpCommandLine, IntPtr.Zero, IntPtr.Zero, false, 2U, IntPtr.Zero, (string) null, ref lpStartupInfo, out lpProcessInformation)) 44 | // throw new Win32Exception(); 45 | 46 | 47 | try 48 | { 49 | Program.CreateProcess(lpApplicationName, lpCommandLine, IntPtr.Zero, IntPtr.Zero, true, 1U, IntPtr.Zero, (string)null, ref lpStartupInfo, out lpProcessInformation); 50 | Program.DebugActiveProcessStop(lpProcessInformation.dwProcessId); 51 | Process.GetProcessById(lpProcessInformation.dwProcessId).WaitForExit(); 52 | } 53 | catch (Exception ex) 54 | { 55 | 56 | Console.WriteLine(ex.ToString()); 57 | 58 | } 59 | 60 | 61 | Console.WriteLine("LeagueClientUx.exe quit."); 62 | Thread.Sleep(3000); 63 | } 64 | } 65 | 66 | private static void Menu() 67 | { 68 | Program.AllocConsole(); 69 | RegistryKey registryKey = (RegistryKey)null; 70 | string location = Assembly.GetExecutingAssembly().Location; 71 | try 72 | { 73 | registryKey = Registry.LocalMachine.CreateSubKey("Software\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\LeagueClientUx.exe"); 74 | } 75 | catch (UnauthorizedAccessException ex) 76 | { 77 | try 78 | { 79 | new Process() 80 | { 81 | StartInfo = { 82 | FileName = Assembly.GetExecutingAssembly().Location, 83 | UseShellExecute = true, 84 | Verb = "runas" 85 | } 86 | }.Start(); 87 | Environment.Exit(0); 88 | } 89 | catch 90 | { 91 | Console.WriteLine("Access denied."); 92 | Thread.Sleep(1000); 93 | Environment.Exit(1); 94 | } 95 | } 96 | int num = 0; 97 | label_31: 98 | Console.Clear(); 99 | Console.ResetColor(); 100 | Console.CursorVisible = false; 101 | Console.Write("Currently hooked to: "); 102 | string str = (registryKey?.GetValue("debugger") ?? (object)"Nothing.").ToString().Replace(location, "This program."); 103 | if (str == "This program.") 104 | Console.ForegroundColor = ConsoleColor.Green; 105 | else if (str != "Nothing.") 106 | Console.ForegroundColor = ConsoleColor.Red; 107 | Console.WriteLine(str); 108 | if (num == 0) 109 | Console.ForegroundColor = ConsoleColor.White; 110 | else 111 | Console.ResetColor(); 112 | Console.WriteLine((num == 0 ? "-->" : " ") + " Register LeagueClientUx.exe debugger IEFO."); 113 | if (num == 1) 114 | Console.ForegroundColor = ConsoleColor.White; 115 | else 116 | Console.ResetColor(); 117 | Console.WriteLine((num == 1 ? "-->" : " ") + " Unregister LeagueClientUx.exe debugger IEFO."); 118 | if (num == 2) 119 | Console.ForegroundColor = ConsoleColor.White; 120 | else 121 | Console.ResetColor(); 122 | Console.WriteLine((num == 2 ? "-->" : " ") + " Exit."); 123 | bool flag = false; 124 | while (!flag) 125 | { 126 | switch (Console.ReadKey(true).Key) 127 | { 128 | case ConsoleKey.Enter: 129 | flag = true; 130 | switch (num) 131 | { 132 | case 0: 133 | if (registryKey != null) 134 | { 135 | registryKey.SetValue("debugger", (object)location); 136 | continue; 137 | } 138 | continue; 139 | case 1: 140 | if (registryKey != null) 141 | { 142 | registryKey.DeleteValue("debugger"); 143 | continue; 144 | } 145 | continue; 146 | case 2: 147 | Environment.Exit(0); 148 | continue; 149 | default: 150 | continue; 151 | } 152 | case ConsoleKey.UpArrow: 153 | if (num != (num = Math.Max(num - 1, 0))) 154 | { 155 | flag = true; 156 | continue; 157 | } 158 | continue; 159 | case ConsoleKey.DownArrow: 160 | if (num != (num = Math.Min(num + 1, 2))) 161 | { 162 | flag = true; 163 | continue; 164 | } 165 | continue; 166 | default: 167 | continue; 168 | } 169 | } 170 | goto label_31; 171 | } 172 | 173 | [DllImport("kernel32.dll")] 174 | [return: MarshalAs(UnmanagedType.Bool)] 175 | private static extern bool AllocConsole(); 176 | 177 | [DllImport("kernel32.dll")] 178 | [return: MarshalAs(UnmanagedType.Bool)] 179 | public static extern bool DebugActiveProcessStop([In] int Pid); 180 | 181 | [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] 182 | private static extern bool CreateProcess( 183 | string lpApplicationName, 184 | string lpCommandLine, 185 | IntPtr lpProcessAttributes, 186 | IntPtr lpThreadAttributes, 187 | bool bInheritHandles, 188 | uint dwCreationFlags, 189 | IntPtr lpEnvironment, 190 | string lpCurrentDirectory, 191 | [In] ref Program.STARTUPINFO lpStartupInfo, 192 | out Program.PROCESS_INFORMATION lpProcessInformation); 193 | 194 | private struct PROCESS_INFORMATION 195 | { 196 | public IntPtr hProcess; 197 | public IntPtr hThread; 198 | public int dwProcessId; 199 | public int dwThreadId; 200 | } 201 | 202 | private struct STARTUPINFO 203 | { 204 | public uint cb; 205 | public string lpReserved; 206 | public string lpDesktop; 207 | public string lpTitle; 208 | public uint dwX; 209 | public uint dwY; 210 | public uint dwXSize; 211 | public uint dwYSize; 212 | public uint dwXCountChars; 213 | public uint dwYCountChars; 214 | public uint dwFillAttribute; 215 | public uint dwFlags; 216 | public short wShowWindow; 217 | public short cbReserved2; 218 | public IntPtr lpReserved2; 219 | public IntPtr hStdInput; 220 | public IntPtr hStdOutput; 221 | public IntPtr hStdError; 222 | } 223 | } 224 | } 225 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # simple-debugger 2 | 3 | Allow debugging LCU API calls via Fiddler 4 | 5 | ## UPDATE 6 | 4th May 2023: To build do not use AnyCPU, make sure it is set to x64 release ! 7 | 8 | ## 9 | Remember to: 10 | * Wait for the client to open 11 | * Run Fiddler as Administrator 12 | * Tool > Options > tick "Decrypt https traffic" 13 | 14 | ![immagine](https://user-images.githubusercontent.com/8062792/159447174-361b8a65-6fb6-4413-b4c5-73beece4b9fd.png) 15 | 16 | Now you will be able to see api calls from 127.0.0.1:PORT 17 | 18 | I recommend adding this ``127.0.0.1;`` in the Hosts (Filters tab) and "Show only the following Hosts" 19 | 20 | or you will get spammed by everything. If you want to see the store's calls, disable the filter. 21 | 22 | ![immagine](https://user-images.githubusercontent.com/8062792/159447749-f6bc42eb-01d5-470a-8621-8baf7e3acde0.png) 23 | 24 | -------------------------------------------------------------------------------- /app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /simple-debugger.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | {E6B133F7-82EA-4E02-8E14-F19F89E1130F} 7 | WinExe 8 | SimpleDebugger 9 | v4.8 10 | 1.0.0.0 11 | 512 12 | SimpleDebugger 13 | 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | true 36 | bin\x64\Debug\ 37 | DEBUG;TRACE 38 | full 39 | x64 40 | 7.3 41 | prompt 42 | true 43 | 44 | 45 | bin\x64\Release\ 46 | TRACE 47 | true 48 | pdbonly 49 | x64 50 | 7.3 51 | prompt 52 | true 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /simple-debugger.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio Version 17 3 | VisualStudioVersion = 17.5.33530.505 4 | MinimumVisualStudioVersion = 10.0.40219.1 5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "simple-debugger", "simple-debugger.csproj", "{E6B133F7-82EA-4E02-8E14-F19F89E1130F}" 6 | EndProject 7 | Global 8 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 9 | Debug|x64 = Debug|x64 10 | Release|x64 = Release|x64 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {E6B133F7-82EA-4E02-8E14-F19F89E1130F}.Debug|x64.ActiveCfg = Debug|x64 14 | {E6B133F7-82EA-4E02-8E14-F19F89E1130F}.Debug|x64.Build.0 = Debug|x64 15 | {E6B133F7-82EA-4E02-8E14-F19F89E1130F}.Release|x64.ActiveCfg = Release|x64 16 | {E6B133F7-82EA-4E02-8E14-F19F89E1130F}.Release|x64.Build.0 = Release|x64 17 | EndGlobalSection 18 | GlobalSection(SolutionProperties) = preSolution 19 | HideSolutionNode = FALSE 20 | EndGlobalSection 21 | EndGlobal 22 | --------------------------------------------------------------------------------