kind of gave up on my blog seeing how i would need to make a youtube video to describe half the shit im doing and i simply do not have the bandwidth to upload it at the moment.
instead ill just post some code to learn by well not really learn more like look at. this is some pretty basic stuff and anything advanced was already talked about in my blog.
this just shows that once you have access to a struct youre after how easy it is to make these things. im in the process of currently tracking down nearby players and finding their stats/buffs so that i can make my app suggest skills to use.
Code
#include "main.h"
bool AutoPot = false;
bool PvPAid = false;
typedef struct {
BYTE Unknown01[0x488]; //Unknown stuff
DWORD Id;
DWORD Level;
DWORD Cultivation; //create defines for cultivations 0-22
DWORD Current_HP;
DWORD Current_MP;
DWORD Exp;
DWORD Spirit;
DWORD Attribute_Points;
DWORD Current_Chi;
DWORD Attack_Level;
DWORD Defence_Level;
DWORD Critical_Rate;
DWORD Rage_Damage; //200% + Rage_Damage
DWORD Stealth_Level;
DWORD Stealth_Detection_Level;
DWORD Slaying_Level;
DWORD Warding_level;
DWORD Vitality_Points;
DWORD Magic_Points;
DWORD Strength_Points;
DWORD Dextarity_Points;
DWORD Max_HP;
DWORD Max_MP;
DWORD HP_Regen;
DWORD MP_Regen;
float Walk_Speed;
float Run_Speed;
float Swim_Speed;
float Fly_Speed;
DWORD Accuracy;
DWORD Min_Attack_Damage;
DWORD Max_Attack_Damage;
DWORD Attack_Rate; // 20/value
float Range;
DWORD Min_Metal_Damage;
DWORD Max_Metal_Damage;
DWORD Min_Wood_Damage;
DWORD Max_Wood_Damage;
DWORD Min_Water_Damage;
DWORD Max_Water_Damage;
DWORD Min_Fire_Damage;
DWORD Max_Fire_Damage;
DWORD Min_Earth_Damage;
DWORD Max_Earth_Damage;
DWORD Min_Magic_Damage;
DWORD Max_Magic_Damage;
DWORD Metal_Defence;
DWORD Wood_Defence;
DWORD Water_Defence;
DWORD Fire_Defence;
DWORD Earth_Defence;
DWORD Physical_Defence;
DWORD Evasion;
DWORD Max_Chi;
DWORD Coins;
DWORD Max_Coins;
} PLAYER;
DWORD *ReadPointer(void* base, unsigned int level, ...) {
unsigned long *output = (unsigned long*)base;
va_list offsets;
va_start(offsets, level);
for (unsigned int i = 0; i <= level; i++) {
output = ((unsigned long*)(*output + va_arg(offsets, unsigned int)));
}
va_end(offsets);
return (DWORD*)output;
}
void MenuPrompt() {
char input[10] = {0};
printf("Welcome to lol stuff\n");
printf("Please select one or more of the options\n");
printf("To stop selecting options and enable all selected enter -\n\n");
printf("[ ] 1. Auto potter\n");
printf("[ ] 2. PvP Buff Analyser Aid\n");
while(1) {
printf("Input your choice: ");
fgets(input, 9, stdin);
system("cls");
if(strncmp(input, "1", 1) == 0 && AutoPot == true) {
printf("[ ] 1. Auto potter\n");
AutoPot = false;
} else if(strncmp(input, "1", 1) == 0 || AutoPot == true) {
printf("[x] 1. Auto potter\n");
AutoPot = true;
} else {
printf("[ ] 1. Auto potter\n");
}
if(strncmp(input, "2", 1) == 0 && PvPAid == true) {
printf("[ ] 2. PvP Buff Analyser Aid\n");
PvPAid = false;
} else if(strncmp(input, "2", 1) == 0 || PvPAid == true) {
printf("[x] 2. PvP Buff Analyser Aid\n");
PvPAid = true;
} else {
printf("[ ] 2. PvP Buff Analyser Aid\n");
}
if(strncmp(input, "-", 1) == 0) {
break;
}
}
}
DWORD WINAPI Main() {
//(void*)ReadPointer((void*)0x00BBC9CC, 1, 0x34);
//REALBASEADDRESS = 0x00BBC26C
//BASEADDRESS = 0x00BBC9CC
if(AllocConsole()) {
freopen("CONOUT$", "w", stdout);
freopen("CONIN$", "r", stdin);
MenuPrompt();
if(AutoPot) {
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)AutoPotMain, 0, 0, 0);
}
//if(PvPAid) {
// CreateThread(0, 0, (LPTHREAD_START_ROUTINE)PvPAidMain, 0, 0, 0);
//}
Sleep(10000);
}
return NULL;
}
DWORD WINAPI AutoPotMain() {
float CurrentHP = 0, MinimumHP = 0;
HWND hWindow;
PLAYER *Player_Stats = (PLAYER*)ReadPointer((void*)0x00BBC9CC, 1, 0x34);
MinimumHP = (float)Player_Stats->Max_HP;
MinimumHP *= 0.75;
if((hWindow = FindWindow(NULL, TEXT("REDACTED"))) != NULL) {
while(1) {
CurrentHP = (float)Player_Stats->Current_HP;
if(CurrentHP <= MinimumHP) {
PostMessage(hWindow, WM_KEYDOWN, VK_F2, NULL);
Sleep(75);
PostMessage(hWindow, WM_KEYUP, VK_F2, NULL);
}
Sleep(5000);
}
}
return NULL;
}
DLL_EXPORT BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hinstDLL);
MessageBox(0, "Creating thread", "Successful Injection!", 0);
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)Main, 0, 0, 0);
break;
}
return TRUE;
}
Code
#ifndef __MAIN_H__
#define __MAIN_H__
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* To use this exported function of dll, include this header
* in your project.
*/
#ifdef BUILD_DLL
#define DLL_EXPORT __declspec(dllexport)
#else
#define DLL_EXPORT __declspec(dllimport)
#endif
#ifdef __cplusplus
extern "C"{
#endif
DLL_EXPORT BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
DWORD *ReadPointer(void* base, unsigned int level, ...);
DWORD WINAPI Main();
void MenuPrompt();
DWORD WINAPI AutoPotMain();
#ifdef __cplusplus
}
#endif
#endif // __MAIN_H__
This post was edited by AbDuCt on Apr 21 2013 11:25pm