0% found this document useful (0 votes)
44 views22 pages

Makefile For AIR Project5

This document contains a Makefile for compiling and linking source code files for an AIR project targeting the LPC2148 microcontroller. It defines variables for the project name, source files, compiler options, linker flags, and rules for compiling object files, linking the executable, and cleaning files. The Makefile is configured to produce an ELF, hex, binary, disassembly and map file from the source files.

Uploaded by

Horas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views22 pages

Makefile For AIR Project5

This document contains a Makefile for compiling and linking source code files for an AIR project targeting the LPC2148 microcontroller. It defines variables for the project name, source files, compiler options, linker flags, and rules for compiling object files, linking the executable, and cleaning files. The Makefile is configured to produce an ELF, hex, binary, disassembly and map file from the source files.

Uploaded by

Horas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

# 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);

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

/*

* a toy program for learning stack buffer

* overflow exploiting

* It reads a list of hex data from the


* specified file, and performs bubble sorting

*/

long n = 0, c = 0, d = 0, swap = 0;

FILE *fp = NULL;

void bubble_sort()

long array[10];

// loading data to array

printf("Source list:\n");

char line[sizeof(long) * 2 + 1] = {0};

while(fgets(line, sizeof(line), fp)) {

if (strlen((char *)line) > 1) {

sscanf(line, "%lx", &(array[n]));

printf("0x%lx\n", array[n]);

++n;

fclose(fp);

// do bubble sorting

for (c = 0 ; c < ( n - 1 ); c++)

for (d = 0 ; d < n - c - 1; d++)

if (array[d] > array[d+1])

{
swap = array[d];

array[d] = array[d+1];

array[d+1] = swap;

// output sorting result

printf("\nSorted list in ascending order:\n");

for ( c = 0 ; c < n ; c++ )

printf("%lx\n", array[c]);

int main(int argc, char **argv)

if(argc!=2)

printf("Usage: ./sort file_name\n");

return -1;

fp = fopen(argv[1], "rb");

bubble_sort();

return 0;

#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);

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy