Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include <Windows.h>
- #include <cstdio>
- HWND hwnd;
- HANDLE phandle;
- DWORD pid;
- BYTE namedata[]={ 0x0D, 0x00};
- DWORD namedatasize = sizeof(namedata);
- namespace invisiblenicknames {
- using namespace System;
- using namespace System::ComponentModel;
- using namespace System::Collections;
- using namespace System::Windows::Forms;
- using namespace System::Data;
- using namespace System::Drawing;
- /// <summary>
- /// Summary for Form1
- ///
- /// WARNING: If you change the name of this class, you will need to change the
- /// 'Resource File Name' property for the managed resource compiler tool
- /// associated with all .resx files this class depends on. Otherwise,
- /// the designers will not be able to interact properly with localized
- /// resources associated with this form.
- /// </summary>
- public ref class Form1 : public System::Windows::Forms::Form
- {
- public:
- Form1(void)
- {
- InitializeComponent();
- //
- //TODO: Add the constructor code here
- //
- }
- public:
- [System::Runtime::InteropServices::DllImport("user32.dll")]
- static HWND FindWindow(LPCTSTR lpClassName, LPCTSTR lpWindowName);
- [System::Runtime::InteropServices::DllImport("user32.dll")]
- static DWORD GetWindowThreadProcessId(HWND hWnd, LPDWORD lpdwProcessId);
- [System::Runtime::InteropServices::DllImport("kernel32.dll")]
- static BOOL WriteProcessMemory( HANDLE hProcess, LPVOID lpBaseAddress, LPCVOID lpBuffer, SIZE_T nSize, SIZE_T *lpNumberOfBytesWritten);
- [System::Runtime::InteropServices::DllImport("kernel32.dll")]
- static BOOL ReadProcessMemory( HANDLE hProcess, LPCVOID lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, SIZE_T *lpNumberOfBytesRead);
- [System::Runtime::InteropServices::DllImport("kernel32.dll")]
- static HANDLE OpenProcess(unsigned int dwDesiredAccess, int bInheritHandle, unsigned int dwProcessId);
- protected:
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- ~Form1()
- {
- if (components)
- {
- delete components;
- }
- }
- private: System::Windows::Forms::GroupBox^ groupBox1;
- protected:
- private: System::Windows::Forms::RadioButton^ radioButton3;
- private: System::Windows::Forms::RadioButton^ radioButton2;
- private: System::Windows::Forms::RadioButton^ radioButton1;
- private: System::Windows::Forms::Button^ m1button;
- private: System::Windows::Forms::Button^ m2button;
- private: System::Windows::Forms::Button^ aopsbutton;
- private: System::Windows::Forms::Label^ label1;
- private: System::Windows::Forms::Label^ label2;
- private: System::Windows::Forms::LinkLabel^ linkLabel1;
- private:
- /// <summary>
- /// Required designer variable.
- /// </summary>
- System::ComponentModel::Container ^components;
- #pragma region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- void InitializeComponent(void)
- {
- System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
- this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
- this->radioButton3 = (gcnew System::Windows::Forms::RadioButton());
- this->radioButton2 = (gcnew System::Windows::Forms::RadioButton());
- this->radioButton1 = (gcnew System::Windows::Forms::RadioButton());
- this->m1button = (gcnew System::Windows::Forms::Button());
- this->m2button = (gcnew System::Windows::Forms::Button());
- this->aopsbutton = (gcnew System::Windows::Forms::Button());
- this->label1 = (gcnew System::Windows::Forms::Label());
- this->label2 = (gcnew System::Windows::Forms::Label());
- this->linkLabel1 = (gcnew System::Windows::Forms::LinkLabel());
- this->groupBox1->SuspendLayout();
- this->SuspendLayout();
- //
- // groupBox1
- //
- this->groupBox1->Controls->Add(this->radioButton3);
- this->groupBox1->Controls->Add(this->radioButton2);
- this->groupBox1->Controls->Add(this->radioButton1);
- this->groupBox1->Location = System::Drawing::Point(11, 12);
- this->groupBox1->Name = L"groupBox1";
- this->groupBox1->Size = System::Drawing::Size(212, 47);
- this->groupBox1->TabIndex = 0;
- this->groupBox1->TabStop = false;
- this->groupBox1->Text = L"Choose the game";
- //
- // radioButton3
- //
- this->radioButton3->AutoSize = true;
- this->radioButton3->Location = System::Drawing::Point(142, 20);
- this->radioButton3->Name = L"radioButton3";
- this->radioButton3->Size = System::Drawing::Size(64, 17);
- this->radioButton3->TabIndex = 2;
- this->radioButton3->TabStop = true;
- this->radioButton3->Text = L"alterOps";
- this->radioButton3->UseVisualStyleBackColor = true;
- this->radioButton3->CheckedChanged += gcnew System::EventHandler(this, &Form1::radioButton3_CheckedChanged);
- //
- // radioButton2
- //
- this->radioButton2->AutoSize = true;
- this->radioButton2->Location = System::Drawing::Point(73, 20);
- this->radioButton2->Name = L"radioButton2";
- this->radioButton2->Size = System::Drawing::Size(60, 17);
- this->radioButton2->TabIndex = 1;
- this->radioButton2->TabStop = true;
- this->radioButton2->Text = L"IW4M2";
- this->radioButton2->UseVisualStyleBackColor = true;
- this->radioButton2->CheckedChanged += gcnew System::EventHandler(this, &Form1::radioButton2_CheckedChanged);
- //
- // radioButton1
- //
- this->radioButton1->AutoSize = true;
- this->radioButton1->Location = System::Drawing::Point(7, 20);
- this->radioButton1->Name = L"radioButton1";
- this->radioButton1->Size = System::Drawing::Size(60, 17);
- this->radioButton1->TabIndex = 0;
- this->radioButton1->TabStop = true;
- this->radioButton1->Text = L"IW4M1";
- this->radioButton1->UseVisualStyleBackColor = true;
- this->radioButton1->CheckedChanged += gcnew System::EventHandler(this, &Form1::radioButton1_CheckedChanged);
- //
- // m1button
- //
- this->m1button->Location = System::Drawing::Point(11, 65);
- this->m1button->Name = L"m1button";
- this->m1button->Size = System::Drawing::Size(67, 23);
- this->m1button->TabIndex = 2;
- this->m1button->Text = L"Do it!";
- this->m1button->UseVisualStyleBackColor = true;
- this->m1button->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
- //
- // m2button
- //
- this->m2button->Location = System::Drawing::Point(84, 65);
- this->m2button->Name = L"m2button";
- this->m2button->Size = System::Drawing::Size(66, 23);
- this->m2button->TabIndex = 3;
- this->m2button->Text = L"Do it!";
- this->m2button->UseVisualStyleBackColor = true;
- this->m2button->Click += gcnew System::EventHandler(this, &Form1::m2button_Click);
- //
- // aopsbutton
- //
- this->aopsbutton->Location = System::Drawing::Point(156, 65);
- this->aopsbutton->Name = L"aopsbutton";
- this->aopsbutton->Size = System::Drawing::Size(67, 23);
- this->aopsbutton->TabIndex = 4;
- this->aopsbutton->Text = L"Do it!";
- this->aopsbutton->UseVisualStyleBackColor = true;
- this->aopsbutton->Click += gcnew System::EventHandler(this, &Form1::aopsbutton_Click);
- //
- // label1
- //
- this->label1->AutoSize = true;
- this->label1->Location = System::Drawing::Point(8, 105);
- this->label1->Name = L"label1";
- this->label1->Size = System::Drawing::Size(35, 13);
- this->label1->TabIndex = 5;
- this->label1->Text = L"Game";
- //
- // label2
- //
- this->label2->AutoSize = true;
- this->label2->ForeColor = System::Drawing::Color::Lime;
- this->label2->Location = System::Drawing::Point(49, 105);
- this->label2->Name = L"label2";
- this->label2->Size = System::Drawing::Size(45, 13);
- this->label2->TabIndex = 6;
- this->label2->Text = L"FOUND";
- //
- // linkLabel1
- //
- this->linkLabel1->AutoSize = true;
- this->linkLabel1->Location = System::Drawing::Point(153, 105);
- this->linkLabel1->Name = L"linkLabel1";
- this->linkLabel1->Size = System::Drawing::Size(70, 13);
- this->linkLabel1->TabIndex = 7;
- this->linkLabel1->TabStop = true;
- this->linkLabel1->Text = L"By OrangePL";
- this->linkLabel1->LinkClicked += gcnew System::Windows::Forms::LinkLabelLinkClickedEventHandler(this, &Form1::linkLabel1_LinkClicked);
- //
- // Form1
- //
- this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
- this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
- this->ClientSize = System::Drawing::Size(235, 127);
- this->Controls->Add(this->linkLabel1);
- this->Controls->Add(this->label2);
- this->Controls->Add(this->label1);
- this->Controls->Add(this->aopsbutton);
- this->Controls->Add(this->m2button);
- this->Controls->Add(this->m1button);
- this->Controls->Add(this->groupBox1);
- this->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"$this.Icon")));
- this->MaximizeBox = false;
- this->MinimizeBox = false;
- this->Name = L"Form1";
- this->Text = L"Anonymous";
- this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
- this->groupBox1->ResumeLayout(false);
- this->groupBox1->PerformLayout();
- this->ResumeLayout(false);
- this->PerformLayout();
- }
- #pragma endregion
- private: System::Void radioButton3_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {
- hwnd = FindWindow(NULL, L"Call of Duty®: BlackOps");
- if(hwnd == NULL)
- {
- //("Could not find the window. Launch MW3 and re-open the application.");
- // this->Close();
- }
- GetWindowThreadProcessId(hwnd, &pid);
- phandle = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
- if(phandle == NULL)
- {
- this->label2->ForeColor = System::Drawing::Color::Red;
- this->label2->Text = L"NOT FOUND";
- }
- else if(phandle != NULL || hwnd != NULL)
- {
- this->label2->ForeColor = System::Drawing::Color::Lime;
- this->label2->Text = L"FOUND";
- }
- this->m1button->Enabled = !this->m1button->Enabled;
- this->m2button->Enabled = !this->m2button->Enabled;
- }
- private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
- if(hwnd == NULL)
- {
- this->label2->ForeColor = System::Drawing::Color::Red;
- this->label2->Text = L"NOT FOUND";
- }
- else {
- WriteProcessMemory(phandle, (LPVOID)0x104DFBE0, &namedata, namedatasize, NULL);
- }//this->statusStrip1->Text = L"Name patched !";
- }
- private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
- }
- private: System::Void radioButton1_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {
- hwnd = FindWindow(NULL, L"aIW Console");
- if(hwnd == NULL)
- {
- //("Could not find the window. Launch MW3 and re-open the application.");
- // this->Close();
- }
- GetWindowThreadProcessId(hwnd, &pid);
- phandle = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
- if(phandle == NULL)
- {
- this->label2->ForeColor = System::Drawing::Color::Red;
- this->label2->Text = L"NOT FOUND";
- }
- else if(phandle != NULL)
- {
- this->label2->ForeColor = System::Drawing::Color::Lime;
- this->label2->Text = L"FOUND";
- }
- this->aopsbutton->Enabled = !this->aopsbutton->Enabled;
- this->m2button->Enabled = !this->m2button->Enabled;
- }
- private: System::Void radioButton2_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {
- hwnd = FindWindow(NULL, L"Modern Warfare 2");
- if(hwnd == NULL)
- {
- //("Could not find the window. Launch MW3 and re-open the application.");
- // this->Close();
- }
- GetWindowThreadProcessId(hwnd, &pid);
- phandle = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
- if(phandle == NULL)
- {
- // MessageBox::Show("");
- this->label2->ForeColor = System::Drawing::Color::Red;
- this->label2->Text = L"NOT FOUND";
- }
- else if(phandle != NULL)
- {
- this->label2->ForeColor = System::Drawing::Color::Lime;
- this->label2->Text = L"FOUND";
- }
- this->m1button->Enabled = !this->m1button->Enabled;
- this->aopsbutton->Enabled = !this->aopsbutton->Enabled;
- }
- private: System::Void m2button_Click(System::Object^ sender, System::EventArgs^ e) {
- if(hwnd == NULL)
- {
- this->label2->ForeColor = System::Drawing::Color::Red;
- this->label2->Text = L"NOT FOUND";
- }
- else
- {
- WriteProcessMemory(phandle, (LPVOID)0x1009CF48, &namedata, namedatasize, NULL);
- } // this->statusStrip1->Text = L"Name patched !";
- }
- private: System::Void aopsbutton_Click(System::Object^ sender, System::EventArgs^ e) {
- if(hwnd == NULL)
- {
- this->label2->ForeColor = System::Drawing::Color::Red;
- this->label2->Text = L"NOT FOUND";
- }
- else {
- WriteProcessMemory(phandle, (LPVOID)0x43EE8A4, &namedata, namedatasize, NULL);
- } // this->statusStrip1->Text = L"Name patched !";
- }
- private: System::Void linkLabel1_LinkClicked(System::Object^ sender, System::Windows::Forms::LinkLabelLinkClickedEventArgs^ e) {
- System::Diagnostics::Process::Start("http://www.youtube.com/TheOrangePL");
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment