├── BlackMagic
├── BlackMagicTest
│ ├── Properties
│ │ ├── .svn
│ │ │ ├── format
│ │ │ ├── all-wcprops
│ │ │ ├── entries
│ │ │ └── text-base
│ │ │ │ └── AssemblyInfo.cs.svn-base
│ │ └── AssemblyInfo.cs
│ ├── app.config
│ ├── Program.cs
│ └── BlackMagicTest.csproj
├── README.md
├── BlackMagic
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── BMInject.cs
│ ├── BMPattern.cs
│ ├── BMThread.cs
│ ├── BlackMagic.csproj
│ ├── Static Classes
│ │ ├── SProcess.cs
│ │ ├── SThread.cs
│ │ ├── SInject.cs
│ │ ├── SWindow.cs
│ │ └── SPattern.cs
│ ├── BMMain.cs
│ └── BMMemory.cs
└── BlackMagic.sln
├── Fasm
├── README.md
├── fasmdll_managed
│ ├── defines.h
│ ├── fasmdll_managed.vcxproj.filters
│ ├── AssemblyInfo.cpp
│ ├── fasmdll_managed.h
│ ├── fasmdll_managed.vcproj
│ ├── fasmdll_managed.vcxproj
│ └── fasmdll_managed.cpp
├── test_fasmdll_managed
│ ├── app.config
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ └── test_fasmdll_managed.csproj
├── LICENSE.TXT
└── fasmdll_managed.sln
├── WoWBot
├── App.config
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── Common
│ ├── Descriptors.cs
│ ├── Memory.cs
│ └── Offsets.cs
├── App.xaml
├── App.xaml.cs
├── Engines
│ └── FishingEngine.cs
├── MainWindow.xaml
├── Manager
│ ├── Wow
│ │ └── PObject.cs
│ └── ObjectManager.cs
├── MainWindow.xaml.cs
└── Nabot.csproj
├── .gitattributes
├── WoWBot.sln
└── .gitignore
/BlackMagic/BlackMagicTest/Properties/.svn/format:
--------------------------------------------------------------------------------
1 | 8
2 |
--------------------------------------------------------------------------------
/Fasm/README.md:
--------------------------------------------------------------------------------
1 | fasm
2 | ====
3 | Fasm used in Blackmagic
--------------------------------------------------------------------------------
/BlackMagic/README.md:
--------------------------------------------------------------------------------
1 | Blackmagic
2 | ==========
3 | Memory reader library
--------------------------------------------------------------------------------
/Fasm/fasmdll_managed/defines.h:
--------------------------------------------------------------------------------
1 | #define FASM_OK 0
2 | #define FASM_WORKING 1
3 | #define FASM_ERROR 2
4 |
5 | #define DEFAULT_MEMORY_SIZE 0x1000
6 | #define DEFAULT_PASS_LIMIT 100
--------------------------------------------------------------------------------
/BlackMagic/BlackMagicTest/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Fasm/test_fasmdll_managed/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/WoWBot/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/WoWBot/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/WoWBot/Common/Descriptors.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace WoWBot.Common
8 | {
9 | class Descriptors
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/BlackMagic/BlackMagicTest/Properties/.svn/all-wcprops:
--------------------------------------------------------------------------------
1 | K 25
2 | svn:wc:ra_dav:version-url
3 | V 65
4 | /svn/Shynd_BlackMagic/!svn/ver/13/trunk/BlackMagicTest/Properties
5 | END
6 | AssemblyInfo.cs
7 | K 25
8 | svn:wc:ra_dav:version-url
9 | V 81
10 | /svn/Shynd_BlackMagic/!svn/ver/13/trunk/BlackMagicTest/Properties/AssemblyInfo.cs
11 | END
12 |
--------------------------------------------------------------------------------
/WoWBot/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WoWBot/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace WoWBot
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/BlackMagic/BlackMagicTest/Properties/.svn/entries:
--------------------------------------------------------------------------------
1 | 8
2 |
3 | dir
4 | 13
5 | http://svn.xp-dev.com/svn/Shynd_BlackMagic/trunk/BlackMagicTest/Properties
6 | http://svn.xp-dev.com/svn/Shynd_BlackMagic
7 |
8 |
9 |
10 | 2008-12-07T22:06:23.157675Z
11 | 13
12 | Shynd
13 |
14 |
15 | svn:special svn:externals svn:needs-lock
16 |
17 | AssemblyInfo.cs
18 | file
19 |
20 |
21 |
22 |
23 | 2008-12-06T19:31:55.390625Z
24 | 2624a48e2286921e95cd7ab7876cb892
25 | 2008-12-07T22:06:23.157675Z
26 | 13
27 | Shynd
28 |
29 |
--------------------------------------------------------------------------------
/Fasm/fasmdll_managed/fasmdll_managed.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 |
14 |
15 | Source Files
16 |
17 |
18 | Source Files
19 |
20 |
21 |
22 |
23 | Header Files
24 |
25 |
26 | Header Files
27 |
28 |
29 |
--------------------------------------------------------------------------------
/WoWBot/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace WoWBot.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/WoWBot/Common/Memory.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Diagnostics;
7 | using Magic;
8 |
9 | namespace WoWBot.Common
10 | {
11 | static class Memory
12 | {
13 | ///
14 | /// Memory Reading Public Instance
15 | ///
16 | public static BlackMagic Wow { get; } = new BlackMagic();
17 |
18 | ///
19 | /// Verifie que BM est attaché à un processus
20 | ///
21 | public static bool IsAttached => Wow.ProcessId > 0;
22 |
23 | ///
24 | /// Adresse de base du jeu
25 | ///
26 | public static IntPtr BaseAddress
27 | {
28 | get
29 | {
30 | if (IsAttached)
31 | {
32 | return Wow.MainModule.BaseAddress;
33 | }
34 | return (IntPtr) null;
35 | }
36 | }
37 |
38 | ///
39 | /// Attache BM à un processus
40 | ///
41 | ///
42 | public static void AttachToProcess(int processId)
43 | {
44 | Wow.OpenProcessAndThread(processId);
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/Fasm/fasmdll_managed/AssemblyInfo.cpp:
--------------------------------------------------------------------------------
1 | using namespace System;
2 | using namespace System::Reflection;
3 | using namespace System::Runtime::CompilerServices;
4 | using namespace System::Runtime::InteropServices;
5 | using namespace System::Security::Permissions;
6 |
7 | //
8 | // General Information about an assembly is controlled through the following
9 | // set of attributes. Change these attribute values to modify the information
10 | // associated with an assembly.
11 | //
12 | [assembly:AssemblyTitleAttribute("fasmdll_managed")];
13 | [assembly:AssemblyDescriptionAttribute("")];
14 | [assembly:AssemblyConfigurationAttribute("")];
15 | [assembly:AssemblyCompanyAttribute("")];
16 | [assembly:AssemblyProductAttribute("fasmdll_managed")];
17 | [assembly:AssemblyCopyrightAttribute("Copyright (c) 2008")];
18 | [assembly:AssemblyTrademarkAttribute("")];
19 | [assembly:AssemblyCultureAttribute("")];
20 |
21 | //
22 | // Version information for an assembly consists of the following four values:
23 | //
24 | // Major Version
25 | // Minor Version
26 | // Build Number
27 | // Revision
28 | //
29 | // You can specify all the value or you can default the Revision and Build Numbers
30 | // by using the '*' as shown below:
31 |
32 | [assembly:AssemblyVersionAttribute("1.0.*")];
33 |
34 | [assembly:ComVisible(false)];
35 |
36 | [assembly:CLSCompliantAttribute(true)];
37 |
38 | [assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];
39 |
--------------------------------------------------------------------------------
/WoWBot/Engines/FishingEngine.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 |
8 | namespace WoWBot.Engines
9 | {
10 | ///
11 | /// Gère la pêche en jeu
12 | ///
13 | static class FishingEngine
14 | {
15 | ///
16 | /// Actif lorsque le moteur de Fishing est activé
17 | ///
18 | private static bool _isFishing = false;
19 |
20 | ///
21 | /// Demarre le thread pour lancé la pêche
22 | ///
23 | internal static Thread _fishingThread = new Thread(Work);
24 |
25 | ///
26 | /// Static Constructor
27 | ///
28 | static FishingEngine()
29 | {
30 | }
31 |
32 | ///
33 | /// Execute la fonction pour pêcher
34 | ///
35 | private static void Work()
36 | {
37 |
38 | }
39 |
40 | ///
41 | /// Démarre / arrête le moteur de Fishing
42 | ///
43 | public static void ToggleFish()
44 | {
45 | if (_isFishing)
46 | {
47 | _fishingThread.Join();
48 | }
49 | else
50 | {
51 | _fishingThread.Start();
52 | }
53 | }
54 |
55 |
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/BlackMagic/BlackMagic/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("BlackMagic")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("BlackMagic")]
13 | [assembly: AssemblyCopyright("Copyright © 2008")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("e5d39287-f28d-439a-a906-f2391259e92a")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/BlackMagic/BlackMagicTest/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("BlackMagicTest")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("BlackMagicTest")]
13 | [assembly: AssemblyCopyright("Copyright © 2008")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("f911051c-953c-4f1e-865f-69cdd180f6f5")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Fasm/test_fasmdll_managed/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Runtime.InteropServices;
6 | using System.Diagnostics;
7 |
8 | namespace test_fasmdll_managed
9 | {
10 | class Program
11 | {
12 | [DllImport("kernel32")]
13 | private static extern IntPtr OpenProcess(uint dwDesiredAccess, bool bInheritHandle, uint dwProcessId);
14 |
15 | [DllImport("kernel32")]
16 | private static extern uint VirtualAllocEx(IntPtr hProcess, uint dwAddress, int nSize, uint dwAllocationType, uint dwProtect);
17 |
18 | [DllImport("kernel32")]
19 | private static extern bool VirtualFreeEx(IntPtr hProcess, uint dwAddress, int nSize, uint dwFreeType);
20 |
21 | static void Main(string[] args)
22 | {
23 | Process.EnterDebugMode();
24 | Process[] wow = Process.GetProcessesByName("WoW");
25 | IntPtr hProcess = OpenProcess(0x1F0FFF, false, (uint)wow[0].Id);
26 |
27 | //allocate memory for codecave
28 | uint dwBaseAddress = VirtualAllocEx(hProcess, 0, 0x1000, 0x1000, 0x40);
29 |
30 | Fasm.ManagedFasm fasm = new Fasm.ManagedFasm(hProcess);
31 | fasm.SetMemorySize(0x500);
32 | //fasm.AddLine("org " + dwBaseAddress.ToString("X")); //not necessary, .Inject does automatically
33 | fasm.AddLine("retn");
34 | fasm.AddLine("jmp 0x410000");
35 | fasm.AddLine("call 0x410000");
36 | byte[] a = fasm.Assemble();
37 |
38 | fasm.InjectAndExecute(hProcess, dwBaseAddress);
39 | fasm.Dispose();
40 |
41 | VirtualFreeEx(hProcess, dwBaseAddress, 0, 0x8000); //release memory
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Fasm/test_fasmdll_managed/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("test_fasmdll_managed")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("test_fasmdll_managed")]
13 | [assembly: AssemblyCopyright("Copyright © 2008")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("65b95ab7-f07e-4804-8352-26d3969bc3be")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/BlackMagic/BlackMagic.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlackMagic", "BlackMagic\BlackMagic.csproj", "{79FD54B0-DEAB-459F-83B9-F1CED68D288B}"
5 | EndProject
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlackMagicTest", "BlackMagicTest\BlackMagicTest.csproj", "{4C938210-4D82-48A1-9A0C-7432C3426073}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {79FD54B0-DEAB-459F-83B9-F1CED68D288B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {79FD54B0-DEAB-459F-83B9-F1CED68D288B}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {79FD54B0-DEAB-459F-83B9-F1CED68D288B}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {79FD54B0-DEAB-459F-83B9-F1CED68D288B}.Release|Any CPU.Build.0 = Release|Any CPU
18 | {4C938210-4D82-48A1-9A0C-7432C3426073}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19 | {4C938210-4D82-48A1-9A0C-7432C3426073}.Debug|Any CPU.Build.0 = Debug|Any CPU
20 | {4C938210-4D82-48A1-9A0C-7432C3426073}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {4C938210-4D82-48A1-9A0C-7432C3426073}.Release|Any CPU.Build.0 = Release|Any CPU
22 | EndGlobalSection
23 | GlobalSection(SolutionProperties) = preSolution
24 | HideSolutionNode = FALSE
25 | EndGlobalSection
26 | GlobalSection(ExtensibilityGlobals) = postSolution
27 | VisualSVNWorkingCopyRoot =
28 | EndGlobalSection
29 | EndGlobal
30 |
--------------------------------------------------------------------------------
/BlackMagic/BlackMagicTest/Properties/.svn/text-base/AssemblyInfo.cs.svn-base:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("BlackMagicTest")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("BlackMagicTest")]
13 | [assembly: AssemblyCopyright("Copyright © 2008")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("f911051c-953c-4f1e-865f-69cdd180f6f5")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/BlackMagic/BlackMagicTest/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Diagnostics;
5 | using System.Text;
6 | using Magic;
7 |
8 | namespace BlackMagicTest
9 | {
10 | class Program
11 | {
12 | //const uint CLIENT_CONNECTION = 0x011CA260;
13 | //const uint CURMGR_OFFSET = 0x2864;
14 | //const int FIRST_OBJECT = 0xAC;
15 |
16 | private const string PATTERN_CLIENT_CONNECTION = "EB 02 33 C0 8B 0D 00 00 00 00 64 8B 15 00 00 00 00 8B 34 8A 8B 0D 00 00 00 00 89 81 00 00 00 00";
17 | private const string MASK_CLIENT_CONNECTION = "xxxxxx????xxx????xxxxx????xx????";
18 |
19 | static void Main(string[] args)
20 | {
21 | uint dwCodeLoc;
22 | BlackMagic wow = new BlackMagic();
23 | if (wow.OpenProcessAndThread(SProcess.GetProcessFromProcessName("wow")))
24 | {
25 | Console.WriteLine(wow.GetModuleFilePath());
26 | DateTime dt = DateTime.Now;
27 |
28 | //dwCodeLoc = SPattern.FindPattern(wow.ProcessHandle, wow.MainModule, PATTERN_CLIENT_CONNECTION, MASK_CLIENT_CONNECTION, ' ');
29 | dwCodeLoc = wow.FindPattern(PATTERN_CLIENT_CONNECTION, MASK_CLIENT_CONNECTION);
30 | Console.WriteLine("Pattern found in {0}ms", DateTime.Now.Subtract(dt).TotalMilliseconds);
31 | Console.WriteLine("Code loc: 0x{0:X08}", dwCodeLoc);
32 | Console.WriteLine("CLIENT_CONNECTION: 0x{0:X08}", wow.ReadUInt(dwCodeLoc + 0x16));
33 | Console.WriteLine("CURMGR_OFFSET: 0x{0:X08}", wow.ReadUInt(dwCodeLoc + 0x1C));
34 |
35 | }
36 | else
37 | {
38 | Console.WriteLine("World of Warcraft could not be opened for read/write.");
39 | }
40 |
41 | Console.ReadLine();
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Fasm/LICENSE.TXT:
--------------------------------------------------------------------------------
1 |
2 | flat assembler version 1.67
3 | Copyright (c) 1999-2007, Tomasz Grysztar.
4 | All rights reserved.
5 |
6 | This program is free for commercial and non-commercial use as long as
7 | the following conditions are adhered to.
8 |
9 | Copyright remains Tomasz Grysztar, and as such any Copyright notices
10 | in the code are not to be removed.
11 |
12 | Redistribution and use in source and binary forms, with or without
13 | modification, are permitted provided that the following conditions are
14 | met:
15 |
16 | 1. Redistributions of source code must retain the above copyright notice,
17 | this list of conditions and the following disclaimer.
18 | 2. Redistributions in binary form must reproduce the above copyright
19 | notice, this list of conditions and the following disclaimer in the
20 | documentation and/or other materials provided with the distribution.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
24 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
25 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
26 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | The licence and distribution terms for any publically available
35 | version or derivative of this code cannot be changed. i.e. this code
36 | cannot simply be copied and put under another distribution licence
37 | (including the GNU Public Licence).
38 |
--------------------------------------------------------------------------------
/BlackMagic/BlackMagic/BMInject.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Magic
4 | {
5 | sealed public partial class BlackMagic
6 | {
7 | ///
8 | /// Injects a dll into a process by creating a remote thread on LoadLibrary.
9 | ///
10 | /// Full path of the dll that will be injected.
11 | /// Returns the base address of the injected dll on success, zero on failure.
12 | public uint InjectDllCreateThread(string szDllPath)
13 | {
14 | if (!m_bProcessOpen)
15 | return RETURN_ERROR;
16 |
17 | return SInject.InjectDllCreateThread(m_hProcess, szDllPath);
18 | }
19 |
20 | ///
21 | /// Injects a dll into a process by hijacking the given thread and redirecting it to LoadLibrary.
22 | ///
23 | /// Full path of the dll that will be injected.
24 | /// Returns the base address of the injected dll on success, zero on failure.
25 | public uint InjectDllRedirectThread(string szDllPath)
26 | {
27 | if (!m_bProcessOpen)
28 | return RETURN_ERROR;
29 |
30 | if (m_bThreadOpen)
31 | return SInject.InjectDllRedirectThread(m_hProcess, m_hThread, szDllPath);
32 |
33 | return SInject.InjectDllRedirectThread(m_hProcess, m_ProcessId, szDllPath);
34 | }
35 |
36 | ///
37 | /// Injects a dll into a process by hijacking the given thread and redirecting it to LoadLibrary.
38 | ///
39 | /// Handle to the thread which will be hijacked.
40 | /// Full path of the dll that will be injected.
41 | /// Returns the base address of the injected dll on success, zero on failure.
42 | public uint InjectDllRedirectThread(IntPtr hThread, string szDllPath)
43 | {
44 | if (!m_bProcessOpen)
45 | return RETURN_ERROR;
46 |
47 | return SInject.InjectDllRedirectThread(m_hProcess, hThread, szDllPath);
48 | }
49 | }
50 | }
--------------------------------------------------------------------------------
/Fasm/fasmdll_managed/fasmdll_managed.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #define WIN32_LEAN_AND_MEAN
4 |
5 | #include
6 | #include
7 |
8 | #include "defines.h"
9 |
10 | #include "AssemblyInfo.cpp"
11 |
12 | #using
13 |
14 | using namespace System;
15 | using namespace System::Text;
16 | using namespace System::Runtime::InteropServices;
17 | using namespace System::Collections::Generic;
18 |
19 | namespace Fasm
20 | {
21 | public ref class ManagedFasm
22 | {
23 | public:
24 | ManagedFasm();
25 | ManagedFasm(IntPtr hProcess);
26 |
27 | ~ManagedFasm();
28 |
29 | void AddLine(String ^ szLine);
30 | void AddLine(String ^ szFormatString, ... array