private void gameChoiceCB_SelectedIndexChanged(object sender, EventArgs e) { try { for (int i = 0; i < MyProcess.Length; i++) { if (gameChoiceCB.SelectedItem.ToString().Contains(MyProcess[i].ProcessName)) { MyProcess[0] = Process.GetProcessById(int.Parse(gameChoiceCB.Text.Replace(MyProcess[i].ProcessName + "-", ""))); mainModule = MyProcess[0].MainModule; Mem.ReadProcess = MyProcess[0]; Mem.OpenProcess(); GameFound = true; //create our player with the corresponding memory addresses MainPlayer.baseAddress = Mem.ReadInt(0x50f4f4); //GETS US TO THE BEGINNING OF OUR STRUCT MainPlayer.offsets = new PlayerDataAddr(); SetupEnemyVars(); } } } catch (Exception ex) { MessageBox.Show("Could not connect to process " + ex.Message, "Error"); } }
public void SetPlayerData(ProcessMemoryReader mem) { health = mem.ReadInt(base_addr + health_offset); bullet_proof = mem.ReadInt(base_addr + bullet_proof_offset); ammo = mem.ReadInt(base_addr + ammo_offset); x_pos = mem.ReadFloat(base_addr + x_pos_offset); y_pos = mem.ReadFloat(base_addr + y_pos_offset); z_pos = mem.ReadFloat(base_addr + z_pos_offset); x_angle = mem.ReadFloat(base_addr + x_angle_offset); y_angle = mem.ReadFloat(base_addr + y_angle_offset); }
// 콤보박스 메뉴 중에 어떤 항목을 클릭했을 때 동작할 내용 // 프로세스를 선택했을 때 어떤 행동을 할지 정하는 애 private void ComboBox1_SelectedIndexChanged(object sender, EventArgs e) { try { // 해당 프로세스에 대한 권한을 가져야한다 if (Combobox1.SelectedIndex != -1) // 목록을 선택했다면 { string selectedItem = Combobox1.SelectedItem.ToString(); int pid = int.Parse(selectedItem.Split('-')[selectedItem.Split('-').Length - 1]); // 문자열을 -로 나눈 후 가장 마지막 문자열을 가져온다, pid는 문자열 근데 안에서 찾는건 string 그래서 int를 string으로 바꿔주기 위해 int.Parse를 쓴다 attachProc = Process.GetProcessById(pid); // 이제 프로세스를 열어야 한다 (권한을 주자) mem.ReadProcess = attachProc; // 프로세스를 연다 mem.OpenProcess(); MessageBox.Show("프로세스 열기 성공 " + attachProc.ProcessName); int base_ptr = attachProc.MainModule.BaseAddress.ToInt32() + 0x00168A28; int player_base = mem.ReadInt(base_ptr); mainPlayer = new Playerdata(player_base); attach = true; } } catch (Exception ex) // 시도했을 때 예외 처리 { attach = false; MessageBox.Show("프로세스 열기 실패" + ex.Message); } }
// 콤보박스 메뉴중에 어떤 항목을 클릭했을 때 동작할 내용 // 프로세스를 선택했을 때 어떤 행동을 할지 정하는 애 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { try { // 해당 프로세스에 대한 권한을 가져온다 // 프로세스 메모리 읽기/수정 if (comboBox1.SelectedIndex != -1) // 목록을 선택했다면 { string selectedItem = comboBox1.SelectedItem.ToString(); // KakaoTalk-704 int pid = int.Parse(selectedItem.Split('-')[selectedItem.Split('-').Length - 1]); // 문자열을 -로 나눈후 가장 마지막 문자열으르 가져온다. attachProc = Process.GetProcessById(pid); // 프로세스를 열어야함! (권한) mem.ReadProcess = attachProc; // 어떤 프로세스를 열지를 저장 mem.OpenProcess(); // 프로세스를 열기 MessageBox.Show("프로세스 열기 성공! " + attachProc.ProcessName); int base_ptr = attachProc.MainModule.BaseAddress.ToInt32() + 0x00169A38; int player_base = mem.ReadInt(base_ptr); mainPlayer = new PlayerData(player_base); attach = true; } } catch (Exception ex) // 시도했을 때 예외 처리 { attach = false; MessageBox.Show("프로세스 열기 실패: " + ex.Message); } }
static private int off_rifle_ammo = 0x150; // Assault rifle ammo #endregion static public bool monitorMemoryValues(ProcessMemoryReader Mem) { int LocalPlayerAddress = Mem.ReadMultiLevelPointer(LocalPlayerBase, 4, LocalPlayerOff); int HealthValue = Mem.ReadInt(LocalPlayerAddress + off_health); int RiffleAmmoValue = Mem.ReadInt(LocalPlayerAddress + off_rifle_ammo); if ((HealthValue > 100) && (!Form1.detected)) { Mem.WriteInt(LocalPlayerAddress + off_health, 10); MessageBox.Show("Possible Cheat Detected"); return(true); } return(false); }
private void BtnAttach_Click(object sender, EventArgs e) { try { // Find and Attach to game pro = Process.GetProcessesByName("ac_client"); mem.ReadProcess = pro[0]; mem.OpenProcess(); // Below address holds total players which includes teammates totalPlayers = mem.ReadInt(pro[0].MainModule.BaseAddress.ToInt32() + 0x110D98); // Read game data, begin hacks SetupPlayerAndEnemy(); gameFound = true; btnAttach.BackColor = Color.FromArgb(34, 177, 76); // Green btnAttach.Enabled = false; } catch (IndexOutOfRangeException ex) { MessageBox.Show("Game not found!"); throw ex; } }
private void tmrProcess_Tick(object sender, EventArgs e) { if (gameFound && !SA[0].HasExited) { // Only the base address or multiLevel addresses need to be established first int playerBaseAddress = mem.ReadInt(offsets.baseAddr); // Stores an address which is the base address of the player struct. int XAddress = mem.ReadMultiLevelPointer(offsets.baseAddr, 4, offsets.xPos); // Multi level pointer with 2 offsets is needed to find the address of X position, // then this address can be read as a float. int ZAddress = mem.ReadMultiLevelPointer(offsets.baseAddr, 4, offsets.zPos); int YAddress = mem.ReadMultiLevelPointer(offsets.baseAddr, 4, offsets.yPos); lblX.Text = mem.ReadFloat(XAddress).ToString(); lblZ.Text = mem.ReadFloat(ZAddress).ToString(); lblY.Text = mem.ReadFloat(YAddress).ToString(); lblHealth.Text = mem.ReadFloat(playerBaseAddress + offsets.health).ToString(); int Hotkey = ProcessMemoryReaderApi.GetKeyState(0x74);//F5 if ((Hotkey & 0x8000) != 0) { // Teleport to Grove Street mem.WriteFloat(XAddress, 2495); mem.WriteFloat(ZAddress, -1668); mem.WriteFloat(YAddress, 13); } int Hotkey2 = ProcessMemoryReaderApi.GetKeyState(0x75);//F6 if ((Hotkey2 & 0x8000) != 0) { // Teleport to Dome Stadium Roof mem.WriteFloat(XAddress, 2737); mem.WriteFloat(ZAddress, -1760); mem.WriteFloat(YAddress, 44); } int Hotkey3 = ProcessMemoryReaderApi.GetKeyState(0x76);//F7 if ((Hotkey3 & 0x8000) != 0) { // Teleport to Skyscraper mem.WriteFloat(XAddress, 1544); mem.WriteFloat(ZAddress, -1353); mem.WriteFloat(YAddress, 330); } } else { // Game has ended so stop performing readMemory etc gameFound = false; btnAttach.BackColor = Color.Red; btnAttach.Enabled = true; } }//tmrProcess
public Buff(ProcessMemoryReader reader, int pointer) { StartTime = reader.ReadFloat(pointer + Offsets.BuffStartTime); EndTime = reader.ReadFloat(pointer + Offsets.BuffEndTime); int buffInfo = reader.ReadInt(pointer + Offsets.BuffEntryBuff); if (buffInfo < 10) { return; } Name = reader.ReadCString(buffInfo + Offsets.BuffName, 240); }
void UpdatePlayerInfo() { int playerBase = Mem.ReadMultiLevelPointer(myProcess[0].MainModule.BaseAddress.ToInt32() + m_mainPlayer.baseAddress, 4, m_mainPlayer.multiLevel); int hp = Mem.ReadInt(playerBase - MainOffset + PlayerOffsets[0]); Vector3 pos = new Vector3(Mem.ReadFloat(playerBase - MainOffset + PlayerOffsets[1]), Mem.ReadFloat(playerBase - MainOffset + PlayerOffsets[2]), Mem.ReadFloat(playerBase - MainOffset + PlayerOffsets[3])); Vector3 velo = new Vector3(Mem.ReadFloat(playerBase - MainOffset + PlayerOffsets[4]), Mem.ReadFloat(playerBase - MainOffset + PlayerOffsets[5]), Mem.ReadFloat(playerBase - MainOffset + PlayerOffsets[6])); m_mainPlayer.Update(Mem.ReadInt(playerBase - MainOffset + PlayerOffsets[0]), pos, velo); foreach (PlayerData ai in m_AiPlayer) { int aiBase = Mem.ReadMultiLevelPointer(myProcess[0].MainModule.BaseAddress.ToInt32() + ai.baseAddress, 4, ai.multiLevel); hp = Mem.ReadInt(aiBase - MainOffset + PlayerOffsets[0]); pos = new Vector3(Mem.ReadFloat(aiBase - MainOffset + PlayerOffsets[1]), Mem.ReadFloat(aiBase - MainOffset + PlayerOffsets[2]), Mem.ReadFloat(aiBase - MainOffset + PlayerOffsets[3])); velo = new Vector3(Mem.ReadFloat(aiBase - MainOffset + PlayerOffsets[4]), Mem.ReadFloat(aiBase - MainOffset + PlayerOffsets[5]), Mem.ReadFloat(aiBase - MainOffset + PlayerOffsets[6])); ai.Update(hp, pos, velo); } }
private void LoopTMR_Tick(object sender, EventArgs e) { if (attach) { try { // Step2 Value를 찾아서 모니터링 (현재 값이 무엇인지 계속적으로 확인) int step2SturctAddress = mem.ReadMultiLevelPointer(step2Data.baseAddress, 4, step2Data.multiLevel); int step2value = mem.ReadInt(step2SturctAddress + step2Data.offsets.health); Step2ValueLBL.Text = "Step 2 Value: " + step2value; // Step8 Value를 찾아서 모니터링 int step8SturctAddress = mem.ReadMultiLevelPointer(step8Data.baseAddress, 4, step8Data.multiLevel); int step8value = mem.ReadInt(step8SturctAddress + step8Data.offsets.health); Step8ValueLBL.Text = "Step 8 Value: " + step8value; // Step9의 플레이어 데이터를 모니터링 int p1Base = mem.ReadMultiLevelPointer(step9PlayerData.baseAddress, 4, step9PlayerData.step9P1multiLevel); int p2Base = mem.ReadMultiLevelPointer(step9PlayerData.baseAddress, 4, step9PlayerData.step9P2multiLevel); int p3Base = mem.ReadMultiLevelPointer(step9PlayerData.baseAddress, 4, step9PlayerData.step9P3multiLevel); int p4Base = mem.ReadMultiLevelPointer(step9PlayerData.baseAddress, 4, step9PlayerData.step9P4multiLevel); P1LBL.Text = "P1: [" + mem.ReadInt(p1Base + step9PlayerData.teamOffset) + " 팀]" + mem.ReadString(p1Base + step9PlayerData.nameOffset) + ": " + mem.ReadFloat(p1Base + step9PlayerData.healthOffset); P2LBL.Text = "P2: [" + mem.ReadInt(p2Base + step9PlayerData.teamOffset) + " 팀]" + mem.ReadString(p2Base + step9PlayerData.nameOffset) + ": " + mem.ReadFloat(p2Base + step9PlayerData.healthOffset); P3LBL.Text = "P3: [" + mem.ReadInt(p3Base + step9PlayerData.teamOffset) + " 팀]" + mem.ReadString(p3Base + step9PlayerData.nameOffset) + ": " + mem.ReadFloat(p3Base + step9PlayerData.healthOffset); P4LBL.Text = "P4: [" + mem.ReadInt(p4Base + step9PlayerData.teamOffset) + " 팀]" + mem.ReadString(p4Base + step9PlayerData.nameOffset) + ": " + mem.ReadFloat(p4Base + step9PlayerData.healthOffset); // 크랙을 동작시켰을때, 현재 크랙이 값을 수정하도록 만드는 작업 int hotkey = ProcessMemoryReaderApi.GetKeyState(0x02); // 마우스 오른쪽키에 대한 상태 if ((hotkey & 0x8000) != 0) // 키가 눌렸을 경우 { if (crackState == false) // 크랙이 꺼져있는 경우에는 크랙 켜고 크랙 시도! { crackState = true; CrackStatusLBL.Text = "크랙 상태: On"; } else // 크랙이 켜져있는 경우에는 크랙을 끕니다. { crackState = false; CrackStatusLBL.Text = "크랙 상태: Off"; } } if (crackState) { Step2Solve(step2SturctAddress); // step2 Value를 1000으로 수정 Step8Solve(step8SturctAddress); // step2 Value를 1000으로 수정 } } catch (Exception ex) { crackState = false; MessageBox.Show("읽기 쓰기 오류: " + ex.Message); } } }
private void LoopTMR_Tick(object sender, EventArgs e) { if (attach) { try { // step2 value를 찿아서 모니터링 int structAddr = mem.ReadMultiLevelPointer( step2Data.baseAdress, 4, step2Data.multiLevel); ValueLBL.Text = "Step2Value : " + mem.ReadInt(structAddr + step2Data.offsets.step2_health); // 크랙이 값을 수정하는 코드 int hotkey = ProcessMemoryReaderApi.GetKeyState(0x02); // mouse_R button- 0x02 if ((hotkey & 0x8000) != 0) //키가눌렸을 경우 { if (crackState == false) { crackState = true; CrackStatusLBL.Text = "크랙 상태 : ON"; } else { crackState = false; CrackStatusLBL.Text = "크랙 상태 : OFF"; } } if (crackState) { Step2Solve(structAddr); //value 를 1000으로 고정해주는 함수 } } catch (Exception ex) { crackState = false; MessageBox.Show("읽기 쓰기 에러 !!!" + ex.Message); throw; } }//크랙을 동작시켰을때, 현재크랙의 값을 수정 }
private void timer1_Tick(object sender, EventArgs e) { if (ProcessFound) { // Store entities memory addresses int LocalPlayerAddress = Mem.ReadMultiLevelPointer(LocalPlayerBase, 4, LocalPlayerOff); int Enemy1Address = Mem.ReadMultiLevelPointer(Enemy1Base, 4, Enemy1Off); // Read Local PLayer Values int HealthValue = Mem.ReadInt(LocalPlayerAddress + off_health); int RiffleAmmoValue = Mem.ReadInt(LocalPlayerAddress + off_rifle_ammo); // Read Enemy 1 Values int Enemy1HealthValue = Mem.ReadInt(Enemy1Address); float Enemy1XPosValue = Mem.ReadFloat(Enemy1Address - Enemy1XPos); float Enemy1YPosValue = Mem.ReadFloat(Enemy1Address - Enemy1YPos); float Enemy1ZPosValue = Mem.ReadFloat(Enemy1Address - Enemy1ZPos); // Local Player Lables Health.Text = "Health: " + HealthValue.ToString(); RiffleAmmo.Text = "Riffle Ammo: " + RiffleAmmoValue.ToString(); // Enemy 1 Lables enemy1_hp_lable.Text = "Enemy 1 HP: " + Enemy1HealthValue.ToString(); enemy1_xpos_lable.Text = "X-Pos: " + Enemy1XPosValue.ToString(); enemy1_ypos_lable.Text = "Y-Pos: " + Enemy1YPosValue.ToString(); enemy1_zpos_lable.Text = "Z-Pos: " + Enemy1ZPosValue.ToString(); if (RiffleAmmoValue < 5) { // Set Local Player Riffle Ammo to 20 if it less than 5 Mem.WriteInt(LocalPlayerAddress + off_rifle_ammo, 20); // Set Local Player HP to 1000 when ammo is less han 5 Mem.WriteInt(LocalPlayerAddress + off_health, 1000); } // Left mouse button pressed int pressedLeftMouse = ProcessMemoryReaderApi.GetKeyState(01); if ((pressedLeftMouse & 0x8000) != 0) { Mem.WriteInt(LocalPlayerAddress + off_fire, 1); // Remove Y-axin recoil when shooting float Ymouse_pos = Mem.ReadFloat(LocalPlayerAddress + off_Ymouse); Ymouse_pos -= 0.38f; Mem.WriteFloat(LocalPlayerAddress + off_Ymouse, Ymouse_pos); } else { Mem.WriteInt(LocalPlayerAddress + off_fire, 0); } // F1 button pressed int pressedF1 = ProcessMemoryReaderApi.GetKeyState(0x70); if ((pressedF1 & 0x8000) != 0) { Mem.WriteFloat(LocalPlayerAddress + off_XPos, Enemy1XPosValue); Mem.WriteFloat(LocalPlayerAddress + off_YPos, Enemy1YPosValue); Mem.WriteFloat(LocalPlayerAddress + off_ZPos, Enemy1ZPosValue); } } }
private void timer1_Tick(object sender, EventArgs e) { if (GameFound) { int PlayerBase2 = PlayerBaseHM; int[] multiLevel2 = new int[] { 0x04 }; int playerBase2 = Mem.ReadMultiLevelPointer(PlayerBase2, 4, multiLevel2); label1.Text = "HP: " + Mem.ReadInt(playerBase2 + player.offsets.Health); label3.Text = "Mana: " + Mem.ReadInt(playerBase2 + player.offsets.Mana); if (Convert.ToString(Mem.ReadInt(playerBase + player.offsets.amslot)) == "0") { if (comboBox1.SelectedIndex == 2) { label4.Text = "M1: Empty"; } else if (comboBox1.SelectedIndex == 3) { label4.Text = "M2: Empty"; } else if (comboBox1.SelectedIndex == 4) { label4.Text = "M3: Empty"; } else if (comboBox1.SelectedIndex == 5) { label4.Text = "M4: Empty"; } else if (comboBox1.SelectedIndex == 6) { label4.Text = "A1: Empty"; } else if (comboBox1.SelectedIndex == 7) { label4.Text = "A2: Empty"; } else if (comboBox1.SelectedIndex == 8) { label4.Text = "A3: Empty"; } else if (comboBox1.SelectedIndex == 9) { label4.Text = "A4: Empty"; } } else { if (comboBox1.SelectedIndex == 2) { label4.Text = "M1: " + Convert.ToString(Mem.ReadInt(playerBase + player.offsets.amslot)); } else if (comboBox1.SelectedIndex == 3) { label4.Text = "M2: " + Convert.ToString(Mem.ReadInt(playerBase + player.offsets.amslot)); } else if (comboBox1.SelectedIndex == 4) { label4.Text = "M3: " + Convert.ToString(Mem.ReadInt(playerBase + player.offsets.amslot)); } else if (comboBox1.SelectedIndex == 5) { label4.Text = "M4: " + Convert.ToString(Mem.ReadInt(playerBase + player.offsets.amslot)); } else if (comboBox1.SelectedIndex == 6) { label4.Text = "A1: " + Convert.ToString(Mem.ReadInt(playerBase + player.offsets.amslot)); } else if (comboBox1.SelectedIndex == 7) { label4.Text = "A2: " + Convert.ToString(Mem.ReadInt(playerBase + player.offsets.amslot)); } else if (comboBox1.SelectedIndex == 8) { label4.Text = "A3: " + Convert.ToString(Mem.ReadInt(playerBase + player.offsets.amslot)); } else if (comboBox1.SelectedIndex == 9) { label4.Text = "A4: " + Convert.ToString(Mem.ReadInt(playerBase + player.offsets.amslot)); } } } }
private void GameChoice_SelectedIndexChanged(object sender, EventArgs e) { try { for (int i = 0; i < MyProcess.Length; i++) { if (GameChoice.SelectedItem.ToString().Contains(MyProcess[i].ProcessName)) { MyProcess[0] = Process.GetProcessById(int.Parse(GameChoice.Text.Replace(MyProcess[i].ProcessName + "-", ""))); mainModule = MyProcess[0].MainModule; Mem.ReadProcess = MyProcess[0]; Mem.OpenProcess(); GameFound = true; MainPlayer.baseAddress = Mem.ReadInt(0x50f4f4); MainPlayer.offsets = new PlayerDataAddr(); SetupEnemyVars(); } } } catch (Exception ex) { MessageBox.Show("Kunne ikke finde klienten, prøv igen: \n " + ex.Message, "Error"); } }