Sei sulla pagina 1di 13

# Makefile for AIR project

# CPU: LPC2148

# ARH: ARM7TDMI-S

# Project name

PROJECT = air-1.0

# Compilation parameters

MCU = arm7tdmi-s

CPUARCH = armv4t

#THUMB = -mthumb

#THUMB += -mcallee-super-interworking

#THUMB_IW = -mthumb-interwork

#-fno-omit-frame-pointer

OPTLEVEL = s

DEBUG =

DEBUG_METHOD = hard

# Source files

SRC = src/main.c \

src/debug.c \

src/os/kernel/os_kernel.c \

src/os/kernel/os_fifo.c \

src/os/system.c \

src/os/sysdrv/io.c \

src/os/sysdrv/i2c.c \

src/os/sysdrv/scb.c \

src/os/sysdrv/spi.c \
src/os/sysdrv/vic.c \

src/os/usrdrv/mmc.c \

src/os/usrdrv/pcf8548.c \

src/os/usrdrv/kbd.c \

src/os/usrdrv/audio.c \

src/os/gfx/lcd_a2618.c \

src/os/gfx/fb_1bpp.c \

src/sys/mem_alloc.c \

src/sys/xlibc.c \

src/resources/bitmaps.c \

src/resources/fonts.c \

src/au.c \

src/adpcm.c \

src/audio/auprocessor.c \

src/os/fs/tff.c \

src/os/fs/diskio.c \

src/port.c \

src/cpptest.c

SRC32 =

SRCAS = src/sys/crt0.S src/os/kernel/os_kernel_asm.S

#SRC += src/usbmem/mscuser.c src/usbmem/usbcore.c src/usbmem/usbdesc.c src/usbmem/usbhw.c


src/usbmem/usbuser.c src/usbmem/diskimg.c

INCLUDES = -Iinclude

#FLAGS = -finstrument-functions

#-fstack-protector -Wstack-protector -fstack-protector-all

#-finstrument-functions

#-ffunction-sections -fdata-sections -Wl,--gc-sections


# +-----------------------------------------------+

#| Common block |

# +-----------------------------------------------+

ifeq ($(DEBUG_METHOD),hard)

CFLAGS = $(FLAGS) -mcpu=$(MCU) -mtune=$(MCU) -march=$(CPUARCH) $(DEBUG) $(THUMB_IW) \

-Wall -std=gnu99 -O$(OPTLEVEL) $(INCLUDES)

LDFLAGS = -nostartfiles -nostdlib -T lpc2148_rom.ld

else

CFLAGS = -mcpu=$(MCU) -mtune=$(MCU) -march=$(CPUARCH) -D_SOFTDEBUG_ $(DEBUG)


$(THUMB_IW) \

-Wall -std=gnu99 -O$(OPTLEVEL) $(INCLUDES)

LDFLAGS = -nostartfiles -T lpc2148_rom.ld

endif

LIBGCC = `$(CC) $(CFLAGS) $(THUMB) -print-libgcc-file-name`

LIBDIR = /opt/armgcc/arm-elf/lib/`$(CC) $(CFLAGS) -print-multi-directory`

#LIBC = $(LIBDIR)/libc.a

#LIBC += $(LIBDIR)/libnosys.a

#ARCH=arm-elf

ARCH=arm-none-eabi

CC = $(ARCH)-gcc

LD = $(ARCH)-ld

AR = $(ARCH)-ar

AS = $(ARCH)-as

OBJCOPY = $(ARCH)-objcopy

OBJDUMP = $(ARCH)-objdump

OBJSIZE = $(ARCH)-size
OBJS = $(SRC:.c=.o)

OBJS32 = $(SRC32:.c=.o)

OBJSAS = $(SRCAS:.S=.o)

OBJALL = $(OBJS) $(OBJS32) $(OBJSPP) $(OBJSAS)

ELF = $(PROJECT).elf

HEX = $(PROJECT).hex

BIN = $(PROJECT).bin

ASM = $(PROJECT).asm

MAP = $(PROJECT).map
1. using namespace std;
2. #include <conio.h> // for kbhit
3. #include <windows.h>
4. #include <string> // for strings
5. #include <fstream> // file I/O
6. #include <iostream> // for cin >> and cout <<
7. #include <iomanip> // for fancy output
8. #include "TimeUtils.h" // for GetTime, GetDate, etc.

1. using namespace std;


2. #include <conio.h> // for kbhit
3. #include <windows.h>
4. #include <string> // for strings
5. #include <fstream> // file I/O
6. #include <iostream> // for cin >> and cout <<
7. #include <iomanip> // for fancy output
8. #include "TimeUtils.h" // for GetTime, GetDate, etc.

TO_CLEAN = $(OBJALL) $(ELF) $(BIN) $(HEX) $(ASM) $(MAP)

LPCISP = lpc21isp

#LPCISP_PARAMS = -control -PHILIPSARM $(HEX) /dev/ttyUSB0 115200 12000

LPCISP_PARAMS = -control -PHILIPSARM $(HEX) /dev/ttyUSB0 38400 12000

#LPCISP = lpcflash

#LPCISP_PARAMS = -i /dev/ttyUSB0 -b 115200 -f 14746 -w 0x4000000 -l $(HEX)


# Messages

MSG_COMPILING = "CC :"

MSG_COMPILING32 = "CC32:"

MSG_COMPILINGCCPP = "C++ :"

MSG_COMPILINGAS = "AS :"

MSG_LINKING = "LD :"

MSG_CLEANING = "RM :"

MSG_SIZE = "Size:"

MSG_HEX = "Make HEX from $(ELF):"

MSG_BIN = "Make binary from $(ELF):"

MSG_BINSIZE = "Size of binary:"

MSG_DISASM = "Disassemble $(ELF):"

# Rules

#.SILENT : $(OBJALL) $(ELF) $(HEX) $(BIN) $(ASM) clean

#.SILENT : $(OBJALL) $(HEX) $(BIN) $(ASM) clean

$(ELF) : $(OBJS) $(OBJS32) $(OBJSAS)

@echo $(MSG_LINKING) $@

$(LD) -Map $(MAP) --cref $(LDFLAGS) -o $@ $(OBJALL) $(LIBGCC) $(LIBC) $(LIBS)

#$(CCPP) -Wl,-Map -Wl,$(MAP) $(LDFLAGS) -o $@ $(OBJALL) $(LIBGCC) $(LIBC) $(LIBS)

@echo $(MSG_SIZE)

$(OBJSIZE) $@

$(OBJS) : %.o : %.c

@echo $(MSG_COMPILING) $<

$(CC) -c $(CFLAGS) $(THUMB) -o $@ $<

$(OBJS32) : %.o : %.c


@echo $(MSG_COMPILING32) $<

$(CC) -c $(CFLAGS) -o $@ $<

$(OBJSAS) : %.o : %.S

@echo $(MSG_COMPILINGAS) $<

$(CC) -c $(CFLAGS) -D__ASM__ -o $@ $<

$(HEX) : $(ELF)

@echo $(MSG_HEX) $(HEX)

$(OBJCOPY) -O ihex $(ELF) $(HEX)

$(BIN) : $(ELF)

@echo $(MSG_BIN) $(BIN)

$(OBJCOPY) -O binary $(ELF) $(BIN)

@echo $(MSG_BINSIZE) `wc -c $(BIN)`

$(ASM) : $(ELF)

@echo $(MSG_DISASM) $(ASM)

$(OBJDUMP) -d $(ELF) > $(ASM)

all : $(ELF) hex

hex : $(HEX)

bin : $(BIN)

disasm: $(ASM)

flash: $(HEX)

$(LPCISP) $(LPCISP_PARAMS)

clean :
@echo $(MSG_CLEANING) $(TO_CLEAN)

rm -f $(OBJALL) $(TO_CLEAN)

#pragma comment(lib, "BlackBone.lib")

#include <iostream>

#include "Types.hpp"

#include "Threading.cpp"

#include "FOV.cpp"

#include "Hack.cpp"

using namespace std;

Hack hack;

vector<HANDLE> threads;

void WaitForGameThenStart();

void PrintDebugInfo()

cout << "Debug information: " << endl;

cout << "hack.ClientDll: 0x" << hex << hack.ClientDll << endl;

cout << "hack.LocalPlayerPointer: 0x" << hex << hack.LocalPlayerPointer << endl;

cout << "hack.LocalPlayer(): 0x" << hex << hack.LocalPlayer() << endl;

cout << "hGameWindow: " << hack.hGameWindow << endl;

cout << "GetForegroundWindow(): " << GetForegroundWindow() << endl;

dw BunnyhopThread(void*)

while (true)
{

if (GetAsyncKeyState(Key::BhopJump) && hack.IsGameWindowActive() &&


hack.LocalPlayer())

if (hack.IsPlayerOnGround())

hack.Jump();

dw RapidFireThread(void*)

while (true)

if (GetAsyncKeyState(Key::RapidFire) && hack.IsGameWindowActive() &&


hack.LocalPlayer())

hack.Attack();

Sleep(16);

dw ESPThread(void*)

while (true)

{
if (GetAsyncKeyState(Key::RapidFire) && hack.IsGameWindowActive() &&
hack.LocalPlayer() && (hack.GlowEspEnable || hack.RadarEspEnable))

hack.IterateAndGlowOrSpot(Color24(0, 255, 0, 255), Color24(255, 0, 0, 255));

dw GameStateControlThread(void*)

while (true)

if (hack.IsGameRunning())

Sleep(1000);

else

printf("CS:GO has exited.\n");

StopThreads(threads);

threads.clear();

break;

dw MiscellanousThread(void* pFOV)

FOV* fov = (FOV*)pFOV;


while (true)

if (GetAsyncKeyState(Key::DebugPrint))

PrintDebugInfo();

Sleep(200);

if (hack.IsGameWindowActive())

if (hack.LocalPlayer())

if (GetAsyncKeyState(Key::FovIncrement))

*fov++;

Sleep(200);

if (GetAsyncKeyState(Key::FovDecrement))

*fov--;

Sleep(200);

if (GetAsyncKeyState(Key::FovReset))

fov->Reset();

Sleep(200);

if (GetAsyncKeyState(Key::GlowEspToggle))

{
hack.GlowEspEnable = !hack.GlowEspEnable;

cout << "GlowESP is now " << (hack.GlowEspEnable ? "enabled" :


"disabled") << endl;

Sleep(200);

if (GetAsyncKeyState(Key::GlowEspBloomToggle))

hack.GlowEspBloomEnable = !hack.GlowEspBloomEnable;

cout << "GlowESP Bloom effect is now " << (hack.GlowEspBloomEnable


? "enabled" : "disabled") << endl;

Sleep(200);

if (GetAsyncKeyState(Key::RadarEspEnable))

hack.RadarEspEnable = !hack.RadarEspEnable;

cout << "RadarESP is now " << (hack.RadarEspEnable ? "enabled" :


"disabled") << endl;

Sleep(200);

hack.SetFlashMaxAlpha(0.0f);

void RunHackThreads()

hack.InitializeOffsets();

printf("\n");

PrintDebugInfo();

FOV fov(10, &hack);


printf("\nReady. NumLock MUST be turned ON to activate hack features.\n");

auto miscThread = StartThread(MiscellanousThread, &fov);

threads = StartThreads({ BunnyhopThread, RapidFireThread, ESPThread});

threads.push_back(miscThread);

HANDLE gscThread = StartThread(GameStateControlThread);

WaitForSingleObject(gscThread, INFINITE);

CloseHandle(gscThread);

WaitForGameThenStart();

void WaitForGame()

while(true)

bool state = hack.IsGameRunning();

if (!state)

Sleep(500);

else

printf("CS:GO has started.. Loading hack..\n");

Sleep(7000);

break;

}
void WaitForGameThenStart()

printf("Waiting for CS:GO to start..\n");

WaitForGame();

RunHackThreads();

int main()

if (hack.DriversLoaded())

printf("Driver check succeded.\n");

WaitForGameThenStart();

else

printf("Driver check failed. Check if drivers are loaded.");

Sleep(5000);

exit(-1);

Potrebbero piacerti anche