PHP Code:
#include <windows.h>
#include <tlhelp32.h> //th32.lib ou libth32.a
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <psapi.h>
#include <string.h>
#include <time.h>
#include <pthread.h>
char *name_lang = "name";
char *title_lang = "title";
char *selection_lang = "\nYour selection :";
char *menu_personnage = "Selection of charactere : \n\n";
char *menu = "Battle of immortals\n\n MENU\n\n1 - Start crusade \n2 - start bot heretic\n3 - Start bot simple\n4 - Announces\n5 - auto heal\n6 - auto mana\n7 - auto mana pet\n8 - auto pvp\n9 - auto change realm\n10 - auto loot\n11 - exit\n\nYour selection :";
char *menu_croisade_etape_1 = "\n\n Step 1 - Please indicate the offset of the crusade :";
char *menu_croisade_etape_2 = "\n Step 2 - Please specify the maximum number of crusade :";
char *menu_croisade_etape_3 = "\n Step 3 - Please specify the maximum number of monsters to kill on the Crusade :";
char *menu_croisade_etape_4 = "\n Step 3 - Please place your cursor on the item was activated to the crusade (press enter to save the coordonate)\n";
char *crusade_lang = "Mode crusade on\n\n";
char *crusade_lang_menu_1 = "\n you currently kills";
char *crusade_lang_menu_2 = "monsters of";
char *crusade_lang_menu_3 = "Crusades, you still";
char *crusade_lang_menu_4 = "monsters killed, and";
char *crusade_lang_menu_5 = "crusades";
char *menu_auto_hp_1 = "\n\n Please indicate the minimum value of life :";
char *hp_lang_1 = "MANAGEMENT HP\n\nHp current :";
char *hp_lang_2 = "\n- Hp minimum :";
char *menu_auto_hp_pet_1 = "\n\n Please indicate the minimum value of Hp :";
char *menu_realm_1 = "\n\nActivation si perte de vie superieur ou egale a (dans un laps de temp de 2 secondes) :";
char *menu_realm_2 = "\nPlease place your cursor on the system icone (press enter to save coordonate)";
char *menu_realm_3 = "\nPlease place your cursor on the change realm icone (press enter to save coordonate)";
char *menu_realm_4 = "\nPlease place your cursor on the realm where you want to switch (press enter to save coordonate)";
char *menu_auto_mana_1 = "\n\n Please indicate the minimum value of mana :";
char *mana_lang_1 = "MANAGEMENT MANA\n\nMana current :";
char *mana_lang_2 = "\n- mana minimum :";
char *menu_auto_mana_pet_1 = "\n\n Please indicate the minimum value of Mana :";
char *menu_auto_loop_1 = "\n\n Please indicate the number of times the operation must be repeated :";
char *menu_auto_loop_2 = "\n\n Please indicate the gap for hours :";
char *menu_auto_loop_3 = "\n\n Please indicate the deviation for minutes :";
char *menu_auto_loop_4 = "\n\n Please indicate the gap to the second :";
char *menu_auto_loop_6 = "Please place your cursor on the item to be activated to trigger the auto-loot (press enter to save coordonate)\n";
struct process {
DWORD pid;
char *name;
};
struct kickbar_time{
int heure;
int minute;
int seconde;
};
struct tm l_start;
struct tm *t_start;
RECT rc;
int thread_sec_pet = 0;
int thread_sec_life = 0;
int thread_sec_mana = 0;
int thread_sec_croisade = 0;
int thread_sec_bot_skill = 0;
int thread_sec_bot_simple = 0;
int thread_sec_annonce = 0;
int thread_sec_loot = 0;
int thread_sec_pvp = 0;
int thread_sec_realm = 0;
pthread_t thrd_pet;
pthread_t thrd_life;
pthread_t thrd_mana;
pthread_t thrd_croisade;
pthread_t thrd_bot_skill;
pthread_t thrd_bot_simple;
pthread_t thrd_annonce;
pthread_t thrd_loot;
pthread_t thrd_realm;
pthread_t thrd_pvp;
void calcul_heure(int heure, int min, int sec){
int ret_min = 0;
int ret_heure = 0;
/* CALCUL DES SECONDES */
if((int)t_start->tm_sec + sec >= 60){ // SI LE CALCULE DES SECONDES DEPASSE 60
if(t_start->tm_sec + sec == 60){ // SI LES SECONDES EGALE 60
l_start.tm_sec = 0;
ret_min = 1;
}else{ // SI LES SECONDE DEPASSE 60
l_start.tm_sec = (t_start->tm_sec + sec) - 60;
ret_min = 1;
}
}else{ // SI LES SECONDES NE DEPASSE PAS LES 60
l_start.tm_sec = (int)t_start->tm_sec + sec;
//int test = (int)t_start->tm_sec + sec;
}
/* FIN DES SECONDES */
/* CALCUL DES MINUTES */
if(t_start->tm_min + min + ret_min >= 60){ // SI LE CALCULE DES MINUTE DEPASSE 60
if(t_start->tm_min + min + ret_min == 60){ // SI LES MINUTES EGALE 60
l_start.tm_min = 0;
ret_heure = 1;
}else{ // SI LES MMINUTE DEPASSE 60
l_start.tm_min = (t_start->tm_min + min + ret_min) - 60;
ret_heure = 1;
}
}else{
l_start.tm_min = t_start->tm_min + min + ret_min;
}
/* FIN DES MINUTES */
/* CALCUL DES HEURE */
if(t_start->tm_hour + heure + ret_heure >= 24){ // SI LE CALCULE DES HEURES DEPASSE 24
if(t_start->tm_hour + heure + ret_heure == 24){ // SI LES HEURE EGALE 24
l_start.tm_hour = 0;
}else{ // SI LES HEURE DEPASSE 24
l_start.tm_hour = (t_start->tm_hour + heure + ret_heure) - 24;
}
}else{
l_start.tm_hour = t_start->tm_hour + heure + ret_heure;
}
/* FIN DES HEURES */
}
INT compare_date(){
int l_heure = l_start.tm_hour;
int l_min = l_start.tm_min;
int l_sec = l_start.tm_sec;
int t_heure = t_start->tm_hour;
int t_min = t_start->tm_min;
int t_sec = t_start->tm_sec;
if( l_heure < t_heure){
return 1;
}else if( l_heure == t_heure && l_min < t_min ){
return 1;
}else if(l_heure == t_heure && l_min == t_min && l_sec < t_sec ){
return 1;
}else{
return 0;
}
}
HWND *battle_of_immortal_table = NULL;
HWND *battle_of_immortal_table_temp;
int compt_processus = 0;
HWND *battle_of_immortal_table_windows = NULL;
HWND *battle_of_immortal_table_windows_temp;
int compt_windows = 0;
HWND battle_of_immortal_process; //Handle du processus de battle of immortals
HWND battle_of_immortal_windows; //Handle de la fenetre de battle of immortals
/*
INT max_kill = 60;
INT find_process = 0;
INT max_mana = 92740;
INT max_life = 50002;
INT max_mana_pet = 24000;
INT max_life_pet = 9400;
*/
/*********************************************************************************************************/
/*********************************************************************************************************/
/* */
/* DEFINITION DES OFFSETS DU JEU */
/* */
/*********************************************************************************************************/
/*********************************************************************************************************/
/* offset tchat */
INT offset_tchat = 0x018D31F7; /* tchat only */
/* private message */
INT offset_private_message = 0x018D31F3;
/* mana du pet */
INT offset_mana_pet = 0x00F14F40;
/* LIFE PET*/
INT offset_life_pet = 0x00F14C18;
/* TARGET */
INT offset_have_target = 0x011826F4;
/* BAG */
INT offset_bag = 0x11C32BC;
/* stash */
INT offset_stash = 0x0136922C;
/* life charactere */
INT offset_life = 0x0120F7AC;
/* mana charactere */
INT offset_mana = 0x0120FAD4;
/* xp skill */
INT offset_xp_skill = 0x010DEB88;
/* enleve la protection pvp */
INT offset_protection_pvp = 0x017C2ECC;
/* target pvp */
INT offset_target_pvp = 0x01178B54;
/* nom du joeuur */
int offset_name_player = 0x00181E50; //pseudo du joueur
INT offset_number_group = 0x00EEEB94;
INT offset_depart_life_group = 0x00EEECE8;
INT ecart_offset_life_group = 0xE0;
INT table_life_group[7];
typedef unsigned char Byte;
/*********************************************************************************************************/
/*********************************************************************************************************/
/* */
/* FONCTION DE LECTURE DES OFFSETS DU JEU */
/* */
/*********************************************************************************************************/
/*********************************************************************************************************/
/***************************************/
/***************************************/
/* FONCTION */
/* REMOVE PROTECTION PVP */
/* */
/***************************************/
/***************************************/
void protection_pvp(HWND handle_game, INT choix){
DWORD newdatasize = sizeof(Byte);
if( choix == 0 ){
Byte write = 0;
WriteProcessMemory(battle_of_immortal_process,(LPVOID)offset_protection_pvp, &write, newdatasize, NULL );
}else{
Byte write = 1;
WriteProcessMemory(battle_of_immortal_process,(LPVOID)offset_protection_pvp, &write, newdatasize, NULL );
}
}
/***************************************/
/***************************************/
/* FONCTION */
/* ETAT TARGET PVP */
/* */
/***************************************/
/***************************************/
int have_target_pvp(HWND handle_game){
Byte dataread;
DWORD newdatasize = sizeof(Byte);
ReadProcessMemory(battle_of_immortal_process, (LPVOID)offset_target_pvp, &dataread, newdatasize, NULL);
return (INT)dataread;
}
void send_key(HWND handle_game, INT value){
PostMessage(handle_game,WM_KEYDOWN, value,0);
PostMessage(handle_game,WM_KEYUP, value,0);
}
/***************************************/
/***************************************/
/* FONCTION */
/* COMPTE GROUPE */
/* */
/***************************************/
/***************************************/
INT compt_group(HWND handle_game){
INT dataread;
DWORD newdatasize = sizeof(INT);
ReadProcessMemory(battle_of_immortal_process, (LPVOID)offset_number_group, &dataread, newdatasize, NULL);
return dataread;
}
/***************************************/
/***************************************/
/* FONCTION */
/* LIFE DU GROUPE */
/* */
/***************************************/
/***************************************/
INT charge_life_group(HWND handle_game){
INT dataread;
DWORD newdatasize = sizeof(INT);
table_life_group[0] = compt_group(handle_game);
if( table_life_group[0] > 1 ){
int offset_lecture_life;
int i;
for(i = 0; i<(table_life_group[0] - 1); i++){
offset_lecture_life = (i * ecart_offset_life_group) + offset_depart_life_group;
ReadProcessMemory(battle_of_immortal_process, (LPVOID)offset_lecture_life, &dataread, newdatasize, NULL);
table_life_group[i+1] = dataread;
}
return 1;
}else{
return 0;
}
}
/***************************************/
/***************************************/
/* FONCTION */
/* ETAT TCHAT */
/* */
/***************************************/
/***************************************/
void close_tchat(HWND handle_game){
Byte dataread;
DWORD newdatasize = sizeof(Byte);
ReadProcessMemory(battle_of_immortal_process, (LPVOID)offset_tchat, &dataread, newdatasize, NULL);
if( (INT)dataread == 1 ){
send_key(handle_game, VK_RETURN);
}
}
/***************************************/
/***************************************/
/* FONCTION */
/* ETAT PRIVATE MESSAGE */
/* */
/***************************************/
/***************************************/
INT have_private_message(HWND handle_game){
Byte dataread;
DWORD newdatasize = sizeof(Byte);
ReadProcessMemory(battle_of_immortal_process, (LPVOID)offset_private_message, &dataread, newdatasize, NULL);
return (INT)dataread;
}
/***************************************/
/***************************************/
/* FONCTION */
/* VALUE PET MANA */
/* */
/***************************************/
/***************************************/
INT quantite_mana_pet(HWND handle_game){
INT dataread;
DWORD newdatasize = sizeof(int);
ReadProcessMemory(battle_of_immortal_process, (LPVOID)offset_mana_pet, &dataread, newdatasize, NULL);
return (INT)dataread;
}
/***************************************/
/***************************************/
/* FONCTION */
/* VALUE PET LIFE */
/* */
/***************************************/
/***************************************/
INT quantite_life_pet(HWND handle_game){
INT dataread;
DWORD newdatasize = sizeof(int);
ReadProcessMemory(battle_of_immortal_process, (LPVOID)offset_life_pet, &dataread, newdatasize, NULL);
return (INT)dataread;
}
/***************************************/
/***************************************/
/* FONCTION */
/* ETAT BAG */
/* */
/***************************************/
/***************************************/
INT state_bag(HWND handle_game){
Byte dataread;
DWORD newdatasize = sizeof(Byte);
ReadProcessMemory(battle_of_immortal_process, (LPVOID)offset_bag, &dataread, newdatasize, NULL);
return (INT)dataread;
}
/***************************************/
/***************************************/
/* FONCTION */
/* ETAT STASH */
/* */
/***************************************/
/***************************************/
INT state_stash(HWND handle_game){
Byte dataread;
DWORD newdatasize = sizeof(Byte);
ReadProcessMemory(battle_of_immortal_process, (LPVOID)offset_stash, &dataread, newdatasize, NULL);
return (INT)dataread;
}
/***************************************/
/***************************************/
/* FONCTION */
/* SI TARGET */
/* */
/***************************************/
/***************************************/
INT have_target(HWND handle_game){
Byte dataread;
DWORD newdatasize = sizeof(Byte);
ReadProcessMemory(battle_of_immortal_process, (LPVOID)offset_have_target, &dataread, newdatasize, NULL);
return (INT)dataread;
}
/***************************************/
/***************************************/
/* FONCTION */
/* VALUE EXP */
/* */
/***************************************/
/***************************************/
INT have_xp(HWND handle_game){
int dataread;
DWORD newdatasize = sizeof(int);
ReadProcessMemory(battle_of_immortal_process, (LPVOID)offset_xp_skill, &dataread, newdatasize, NULL);
if( dataread == 1000){
return 1;
}else{
return 0;
}
}
/***************************************/
/***************************************/
/* FONCTION */
/* VALUE MANA */
/* */
/***************************************/
/***************************************/
INT quantite_mana(HWND handle_game){
int dataread;
DWORD newdatasize = sizeof(int);
ReadProcessMemory(battle_of_immortal_process, (LPVOID)offset_mana, &dataread, newdatasize, NULL);
return dataread;
}
/***************************************/
/***************************************/
/* FONCTION */
/* VALUE LIFE */
/* */
/***************************************/
/***************************************/
INT quantite_life(HWND handle_game){
int dataread;
DWORD newdatasize = sizeof(int);
ReadProcessMemory(battle_of_immortal_process, (LPVOID)offset_life, &dataread, newdatasize, NULL);
return dataread;
}
/***************************************/
/***************************************/
/* FONCTION */
/* NOM TARGET */
/* */
/***************************************/
/***************************************/
CHAR* name_target(HWND handle_game){
INT offset_name_target = 0x011816EC;
char *dataread[50];
DWORD newdatasize = sizeof(char[50]);
ReadProcessMemory(battle_of_immortal_process, (LPVOID)offset_name_target, &dataread, newdatasize, NULL);
return *dataread;
}
/*********************************************************************************************************/
/*********************************************************************************************************/
/* */
/* FONCTION LISTING DES PROCESSUS */
/* */
/*********************************************************************************************************/
/*********************************************************************************************************/
BOOL CALLBACK MyEnumProc(HWND hWnd, LPARAM lParam) {
char classe[500];
GetClassName(hWnd,classe,500);
if(strstr(classe, "_PERFECTWORLD_HUGEROCK")) {
battle_of_immortal_table_windows_temp = (HWND*) realloc(battle_of_immortal_table_windows, (compt_windows + 1)*sizeof(INT));
battle_of_immortal_table_windows = battle_of_immortal_table_windows_temp;
battle_of_immortal_table_windows[compt_windows] = hWnd;
compt_windows++;
}
return TRUE;
}
void SetDebugPrivilege(){
TOKEN_PRIVILEGES privilege;
LUID Luid;
HANDLE handle1;
HANDLE handle2;
handle1 = OpenProcess(PROCESS_ALL_ACCESS, FALSE, GetCurrentProcessId());
OpenProcessToken(handle1, TOKEN_ALL_ACCESS, &handle2);
LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &Luid);
privilege.PrivilegeCount = 1;
privilege.Privileges[0].Luid = Luid;
privilege.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(handle2, FALSE, &privilege, sizeof(privilege), NULL, NULL);
CloseHandle(handle2);
CloseHandle(handle1);
}
/*********************************************************************************************************/
/*********************************************************************************************************/
/* */
/* VARIABLE GLOBALE DES THREADS */
/* */
/*********************************************************************************************************/
/*********************************************************************************************************/
INT auto_mana_pet = 0;
INT mana_actuelle_pet = 0;
INT auto_hp_pet = 0;
INT hp_actuelle_pet = 0;
time_t timestamp_start;
int number;
int heure;
int min;
int sec;
int compt_i;
RECT rc;
POINT table_position[100];
int count = 0;
int life_change_realm = 0;
int life_change_pvp = 0;
POINT position_button_sys;
POINT position_button_realm;
POINT position_realm;
int auto_mana = 0;
int mana_actuelle = 0;
int dataread;
int finish = 0;
int compt_croisade = 0;
int rest_croisade = 0;
int rest_monster = 0;
int passage_boucle = 0;
DWORD newdatasize = sizeof(int);
int offset_croisade = 0;
int max_croisade = 0;
int max_kill_croisade = 0;
POINT pos;
int test = 0;
int auto_hp = 0;
int hp_actuelle = 0;
/*********************************************************************************************************/
/*********************************************************************************************************/
/* */
/* D**** DES THREAD */
/* */
/*********************************************************************************************************/
/*********************************************************************************************************/
/***************************************/
/***************************************/
/* */
/* THREAD CROISADE */
/* */
/***************************************/
/***************************************/
void* thread_croisade(){
thread_sec_croisade = 1;
/***reinitialisation ***/
int finish = 0;
int compt_croisade = 0;
int rest_croisade = 0;
int rest_monster = 0;
int passage_boucle = 0;
int x = 0;
int y = 0;
do{
ReadProcessMemory(battle_of_immortal_process, (LPVOID)offset_croisade, &dataread, newdatasize, NULL);
if( compt_croisade == max_croisade ){ //Si fin des croisades on ferme le programme
finish = 1;
}
if( passage_boucle == 1 && dataread == max_kill_croisade ){
passage_boucle = 0;
compt_croisade --;
}else{
passage_boucle = 0;
}
close_tchat(battle_of_immortal_windows); //on ferme le tchat si ouvert
rest_croisade = max_croisade - compt_croisade;
rest_monster = max_kill_croisade - dataread;
if( dataread == max_kill_croisade && finish != 1){
test = 1;
passage_boucle = 1;
sleep(12000);
close_tchat(battle_of_immortal_windows); //on ferme le tchat si ouvert
if(state_stash(battle_of_immortal_windows) == 1){ //si stash ouvert, on ferme le bag
send_key(battle_of_immortal_windows, 0x42); //b
sleep(300);
}
if(state_bag(battle_of_immortal_windows) != 1){ //si le bag est fermer, on l'ouvre
send_key(battle_of_immortal_windows, 0x42); //b
sleep(300);
}
SetForegroundWindow(battle_of_immortal_windows); //On met le processus en premier plan
sleep(400);
RECT rc;
GetWindowRect(battle_of_immortal_windows, &rc);
x = pos.x + rc.left;
y = pos.y + rc.top;
SetCursorPos(x, y);
Sleep(200);
mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0); //boutton gauche appuyer
mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0); //boutton gauche relacher
Sleep(500);
send_key(battle_of_immortal_windows, VK_RETURN); //enter
if(state_bag(battle_of_immortal_windows) == 1){ //si le bag est ouvert, on le ferme
send_key(battle_of_immortal_windows, 0x42); //b
}
compt_croisade ++;
}
sleep(4000);
}while(finish != 1 && thread_sec_croisade == 1);
thread_sec_croisade = 0;
}
/***************************************/
/***************************************/
/* */
/* THREAD BOT SKILL */
/* */
/***************************************/
/***************************************/
void* thread_bot_skill(){
protection_pvp(battle_of_immortal_process, 0);
thread_sec_bot_skill = 1;
int compt_healt = 0;
int compt_aoe_heal = 0;
int compt_aoe_pet = 0;
int compt_aoe_skill_1 = 0;
int compt_aoe_skill_2 = 0;
int compt_power_1 = 0;
int compt_power_2 = 0;
int compt_buf_1 = 300;
int compt_buf_2 = 600;
do{
sleep(1000);
close_tchat(battle_of_immortal_windows); //on ferme le tchat si ouvert
if( have_private_message(battle_of_immortal_process) != 1 ){ // SI PRIVATE MESSAGE ON NE FAIT RIEN
if( have_target(battle_of_immortal_process) == 1 ){ // SI TARGET
/* ICI LES SKILLS QUI ONT BESOINT D'UNE TARGET */
if(compt_power_1 >= 5){
send_key(battle_of_immortal_windows, 0x32); //press 2
compt_power_1 = 0;
sleep(1000);
}
if( compt_power_2 >= 120 ){
send_key(battle_of_immortal_windows, VK_F2);
compt_power_2 = 0;
sleep(1000);
}
/* FIN DES SKILLS QUI ONT BESOIN D'UNE TARGET */
}else{
/* SI PAS TARGET */
send_key(battle_of_immortal_windows,VK_TAB); //press tab
sleep(200);
send_key(battle_of_immortal_windows, 0x31); //press 1
sleep(1000);
/* FIN PAS TARGET */
}
/* SKILL SANS TARGET */
if(compt_buf_1 >= 300){
send_key(battle_of_immortal_windows, VK_F5);
compt_buf_1 = 0;
sleep(1000);
}
if(compt_buf_2 >= 600){
send_key(battle_of_immortal_windows, VK_F6);
compt_buf_2 = 0;
sleep(1000);
}
if(compt_aoe_heal >= 150){
send_key(battle_of_immortal_windows, VK_F1);
compt_aoe_heal = 0;
sleep(1000);
}
if(compt_healt >= 25){
send_key(battle_of_immortal_windows, 0x36); //6
compt_healt = 0;
sleep(1000);
}
if( compt_aoe_skill_1 >= 30){
send_key(battle_of_immortal_windows, 0x33); //3
compt_aoe_skill_1 = 0;
sleep(1000);
}
if( compt_aoe_skill_2 >= 100){
send_key(battle_of_immortal_windows, 0x37); //7
compt_aoe_skill_2 = 0;
sleep(1000);
}
if(compt_aoe_pet >= 3){
send_key(battle_of_immortal_windows ,0x38); //8
compt_aoe_pet = 0;
sleep(1000);
}
if( have_xp(battle_of_immortal_windows) == 1 ){
send_key(battle_of_immortal_windows ,VK_F4);
sleep(1000);
}
/* FIN SKILL SANS TARGET */
/* INCREMENTATION DES VARIABLES */
compt_healt++;
compt_aoe_heal++;
compt_aoe_pet++;
compt_aoe_skill_1++;
compt_aoe_skill_2++;
compt_power_1++;
compt_power_2++;
compt_buf_1++;
compt_buf_2++;
/* INCREMENTATION DES VARIABLES */
}
}while(thread_sec_bot_skill == 1);
}
/***************************************/
/***************************************/
/* */
/* THREAD BOT SIMPLE */
/* */
/***************************************/
/***************************************/
void *thread_bot_simple(){
thread_sec_bot_simple = 1;
do{
if( have_private_message(battle_of_immortal_process) != 1 ){ // SI PRIVATE MESSAGE ON NE FAIT RIEN
if( have_target(battle_of_immortal_process) != 1 ){ // SI TARGET
/* SI PAS TARGET */
send_key(battle_of_immortal_windows,VK_TAB); //press tab
sleep(200);
send_key(battle_of_immortal_windows, 0x31); //press 1
sleep(1000);
/* FIN PAS TARGET */
}
}
}while(thread_sec_bot_simple == 1);
}
/***************************************/
/***************************************/
/* */
/* THREAD ANNONCE */
/* */
/***************************************/
/***************************************/
void *thread_annonce(){
thread_sec_annonce = 1;
do{
send_key(battle_of_immortal_windows,VK_RETURN);
sleep(200);
send_key(battle_of_immortal_windows,VK_UP);
sleep(200);
send_key(battle_of_immortal_windows, VK_RETURN); //press 1
sleep(22000);
}while(thread_sec_annonce == 1);
}
/***************************************/
/***************************************/
/* */
/* THREAD HEAL */
/* */
/***************************************/
/***************************************/
void* thread_life(){
thread_sec_life = 1;
do{
hp_actuelle = quantite_life(battle_of_immortal_process);
sleep(500);
if( hp_actuelle <= auto_hp ){
send_key(battle_of_immortal_windows, 0x35); //5
}
}while(thread_sec_life == 1);
}
/***************************************/
/***************************************/
/* */
/* THREAD MANA */
/* */
/***************************************/
/***************************************/
void* thread_mana(){
thread_sec_mana = 1;
do{
mana_actuelle = quantite_mana(battle_of_immortal_process);
sleep(500);
if( mana_actuelle <= auto_mana ){
send_key(battle_of_immortal_windows, 0x39); //0
}
}while(thread_sec_mana == 1);
}
/***************************************/
/***************************************/
/* */
/* THREAD PET */
/* */
/***************************************/
/***************************************/
void* thread_pet(){
thread_sec_pet = 1;
do{
mana_actuelle_pet = quantite_mana_pet(battle_of_immortal_process);
hp_actuelle_pet = quantite_life_pet(battle_of_immortal_process);
sleep(500);
if( mana_actuelle_pet <= auto_mana_pet || hp_actuelle_pet <= auto_hp_pet){
send_key(battle_of_immortal_windows, 0x30); //0
}
}while(thread_sec_pet == 1);
}
/***************************************/
/***************************************/
/* */
/* THREAD AUTO REALM */
/* */
/***************************************/
/***************************************/
void *thread_realm(){
thread_sec_pvp = 1;
int end = 0;
int old_life_value = quantite_life(battle_of_immortal_process);
int old_table_life_value[7];
int i;
int detection_attack = 0;
int have_target_once = 0;
if( charge_life_group(battle_of_immortal_process) == 1 ){
for(i = 0; i < table_life_group[0] - 1; i++){
old_table_life_value[i] = table_life_group[i+1];
}
}
int table_old_life_change_real[7];
do{
detection_attack = 0;
if(charge_life_group(battle_of_immortal_process) == 1){
for(i = 0; i < table_life_group[0] - 1; i++){
if( old_table_life_value[i] - life_change_realm >= table_life_group[i+1] ){
detection_attack = 1;
}
}
}
if( old_life_value - life_change_pvp >= quantite_life(battle_of_immortal_process) || detection_attack == 1 ){ //Si on detecte une perte de vie
send_key(battle_of_immortal_windows, VK_F7);
sleep(500);
send_key(battle_of_immortal_windows, VK_F8);
SetForegroundWindow(battle_of_immortal_windows); //On met le processus en premier plan
sleep(400);
GetWindowRect(battle_of_immortal_windows, &rc);
SetCursorPos(position_button_sys.x + rc.left, position_button_sys.y + rc.top);
Sleep(200);
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); //boutton gauche appuyer
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); //boutton gauche relacher
sleep(500);
GetWindowRect(battle_of_immortal_windows, &rc);
SetCursorPos(position_button_realm.x + rc.left, position_button_realm.y + rc.top);
Sleep(200);
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); //boutton gauche appuyer
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); //boutton gauche relacher
sleep(500);
GetWindowRect(battle_of_immortal_windows, &rc);
SetCursorPos(position_realm.x + rc.left, position_realm.y + rc.top);
Sleep(200);
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); //boutton gauche appuyer
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); //boutton gauche relacher
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); //boutton gauche appuyer
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); //boutton gauche relacher
end = 1;
thread_sec_realm = 0;
old_life_value = quantite_life(battle_of_immortal_process);
}else{
old_life_value = quantite_life(battle_of_immortal_process);
if( charge_life_group(battle_of_immortal_process) == 1 ){
for(i = 0; i < table_life_group[0] - 1; i++){
old_table_life_value[i] = table_life_group[i+1];
}
}
}
sleep(500);
}while(thread_sec_realm == 1 && end == 0);
thread_sec_realm = 0;
}
/***************************************/
/***************************************/
/* */
/* THREAD AUTO PVP */
/* */
/***************************************/
/***************************************/
void *thread_pvp(){
thread_sec_pvp = 1;
int end = 0;
int old_life_value = quantite_life(battle_of_immortal_process);
int old_table_life_value[7];
int i;
int detection_attack = 0;
int have_target_once = 0;
if( charge_life_group(battle_of_immortal_process) == 1 ){
for(i = 0; i < table_life_group[0] - 1; i++){
old_table_life_value[i] = table_life_group[i+1];
}
}
int table_old_life_change_real[7];
do{
detection_attack = 0;
if(charge_life_group(battle_of_immortal_process) == 1){
for(i = 0; i < table_life_group[0] - 1; i++){
if( old_table_life_value[i] - life_change_realm >= table_life_group[i+1] ){
detection_attack = 1;
}
}
}
protection_pvp(battle_of_immortal_process, 0);
if( old_life_value - life_change_pvp >= quantite_life(battle_of_immortal_process) || detection_attack == 1 ){ //Si on detecte une perte de vie
thread_sec_bot_skill = 0;
sleep(500);
do{
if( have_target_pvp(battle_of_immortal_process) == 0 ){
protection_pvp(battle_of_immortal_process, 1);
sleep(500);
send_key(battle_of_immortal_windows,VK_TAB); //press tab
sleep(200);
send_key(battle_of_immortal_windows, 0x31); //press 1
sleep(1000);
}else{
have_target_once = 1;
protection_pvp(battle_of_immortal_process, 1);
}
if( have_target_pvp(battle_of_immortal_process) == 0 && have_target_once == 1){
pthread_create(&thrd_bot_skill, NULL, thread_bot_skill, NULL);
end = 1;
have_target_once = 1;
}
}while(end == 0 || have_target_once == 0);
}else{
old_life_value = quantite_life(battle_of_immortal_process);
if( charge_life_group(battle_of_immortal_process) == 1 ){
for(i = 0; i < table_life_group[0] - 1; i++){
old_table_life_value[i] = table_life_group[i+1];
}
}
}
sleep(500);
}while(thread_sec_pvp == 1 && end == 0);
thread_sec_pvp = 0;
}
/***************************************/
/***************************************/
/* */
/* THREAD AUTO LOOT */
/* */
/***************************************/
/***************************************/
void *thread_loot(){
thread_sec_loot = 1;
timestamp_start = time(NULL);
t_start = localtime(×tamp_start);
calcul_heure(heure, min, sec);
char buffer_l[6];
char buffer_t[6];
int heure_l = 0;
int heure_t = 0;
do{
sleep(3000);
timestamp_start = time(NULL);
t_start = localtime(×tamp_start);
if( compare_date() == 1 ){//ON LANCE L'AUTO LOOT
calcul_heure(heure, min, sec);
close_tchat(battle_of_immortal_windows); //on ferme le tchat si ouvert
if(state_stash(battle_of_immortal_windows) == 1){ //si stash ouvert, on ferme le bag
send_key(battle_of_immortal_windows, 0x42); //b
sleep(300);
}
if(state_bag(battle_of_immortal_windows) != 1){ //si le bag est fermer, on l'ouvre
send_key(battle_of_immortal_windows, 0x42); //b
sleep(300);
}
SetForegroundWindow(battle_of_immortal_windows); //On met le processus en premier plan
sleep(400);
GetWindowRect(battle_of_immortal_windows, &rc);
SetCursorPos(table_position[count].x + rc.left, table_position[count].y + rc.top);
Sleep(200);
mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0); //boutton gauche appuyer
mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0); //boutton gauche relacher
count ++;
}
}while( count != number && thread_sec_loot == 1);
thread_sec_loot = 0;
}
/*********************************************************************************************************/
/*********************************************************************************************************/
/* */
/* D**** FONCTION PRINCIPALE */
/* */
/*********************************************************************************************************/
/*********************************************************************************************************/
int WINAPI WinMain(HINSTANCE a,HINSTANCE b, LPSTR c, int d)
{
int *processus;
HWND m_processus;
char title[80];
//POINT pos;
int offset_definit;
EnumWindows(MyEnumProc, 0);
int i = 0;
int rep_pers = 0;
int buff_pers;
char temp_pers[20];
long resultat_pers;
char saisie_pers[20];
char dataread_handle[20];
DWORD newdatasize = sizeof(char[20]);
printf("%s", menu_personnage);
for(i=0; i < compt_windows; i++){
GetWindowText(battle_of_immortal_table_windows[i],title,sizeof(title));
battle_of_immortal_table_temp = (HWND*) realloc(battle_of_immortal_table, (i + 1)*sizeof(INT));
battle_of_immortal_table = battle_of_immortal_table_temp;
GetWindowThreadProcessId(battle_of_immortal_table_windows[i], (LPDWORD) &processus);
battle_of_immortal_table[i] = OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_ALL_ACCESS, TRUE, (DWORD) processus);
ReadProcessMemory(battle_of_immortal_table[i], (LPVOID)offset_name_player, &dataread_handle, newdatasize, NULL);
printf("%i -\n %s : %s\n %s : %s\n\n", i+1, name_lang, dataread_handle, title_lang, title);
}
printf("%s", selection_lang);
fflush (stdout);
fgets (saisie_pers, sizeof saisie_pers, stdin);
rep_pers = sscanf (saisie_pers, "%[0-9-]s", temp_pers);
resultat_pers = strtol (temp_pers, NULL, 10);
battle_of_immortal_process = battle_of_immortal_table[(int)resultat_pers - 1];
battle_of_immortal_windows = battle_of_immortal_table_windows[(int)resultat_pers - 1];
free(battle_of_immortal_table_windows);
free(battle_of_immortal_table);
char temp[20];
int rep = 1;
long resultat_selection;
do{
char saisie[20];
system("cls");
ReadProcessMemory(battle_of_immortal_process, (LPVOID)offset_name_player, &dataread_handle, newdatasize, NULL);
if( thread_sec_croisade == 0 ){
printf("THREAD CROISADE : OFF\n");
}else{
printf("THREAD CROISADE : ON -> %i / %i sur %i / %i \n", dataread, max_kill_croisade, finish);
}
if( thread_sec_bot_skill == 0){
printf("THREAD BOT HRTC : OFF\n");
}else{
printf("THREAD BOT HRTC : ON\n");
}
if(thread_sec_bot_simple == 0){
printf("THREAD BOT SIMPLE : OFF\n");
}else{
printf("THREAD BOT SIMPLE : ON\n");
}
if( thread_sec_annonce == 0){
printf("THREAD ANNONCE : OFF\n");
}else{
printf("THREAD ANNONCE : ON\n");
}
if( thread_sec_life == 0 ){
printf("THREAD HEAL : OFF\n");
}else{
printf("THREAD HEAL : ON -> Heal min : %i\n", auto_hp);
}
if( thread_sec_mana == 0 ){
printf("THREAD MANA : OFF\n");
}else{
printf("THREAD MANA : ON -> Mana min : %i\n", auto_mana);
}
if( thread_sec_pet == 0 ){
printf("THREAD PET : OFF\n");
}else{
printf("THREAD PET : ON -> Mana min : %i - Heal min : %i\n", auto_mana_pet , auto_hp_pet);
}
if(thread_sec_realm == 0){
printf("THREAD REALM : OFF\n");
}else{
printf("THREAD REALM : ON -> life loose : %i - player detected : %i\n", life_change_realm, table_life_group[0]);
}
if( thread_sec_loot == 0){
printf("THREAD AUTO-LOOT : OFF\n");
}else{
printf("THREAD AUTO-LOOT : ON\n");
}
printf("\n- %s - %s",dataread_handle, menu);
fflush (stdout);
fgets (saisie, sizeof saisie, stdin);
rep = sscanf (saisie, "%[0-9-]s", temp);
resultat_selection = strtol (temp, NULL, 10);
if(resultat_selection == 1){
if(thread_sec_croisade == 0){
printf("%s", menu_croisade_etape_1);
fflush (stdout);
fgets (saisie, sizeof saisie, stdin);
rep = sscanf (saisie, "%[0-9-]s", temp);
offset_croisade = strtol (temp, NULL, 10);
printf("%s", menu_croisade_etape_2);
fflush (stdout);
fgets (saisie, sizeof saisie, stdin);
rep = sscanf (saisie, "%[0-9-]s", temp);
max_croisade = strtol (temp, NULL, 10);
printf("%s", menu_croisade_etape_3);
fflush (stdout);
fgets (saisie, sizeof saisie, stdin);
rep = sscanf (saisie, "%[0-9-]s", temp);
max_kill_croisade = strtol (temp, NULL, 10);
printf("%s", menu_croisade_etape_4);
system("pause");
RECT rc;
GetWindowRect(battle_of_immortal_windows, &rc);
GetCursorPos(&pos);
pos.x -= rc.left;
pos.y -= rc.top;
pthread_create(&thrd_croisade, NULL, thread_croisade, NULL);
}else{
thread_sec_croisade = 0;
}
}
if(resultat_selection == 2){ // BOT SKILL
if(thread_sec_bot_skill == 0){
pthread_create(&thrd_bot_skill, NULL, thread_bot_skill, NULL);
}else{
thread_sec_bot_skill = 0;
}
}
if(resultat_selection == 3){ // BOT SIMPLE
if(thread_sec_bot_simple == 0){
pthread_create(&thrd_bot_simple, NULL, thread_bot_simple, NULL);
}else{
thread_sec_bot_simple = 0;
}
}
if(resultat_selection == 4){ // ANNONCE
if(thread_sec_annonce == 0){
pthread_create(&thrd_annonce, NULL, thread_annonce, NULL);
}else{
thread_sec_annonce = 0;
}
}
if(resultat_selection == 5){ // AUTO HEAL
if(thread_sec_life == 0){
printf("%s", menu_auto_hp_1);
fflush (stdout);
fgets (saisie, sizeof saisie, stdin);
rep = sscanf (saisie, "%[0-9-]s", temp);
auto_hp = strtol(temp, NULL, 10);
pthread_create(&thrd_life, NULL, thread_life, NULL);
}else{
thread_sec_life = 0;
}
}
if(resultat_selection == 6){ // AUTO MANA
if(thread_sec_mana == 0){
printf("%s", menu_auto_mana_1);
fflush (stdout);
fgets (saisie, sizeof saisie, stdin);
rep = sscanf (saisie, "%[0-9-]s", temp);
auto_mana = strtol(temp, NULL, 10);
pthread_create(&thrd_mana, NULL, thread_mana, NULL);
}else{
thread_sec_mana = 0;
}
}
if(resultat_selection == 7){ // AUTO MANA & HEAL PET
if( thread_sec_pet == 0 ){
printf("%s", menu_auto_mana_pet_1);
fflush (stdout);
fgets (saisie, sizeof saisie, stdin);
rep = sscanf (saisie, "%[0-9-]s", temp);
auto_mana_pet = strtol(temp, NULL, 10);
printf("%s", menu_auto_hp_pet_1);
fflush (stdout);
fgets (saisie, sizeof saisie, stdin);
rep = sscanf (saisie, "%[0-9-]s", temp);
auto_hp_pet = strtol(temp, NULL, 10);
pthread_create(&thrd_pet, NULL, thread_pet, NULL);
}else{
thread_sec_pet = 0;
}
}
if(resultat_selection == 8){
if(thread_sec_realm == 0 ){
charge_life_group(battle_of_immortal_process);
printf("%s", menu_realm_1);
fflush (stdout);
fgets (saisie, sizeof saisie, stdin);
rep = sscanf (saisie, "%[0-9-]s", temp);
life_change_pvp = strtol(temp, NULL, 10);
protection_pvp(battle_of_immortal_process, 0);
pthread_create(&thrd_pvp, NULL, thread_pvp, NULL);
}else{
protection_pvp(battle_of_immortal_process, 0);
thread_sec_pvp = 0;
}
}
if(resultat_selection == 9){
if(thread_sec_realm == 0 ){
charge_life_group(battle_of_immortal_process);
printf("%s", menu_realm_1);
fflush (stdout);
fgets (saisie, sizeof saisie, stdin);
rep = sscanf (saisie, "%[0-9-]s", temp);
life_change_realm = strtol(temp, NULL, 10);
printf("%s" ,menu_realm_2);
system("pause");
GetWindowRect(battle_of_immortal_windows, &rc);
GetCursorPos(&position_button_sys);
position_button_sys.x -= rc.left;
position_button_sys.y -= rc.top;
printf("%s" ,menu_realm_3);
system("pause");
GetWindowRect(battle_of_immortal_windows, &rc);
GetCursorPos(&position_button_realm);
position_button_realm.x -= rc.left;
position_button_realm.y -= rc.top;
printf("%s" ,menu_realm_4);
system("pause");
GetWindowRect(battle_of_immortal_windows, &rc);
GetCursorPos(&position_realm);
position_realm.x -= rc.left;
position_realm.y -= rc.top;
pthread_create(&thrd_realm, NULL, thread_realm, NULL);
}else{
thread_sec_pvp = 0;
}
}
if(resultat_selection == 10){
if(thread_sec_loot == 0 ){
printf("%s", menu_auto_loop_1);
fflush (stdout);
fgets (saisie, sizeof saisie, stdin);
rep = sscanf (saisie, "%[0-9-]s", temp);
number = strtol(temp, NULL, 10);
printf("%s", menu_auto_loop_2);
fflush (stdout);
fgets (saisie, sizeof saisie, stdin);
rep = sscanf (saisie, "%[0-9-]s", temp);
heure = strtol(temp, NULL, 10);
printf("%s", menu_auto_loop_3);
fflush (stdout);
fgets (saisie, sizeof saisie, stdin);
rep = sscanf (saisie, "%[0-9-]s", temp);
min = strtol(temp, NULL, 10);
printf("%s", menu_auto_loop_4);
fflush (stdout);
fgets (saisie, sizeof saisie, stdin);
rep = sscanf (saisie, "%[0-9-]s", temp);
sec = strtol(temp, NULL, 10);
for(i=0; i < number; i++){
printf("\n\n N %i - %s", i + 1 ,menu_auto_loop_6);
system("pause");
GetWindowRect(battle_of_immortal_windows, &rc);
GetCursorPos(&table_position[i]);
table_position[i].x -= rc.left;
table_position[i].y -= rc.top;
}
pthread_create(&thrd_loot, NULL, thread_loot, NULL);
}else{
thread_sec_loot = 0;
}
}
}while(resultat_selection != 11);
return 0;
}