1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Could anyone help me?

Discussion in 'Programming' started by Twister, Aug 13, 2010.

  1. Twister

    Twister Well-Known Member

    Could anyone tell me how to fix these 3 errors.

    This is my Form1.cpp
    Code (Text):
    1. #include "Form1.h"
    2. #include <Windows.h>
    3.  
    4. using namespace firstdll;
    5.  
    6. void Main(void)
    7. {
    8.     Application::EnableVisualStyles();
    9.     Application::SetCompatibleTextRenderingDefault(false);
    10.     Application::Run(gcnew Form1); //change Form1 this to the name of your Form
    11.     Application::Exit();
    12. }
    13.  
    14. DWORD MobSpeedPointer= 0x0091618F;
    15. BYTE enableSpeedUp[] = {0x8D, 0x4E, 0x0C};
    16. BYTE disableSpeedUp[] = {0x8D, 0x48, 0x24};
    17.  
    18. void Form1::checkBox1_CheckedChanged(System::Object^  sender, System::EventArgs^  e)
    19. {
    20.      if(this->checkBox1->Checked)
    21.         {
    22.                //here we enable the hack by changing the bytes of the pointer
    23.         memcpy((void*)MobSpeedPointer, enableSpeedUp, sizeof(enableSpeedUp));
    24.          }
    25.      else //if not checked
    26.         {
    27.                 //here we disable the hack by coping back the original bytes to the pointer
    28.         memcpy((void*)MobSpeedPointer, disableSpeedUp, sizeof(disableSpeedUp));
    29.          }
    30. }
    31.  
    32. DWORD NAGodmodePointer= 0x00895234;
    33. BYTE enableGodMode[] = {0xEB, 0x0B};
    34. BYTE disableGodmode[] = {0x85, 0xc0};
    35.  
    36. void Form1::checkBox2_CheckedChanged(System::Object^  sender, System::EventArgs^  e)
    37. {
    38.     if(this->checkBox2->Checked)
    39.     {
    40.         memcpy((void*)NAGodmodePointer, enableGodmode, sizeof(enableGodmode));
    41.     }
    42.     else
    43.     {
    44.         memcpy((void*)NAGodmodePointer, disableGodmode, sizeof(disableGodmode));
    45.     }
    46. }
    47.  
    And this is my form1.h
    Code (Text):
    1. #include <Windows.h>
    2. #pragma once
    3.  
    4. namespace firstdll {
    5.  
    6.     using namespace System;
    7.     using namespace System::ComponentModel;
    8.     using namespace System::Collections;
    9.     using namespace System::Windows::Forms;
    10.     using namespace System::Data;
    11.     using namespace System::Drawing;
    12.  
    13.     /// <summary>
    14.     /// Summary for Form1
    15.     /// </summary>
    16.     public ref class Form1 : public System::Windows::Forms::Form
    17.     {
    18.     public:
    19.         Form1(void)
    20.         {
    21.             InitializeComponent();
    22.             //
    23.             //TODO: Add the constructor code here
    24.             //
    25.         }
    26.  
    27.     protected:
    28.         /// <summary>
    29.         /// Clean up any resources being used.
    30.         /// </summary>
    31.         ~Form1()
    32.         {
    33.             if (components)
    34.             {
    35.                 delete components;
    36.             }
    37.         }
    38.     private: System::Windows::Forms::CheckBox^  checkBox1;
    39.     private: System::Windows::Forms::CheckBox^  checkBox2;
    40.     protected:
    41.  
    42.     private:
    43.         /// <summary>
    44.         /// Required designer variable.
    45.         /// </summary>
    46.         System::ComponentModel::Container ^components;
    47.  
    48. #pragma region Windows Form Designer generated code
    49.         /// <summary>
    50.         /// Required method for Designer support - do not modify
    51.         /// the contents of this method with the code editor.
    52.         /// </summary>
    53.         void InitializeComponent(void)
    54.         {
    55.             this->checkBox1 = (gcnew System::Windows::Forms::CheckBox());
    56.             this->checkBox2 = (gcnew System::Windows::Forms::CheckBox());
    57.             this->SuspendLayout();
    58.             //
    59.             // checkBox1
    60.             //
    61.             this->checkBox1->AutoSize = true;
    62.             this->checkBox1->Location = System::Drawing::Point(12, 12);
    63.             this->checkBox1->Name = L"checkBox1";
    64.             this->checkBox1->Size = System::Drawing::Size(92, 17);
    65.             this->checkBox1->TabIndex = 0;
    66.             this->checkBox1->Text = L"MobSpeedUp";
    67.             this->checkBox1->UseVisualStyleBackColor = true;
    68.             this->checkBox1->CheckedChanged += gcnew System::EventHandler(this, &Form1::checkBox1_CheckedChanged);
    69.             //
    70.             // checkBox2
    71.             //
    72.             this->checkBox2->AutoSize = true;
    73.             this->checkBox2->Location = System::Drawing::Point(13, 36);
    74.             this->checkBox2->Name = L"checkBox2";
    75.             this->checkBox2->Size = System::Drawing::Size(68, 17);
    76.             this->checkBox2->TabIndex = 1;
    77.             this->checkBox2->Text = L"NA-BGM";
    78.             this->checkBox2->UseVisualStyleBackColor = true;
    79.             this->checkBox2->CheckedChanged += gcnew System::EventHandler(this, &Form1::checkBox2_CheckedChanged);
    80.             //
    81.             // Form1
    82.             //
    83.             this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
    84.             this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
    85.             this->ClientSize = System::Drawing::Size(104, 62);
    86.             this->Controls->Add(this->checkBox2);
    87.             this->Controls->Add(this->checkBox1);
    88.             this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedToolWindow;
    89.             this->Name = L"Form1";
    90.             this->Text = L"kthxbaii";
    91.             this->ResumeLayout(false);
    92.             this->PerformLayout();
    93.  
    94.         }
    95. #pragma endregion
    96.     private: System::Void checkBox1_CheckedChanged(System::Object^  sender, System::EventArgs^  e);
    97.              
    98.     private: System::Void checkBox2_CheckedChanged(System::Object^  sender, System::EventArgs^  e);
    99.              
    100.     };
    101. }
    And these are my errors.
    Code (Text):
    1. 1>------ Build started: Project: firstdll, Configuration: Release Win32 ------
    2. 1>  Form1.cpp
    3. 1>Form1.cpp(40): error C2065: 'enableGodmode' : undeclared identifier
    4. 1>Form1.cpp(40): error C2065: 'enableGodmode' : undeclared identifier
    5. 1>Form1.cpp(40): error C2070: ''unknown-type'': illegal sizeof operand
    6. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    7.  
     
  2. DarkSpace

    DarkSpace Well-Known Member Coder

    you have miss spellings again.

    Remember C++ is case sensitive.

    Code (Text):
    1.  
    2. DWORD NAGodmodePointer= 0x00895234;
    3. BYTE enableGodMode[] = {0xEB, 0x0B};
    4. BYTE disableGodmode[] = {0x85, 0xc0};
    5.  
    6. void Form1::checkBox2_CheckedChanged(System::Object^  sender, System::EventArgs^  e)
    7. {
    8.     if(this->checkBox2->Checked)
    9.     {
    10.         memcpy((void*)NAGodmodePointer, enableGod[B]Mode[/B], sizeof(enableGodMode)); // 1st and 2nd error. enableGodmode doesnt exist, but enableGodMode does. 3rd error sizeof() had a undefined array.
    11.     }
    12.     else
    13.     {
    14.         memcpy((void*)NAGodmodePointer, disableGodmode, sizeof(disableGodmode));
    15.     }
    16. }
    17.  
    either change your DWORD enableGodMode to enableGodMode
    or
    change in the checkbox change enableGodmode to enableGodMode to match your variables.

    have fun
     
  3. Twister

    Twister Well-Known Member

    Thanks for poiting me to that its Case Sensitive, I found a mistake, thank you!
     

Share This Page