havok_mk

AIW Tools

Jan 20th, 2012
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 13.17 KB | None | 0 0
  1. #pragma once
  2.  
  3. #include <Windows.h>
  4. #include <cstdio>
  5.  
  6. HWND hwnd;
  7. HANDLE phandle;
  8. DWORD pid;
  9.  
  10. BYTE namedata[]={ 0x0D, 0x00};
  11.  
  12.  
  13.  
  14.    
  15.  DWORD namedatasize = sizeof(namedata);
  16.  
  17. namespace invisiblenicknames {
  18.  
  19.     using namespace System;
  20.     using namespace System::ComponentModel;
  21.     using namespace System::Collections;
  22.     using namespace System::Windows::Forms;
  23.     using namespace System::Data;
  24.     using namespace System::Drawing;
  25.  
  26.     /// <summary>
  27.     /// Summary for Form1
  28.     ///
  29.     /// WARNING: If you change the name of this class, you will need to change the
  30.     ///          'Resource File Name' property for the managed resource compiler tool
  31.     ///          associated with all .resx files this class depends on.  Otherwise,
  32.     ///          the designers will not be able to interact properly with localized
  33.     ///          resources associated with this form.
  34.     /// </summary>
  35.     public ref class Form1 : public System::Windows::Forms::Form
  36.     {
  37.     public:
  38.         Form1(void)
  39.         {
  40.             InitializeComponent();
  41.             //
  42.             //TODO: Add the constructor code here
  43.             //
  44.         }
  45.  public:
  46.       [System::Runtime::InteropServices::DllImport("user32.dll")]
  47.       static HWND FindWindow(LPCTSTR lpClassName, LPCTSTR lpWindowName);
  48.  
  49.       [System::Runtime::InteropServices::DllImport("user32.dll")]
  50.       static DWORD GetWindowThreadProcessId(HWND hWnd, LPDWORD lpdwProcessId);
  51.  
  52.       [System::Runtime::InteropServices::DllImport("kernel32.dll")]
  53.       static BOOL WriteProcessMemory( HANDLE hProcess, LPVOID lpBaseAddress, LPCVOID lpBuffer, SIZE_T nSize, SIZE_T *lpNumberOfBytesWritten);
  54.  
  55.       [System::Runtime::InteropServices::DllImport("kernel32.dll")]
  56.       static BOOL ReadProcessMemory( HANDLE hProcess, LPCVOID lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, SIZE_T *lpNumberOfBytesRead);
  57.  
  58.       [System::Runtime::InteropServices::DllImport("kernel32.dll")]
  59.       static HANDLE OpenProcess(unsigned int dwDesiredAccess, int bInheritHandle, unsigned int dwProcessId);
  60.     protected:
  61.         /// <summary>
  62.         /// Clean up any resources being used.
  63.         /// </summary>
  64.         ~Form1()
  65.         {
  66.             if (components)
  67.             {
  68.                 delete components;
  69.             }
  70.         }
  71.     private: System::Windows::Forms::GroupBox^  groupBox1;
  72.     protected:
  73.     private: System::Windows::Forms::RadioButton^  radioButton3;
  74.     private: System::Windows::Forms::RadioButton^  radioButton2;
  75.     private: System::Windows::Forms::RadioButton^  radioButton1;
  76.  
  77.     private: System::Windows::Forms::Button^  m1button;
  78.     private: System::Windows::Forms::Button^  m2button;
  79.     private: System::Windows::Forms::Button^  aopsbutton;
  80.     private: System::Windows::Forms::Label^  label1;
  81.     private: System::Windows::Forms::Label^  label2;
  82.     private: System::Windows::Forms::LinkLabel^  linkLabel1;
  83.  
  84.  
  85.  
  86.  
  87.  
  88.     private:
  89.         /// <summary>
  90.         /// Required designer variable.
  91.         /// </summary>
  92.         System::ComponentModel::Container ^components;
  93.  
  94. #pragma region Windows Form Designer generated code
  95.         /// <summary>
  96.         /// Required method for Designer support - do not modify
  97.         /// the contents of this method with the code editor.
  98.         /// </summary>
  99.         void InitializeComponent(void)
  100.         {
  101.             System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
  102.             this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
  103.             this->radioButton3 = (gcnew System::Windows::Forms::RadioButton());
  104.             this->radioButton2 = (gcnew System::Windows::Forms::RadioButton());
  105.             this->radioButton1 = (gcnew System::Windows::Forms::RadioButton());
  106.             this->m1button = (gcnew System::Windows::Forms::Button());
  107.             this->m2button = (gcnew System::Windows::Forms::Button());
  108.             this->aopsbutton = (gcnew System::Windows::Forms::Button());
  109.             this->label1 = (gcnew System::Windows::Forms::Label());
  110.             this->label2 = (gcnew System::Windows::Forms::Label());
  111.             this->linkLabel1 = (gcnew System::Windows::Forms::LinkLabel());
  112.             this->groupBox1->SuspendLayout();
  113.             this->SuspendLayout();
  114.             //
  115.             // groupBox1
  116.             //
  117.             this->groupBox1->Controls->Add(this->radioButton3);
  118.             this->groupBox1->Controls->Add(this->radioButton2);
  119.             this->groupBox1->Controls->Add(this->radioButton1);
  120.             this->groupBox1->Location = System::Drawing::Point(11, 12);
  121.             this->groupBox1->Name = L"groupBox1";
  122.             this->groupBox1->Size = System::Drawing::Size(212, 47);
  123.             this->groupBox1->TabIndex = 0;
  124.             this->groupBox1->TabStop = false;
  125.             this->groupBox1->Text = L"Choose the game";
  126.             //
  127.             // radioButton3
  128.             //
  129.             this->radioButton3->AutoSize = true;
  130.             this->radioButton3->Location = System::Drawing::Point(142, 20);
  131.             this->radioButton3->Name = L"radioButton3";
  132.             this->radioButton3->Size = System::Drawing::Size(64, 17);
  133.             this->radioButton3->TabIndex = 2;
  134.             this->radioButton3->TabStop = true;
  135.             this->radioButton3->Text = L"alterOps";
  136.             this->radioButton3->UseVisualStyleBackColor = true;
  137.             this->radioButton3->CheckedChanged += gcnew System::EventHandler(this, &Form1::radioButton3_CheckedChanged);
  138.             //
  139.             // radioButton2
  140.             //
  141.             this->radioButton2->AutoSize = true;
  142.             this->radioButton2->Location = System::Drawing::Point(73, 20);
  143.             this->radioButton2->Name = L"radioButton2";
  144.             this->radioButton2->Size = System::Drawing::Size(60, 17);
  145.             this->radioButton2->TabIndex = 1;
  146.             this->radioButton2->TabStop = true;
  147.             this->radioButton2->Text = L"IW4M2";
  148.             this->radioButton2->UseVisualStyleBackColor = true;
  149.             this->radioButton2->CheckedChanged += gcnew System::EventHandler(this, &Form1::radioButton2_CheckedChanged);
  150.             //
  151.             // radioButton1
  152.             //
  153.             this->radioButton1->AutoSize = true;
  154.             this->radioButton1->Location = System::Drawing::Point(7, 20);
  155.             this->radioButton1->Name = L"radioButton1";
  156.             this->radioButton1->Size = System::Drawing::Size(60, 17);
  157.             this->radioButton1->TabIndex = 0;
  158.             this->radioButton1->TabStop = true;
  159.             this->radioButton1->Text = L"IW4M1";
  160.             this->radioButton1->UseVisualStyleBackColor = true;
  161.             this->radioButton1->CheckedChanged += gcnew System::EventHandler(this, &Form1::radioButton1_CheckedChanged);
  162.             //
  163.             // m1button
  164.             //
  165.             this->m1button->Location = System::Drawing::Point(11, 65);
  166.             this->m1button->Name = L"m1button";
  167.             this->m1button->Size = System::Drawing::Size(67, 23);
  168.             this->m1button->TabIndex = 2;
  169.             this->m1button->Text = L"Do it!";
  170.             this->m1button->UseVisualStyleBackColor = true;
  171.             this->m1button->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
  172.             //
  173.             // m2button
  174.             //
  175.             this->m2button->Location = System::Drawing::Point(84, 65);
  176.             this->m2button->Name = L"m2button";
  177.             this->m2button->Size = System::Drawing::Size(66, 23);
  178.             this->m2button->TabIndex = 3;
  179.             this->m2button->Text = L"Do it!";
  180.             this->m2button->UseVisualStyleBackColor = true;
  181.             this->m2button->Click += gcnew System::EventHandler(this, &Form1::m2button_Click);
  182.             //
  183.             // aopsbutton
  184.             //
  185.             this->aopsbutton->Location = System::Drawing::Point(156, 65);
  186.             this->aopsbutton->Name = L"aopsbutton";
  187.             this->aopsbutton->Size = System::Drawing::Size(67, 23);
  188.             this->aopsbutton->TabIndex = 4;
  189.             this->aopsbutton->Text = L"Do it!";
  190.             this->aopsbutton->UseVisualStyleBackColor = true;
  191.             this->aopsbutton->Click += gcnew System::EventHandler(this, &Form1::aopsbutton_Click);
  192.             //
  193.             // label1
  194.             //
  195.             this->label1->AutoSize = true;
  196.             this->label1->Location = System::Drawing::Point(8, 105);
  197.             this->label1->Name = L"label1";
  198.             this->label1->Size = System::Drawing::Size(35, 13);
  199.             this->label1->TabIndex = 5;
  200.             this->label1->Text = L"Game";
  201.             //
  202.             // label2
  203.             //
  204.             this->label2->AutoSize = true;
  205.             this->label2->ForeColor = System::Drawing::Color::Lime;
  206.             this->label2->Location = System::Drawing::Point(49, 105);
  207.             this->label2->Name = L"label2";
  208.             this->label2->Size = System::Drawing::Size(45, 13);
  209.             this->label2->TabIndex = 6;
  210.             this->label2->Text = L"FOUND";
  211.             //
  212.             // linkLabel1
  213.             //
  214.             this->linkLabel1->AutoSize = true;
  215.             this->linkLabel1->Location = System::Drawing::Point(153, 105);
  216.             this->linkLabel1->Name = L"linkLabel1";
  217.             this->linkLabel1->Size = System::Drawing::Size(70, 13);
  218.             this->linkLabel1->TabIndex = 7;
  219.             this->linkLabel1->TabStop = true;
  220.             this->linkLabel1->Text = L"By OrangePL";
  221.             this->linkLabel1->LinkClicked += gcnew System::Windows::Forms::LinkLabelLinkClickedEventHandler(this, &Form1::linkLabel1_LinkClicked);
  222.             //
  223.             // Form1
  224.             //
  225.             this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  226.             this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  227.             this->ClientSize = System::Drawing::Size(235, 127);
  228.             this->Controls->Add(this->linkLabel1);
  229.             this->Controls->Add(this->label2);
  230.             this->Controls->Add(this->label1);
  231.             this->Controls->Add(this->aopsbutton);
  232.             this->Controls->Add(this->m2button);
  233.             this->Controls->Add(this->m1button);
  234.             this->Controls->Add(this->groupBox1);
  235.             this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
  236.             this->MaximizeBox = false;
  237.             this->MinimizeBox = false;
  238.             this->Name = L"Form1";
  239.             this->Text = L"Anonymous";
  240.             this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
  241.             this->groupBox1->ResumeLayout(false);
  242.             this->groupBox1->PerformLayout();
  243.             this->ResumeLayout(false);
  244.             this->PerformLayout();
  245.  
  246.         }
  247. #pragma endregion
  248.     private: System::Void radioButton3_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
  249.                          hwnd = FindWindow(NULL, L"Call of Duty®: BlackOps");
  250.                  if(hwnd == NULL)
  251.                  {
  252.                     //("Could not find the window. Launch MW3 and re-open the application.");
  253.                     // this->Close();
  254.                  }
  255.                  GetWindowThreadProcessId(hwnd, &pid);
  256.                  phandle = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
  257.                  if(phandle == NULL)
  258.                  {
  259.                                 this->label2->ForeColor = System::Drawing::Color::Red;
  260.             this->label2->Text = L"NOT FOUND";
  261.                  }
  262.                  else if(phandle != NULL || hwnd != NULL)
  263.                  {
  264.                                 this->label2->ForeColor = System::Drawing::Color::Lime;
  265.             this->label2->Text = L"FOUND";
  266.                  }
  267.                  this->m1button->Enabled = !this->m1button->Enabled;
  268.                  this->m2button->Enabled = !this->m2button->Enabled;
  269.            
  270.              }
  271. private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
  272.               if(hwnd == NULL)
  273.              {
  274.                   this->label2->ForeColor = System::Drawing::Color::Red;
  275.             this->label2->Text = L"NOT FOUND";
  276.        
  277.                
  278.              }
  279.               else {
  280.                           WriteProcessMemory(phandle, (LPVOID)0x104DFBE0,  &namedata, namedatasize, NULL);
  281.              }//this->statusStrip1->Text = L"Name patched !";
  282.  
  283.          }
  284. private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
  285.  
  286.          }
  287. private: System::Void radioButton1_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
  288.              hwnd = FindWindow(NULL, L"aIW Console");
  289.                  if(hwnd == NULL)
  290.                  {
  291.                     //("Could not find the window. Launch MW3 and re-open the application.");
  292.                     // this->Close();
  293.                  }
  294.                  GetWindowThreadProcessId(hwnd, &pid);
  295.                  phandle = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
  296.                  if(phandle == NULL)
  297.                  {
  298.                                 this->label2->ForeColor = System::Drawing::Color::Red;
  299.             this->label2->Text = L"NOT FOUND";
  300.                  }
  301.                  else if(phandle != NULL)
  302.                  {
  303.                                 this->label2->ForeColor = System::Drawing::Color::Lime;
  304.             this->label2->Text = L"FOUND";
  305.                  }
  306.                      this->aopsbutton->Enabled = !this->aopsbutton->Enabled;
  307.                  this->m2button->Enabled = !this->m2button->Enabled;
  308.            
  309.          }
  310. private: System::Void radioButton2_CheckedChanged(System::Object^  sender, System::EventArgs^  e) {
  311.               hwnd = FindWindow(NULL, L"Modern Warfare 2");
  312.                  if(hwnd == NULL)
  313.                  {
  314.                     //("Could not find the window. Launch MW3 and re-open the application.");
  315.                     // this->Close();
  316.                  }
  317.                  GetWindowThreadProcessId(hwnd, &pid);
  318.                  phandle = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
  319.                  if(phandle == NULL)
  320.                  {
  321.                     // MessageBox::Show("");
  322.                         this->label2->ForeColor = System::Drawing::Color::Red;
  323.             this->label2->Text = L"NOT FOUND";
  324.                  }
  325.                      else if(phandle != NULL)
  326.                  {
  327.                                 this->label2->ForeColor = System::Drawing::Color::Lime;
  328.             this->label2->Text = L"FOUND";
  329.                  }
  330.                  this->m1button->Enabled = !this->m1button->Enabled;
  331.                  this->aopsbutton->Enabled = !this->aopsbutton->Enabled;
  332.            
  333.          }
  334. private: System::Void m2button_Click(System::Object^  sender, System::EventArgs^  e) {
  335.               if(hwnd == NULL)
  336.              {
  337.                  this->label2->ForeColor = System::Drawing::Color::Red;
  338.             this->label2->Text = L"NOT FOUND";
  339.            
  340.                  
  341.              }
  342.               else
  343.              {
  344.               WriteProcessMemory(phandle, (LPVOID)0x1009CF48,  &namedata, namedatasize, NULL);
  345.              }   // this->statusStrip1->Text = L"Name patched !";
  346.          }
  347. private: System::Void aopsbutton_Click(System::Object^  sender, System::EventArgs^  e) {
  348.              if(hwnd == NULL)
  349.              {
  350.                   this->label2->ForeColor = System::Drawing::Color::Red;
  351.             this->label2->Text = L"NOT FOUND";
  352.        
  353.                
  354.              }
  355.              else {
  356.              
  357.                WriteProcessMemory(phandle, (LPVOID)0x43EE8A4,  &namedata, namedatasize, NULL);
  358.              }       // this->statusStrip1->Text = L"Name patched !";
  359.          }
  360.  
  361.  
  362. private: System::Void linkLabel1_LinkClicked(System::Object^  sender, System::Windows::Forms::LinkLabelLinkClickedEventArgs^  e) {
  363.          System::Diagnostics::Process::Start("http://www.youtube.com/TheOrangePL");
  364.          }
  365. };
  366. }
Advertisement
Add Comment
Please, Sign In to add comment