Skip to content

Commit

Permalink
Added Ghost 1.16
Browse files Browse the repository at this point in the history
  • Loading branch information
yeeterlol committed Sep 15, 2021
1 parent 1cd2847 commit a142785
Show file tree
Hide file tree
Showing 1,758 changed files with 135,906 additions and 1 deletion.
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions Ghost 1.16/Ghost Client.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29123.88
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Horion", "Horion.vcxproj", "{499784D2-7EA3-4CBE-BD93-EC0DBBC42FCD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
BetaConf|x64 = BetaConf|x64
BetaConf|x86 = BetaConf|x86
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{499784D2-7EA3-4CBE-BD93-EC0DBBC42FCD}.BetaConf|x64.ActiveCfg = BetaConf|x64
{499784D2-7EA3-4CBE-BD93-EC0DBBC42FCD}.BetaConf|x64.Build.0 = BetaConf|x64
{499784D2-7EA3-4CBE-BD93-EC0DBBC42FCD}.BetaConf|x86.ActiveCfg = BetaConf|Win32
{499784D2-7EA3-4CBE-BD93-EC0DBBC42FCD}.BetaConf|x86.Build.0 = BetaConf|Win32
{499784D2-7EA3-4CBE-BD93-EC0DBBC42FCD}.Debug|x64.ActiveCfg = Debug|x64
{499784D2-7EA3-4CBE-BD93-EC0DBBC42FCD}.Debug|x64.Build.0 = Debug|x64
{499784D2-7EA3-4CBE-BD93-EC0DBBC42FCD}.Debug|x86.ActiveCfg = Debug|Win32
{499784D2-7EA3-4CBE-BD93-EC0DBBC42FCD}.Debug|x86.Build.0 = Debug|Win32
{499784D2-7EA3-4CBE-BD93-EC0DBBC42FCD}.Release|x64.ActiveCfg = Release|x64
{499784D2-7EA3-4CBE-BD93-EC0DBBC42FCD}.Release|x64.Build.0 = Release|x64
{499784D2-7EA3-4CBE-BD93-EC0DBBC42FCD}.Release|x86.ActiveCfg = Release|Win32
{499784D2-7EA3-4CBE-BD93-EC0DBBC42FCD}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {704429D9-0B78-4294-8BFD-0DD00BDF9CE0}
EndGlobalSection
EndGlobal
File renamed without changes.
635 changes: 635 additions & 0 deletions Ghost 1.16/Horion.vcxproj

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions Ghost 1.16/Horion/Command/CommandMgr.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#include "CommandMgr.h"

CommandMgr::CommandMgr(GameData* gm) {
this->gameData = gm;
}

CommandMgr::~CommandMgr() {
for (int i = 0; i < commandList.size(); i++) {
delete commandList[i];
commandList[i] = nullptr;
}
}

void CommandMgr::initCommands() {
logF("Initializing commands");

commandList.push_back(new EjectCommand());
commandList.push_back(new TeleportCommand());
commandList.push_back(new BindCommand());
commandList.push_back(new RelativeTeleportCommand());
commandList.push_back(new ToggleCommand());
commandList.push_back(new PlayerTeleportCommand());
commandList.push_back(new GameModeCommand());
commandList.push_back(new FriendListCommand());
commandList.push_back(new UnbindCommand());
commandList.push_back(new EnchantCommand());
commandList.push_back(new HelpCommand());
commandList.push_back(new ModulesCommand());
commandList.push_back(new PanicCommand());
commandList.push_back(new HideCommand());
commandList.push_back(new GiveCommand());
commandList.push_back(new BruhCommand());
commandList.push_back(new ServerCommand());
commandList.push_back(new setoffhandCommand());
commandList.push_back(new CoordsCommand());
commandList.push_back(new SayCommand());
commandList.push_back(new SpammerCommand());
commandList.push_back(new DupeCommand());
commandList.push_back(new ConfigCommand());
commandList.push_back(new SetprefixCommand());
commandList.push_back(new NbtCommand());
commandList.push_back(new TopCommand());

commandList.push_back(new CommandBlockExploitCommand());
commandList.push_back(new NameSpoofCommand());
commandList.push_back(new ExecuteCommand());
commandList.push_back(new ScriptCommand());

#ifdef _DEBUG
commandList.push_back(new TestCommand());
#endif
}

void CommandMgr::disable() {
}

std::vector<IMCCommand*>* CommandMgr::getCommandList() {
return &commandList;
}

void CommandMgr::execute(char* message) {
if (message != nullptr) {
std::vector<std::string> args;
std::string msgStr = message + 1;
size_t pos = msgStr.find(" "), initialPos = 0;
while (pos != std::string::npos) {
args.push_back(msgStr.substr(initialPos, pos - initialPos));
initialPos = pos + 1;

pos = msgStr.find(" ", initialPos);
}
args.push_back(msgStr.substr(initialPos, std::min(pos, msgStr.size()) - initialPos + 1));

std::string cmd = args[0];
std::transform(cmd.begin(), cmd.end(), cmd.begin(), ::tolower);

for (auto it = this->commandList.begin(); it != this->commandList.end(); ++it) {
IMCCommand* c = *it;
auto* aliases = c->getAliasList();
for (auto it = aliases->begin(); it != aliases->end(); ++it) {
if (*it == cmd) {
try {
if (!c->execute(&args))
g_Data.getClientInstance()->getGuiData()->displayClientMessageF("%s%sUsage: %s%c%s %s", RED, BOLD, RESET, cmdMgr->prefix, c->getCommand(), c->getUsage(cmd.c_str()));
} catch (...) {
g_Data.getClientInstance()->getGuiData()->displayClientMessageF("%s%sUsage: %s%c%s %s", RED, BOLD, RESET, cmdMgr->prefix, c->getCommand(), c->getUsage(cmd.c_str()));
}
return;
}
}
}

g_Data.getClientInstance()->getGuiData()->displayClientMessageF("[%sGhost Client%s] %sCommand '%s' could not be found!", GOLD, WHITE, RED, cmd.c_str());
}
}

CommandMgr* cmdMgr = new CommandMgr(&g_Data);
63 changes: 63 additions & 0 deletions Ghost 1.16/Horion/Command/CommandMgr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#pragma once

#include "../../Memory/GameData.h"
#include "Commands/BindCommand.h"
#include "Commands/BruhCommand.h"
#include "Commands/CoordsCommand.h"
#include "Commands/DupeCommand.h"
#include "Commands/EjectCommand.h"
#include "Commands/EnchantCommand.h"
#include "Commands/FriendListCommand.h"
#include "Commands/GameModeCommand.h"
#include "Commands/GiveCommand.h"
#include "Commands/HelpCommand.h"
#include "Commands/HideCommand.h"
#include "Commands/ICommand.h"
#include "Commands/ModulesCommand.h"
#include "Commands/PanicCommand.h"
#include "Commands/PlayerTeleportCommand.h"
#include "Commands/RelativeTeleportCommand.h"
#include "Commands/SayCommand.h"
#include "Commands/ServerCommand.h"
#include "Commands/SpammerCommand.h"
#include "Commands/TeleportCommand.h"
#include "Commands/ToggleCommand.h"
#include "Commands/TopCommand.h"
#include "Commands/UnbindCommand.h"
#include "Commands/setoffhandCommand.h"
#include "Commands/CommandBlockExploitCommand.h"
#include "Commands/ConfigCommand.h"
#include "Commands/NameSpoofCommand.h"
#include "Commands/SetprefixCommand.h"
#include "Commands/NbtCommand.h"
#include "Commands/ExecuteCommand.h"

#include "Commands/ScriptCommand.h"

#ifdef _DEBUG
#include "Commands/TestCommand.h"
#endif

#include <algorithm>
#include <string>
#include <vector>

class CommandMgr {
private:
GameData* gameData;
std::vector<IMCCommand*> commandList;

public:
CommandMgr(GameData* gm);
~CommandMgr();

char prefix = '.';

void initCommands();
void disable();
std::vector<IMCCommand*>* getCommandList();

void execute(char* message);
};

extern CommandMgr* cmdMgr;
14 changes: 14 additions & 0 deletions Ghost 1.16/Horion/Command/Commands/BruhCommand.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include "BruhCommand.h"

BruhCommand::BruhCommand() : IMCCommand("bruh", "bruh moment", "bruh") {
}

BruhCommand::~BruhCommand() {
}

bool BruhCommand::execute(std::vector<std::string>* args) {
assertTrue(g_Data.getLocalPlayer() != nullptr);

clientMessageF("bruh moment");
return true;
}
10 changes: 10 additions & 0 deletions Ghost 1.16/Horion/Command/Commands/BruhCommand.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#pragma once
#include "ICommand.h"
class BruhCommand : public IMCCommand {
public:
BruhCommand();
~BruhCommand();

// Inherited via IMCCommand
virtual bool execute(std::vector<std::string>* args) override;
};
32 changes: 32 additions & 0 deletions Ghost 1.16/Horion/Command/Commands/CommandBlockExploitCommand.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include "CommandBlockExploitCommand.h"

#include "../../../SDK/Tag.h"
#include "../../Module/ModuleManager.h"
#include <thread>

CommandBlockExploitCommand::CommandBlockExploitCommand() : IMCCommand("commandblockexploit", "Workaround for executing commands without op", "<command>") {
registerAlias("cbe");
}

CommandBlockExploitCommand::~CommandBlockExploitCommand() {
}

bool CommandBlockExploitCommand::execute(std::vector<std::string>* args) {
assertTrue(args->size() > 2);
std::ostringstream os;
for (int i = 1; i < args->size(); i++) {
if (i > 1)
os << " ";
os << args->at(i);
}
C_ItemStack* yot = new C_ItemStack(***ItemRegistry::lookUpByName(std::make_unique<uintptr_t>().get(), std::make_unique<uintptr_t>().get(), TextHolder("beehive")), 1, 0);
int slot = g_Data.getLocalPlayer()->getSupplies()->inventory->getFirstEmptySlot();
std::string cmd = os.str();
std::string tag = "{Occupants:[{ActorIdentifier:""\"minecraft:command_block_minecart<>""\",SaveData:{Command:\"" + cmd + "\",Ticking:1b,TicksLeftToStay:1}}]}";
yot->setUserData(std::move(Mojangson::parseTag(tag)));
g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(0, yot, nullptr, 507, 99999));
g_Data.getLocalPlayer()->getTransactionManager()->addInventoryAction(C_InventoryAction(slot, nullptr, yot));
g_Data.getLocalPlayer()->getSupplies()->inventory->addItemToFirstEmptySlot(yot);
clientMessageF("[%sHorion%s] %sPlace the beehive to spawn a command block minecart with a command already inside!", GOLD, WHITE, GREEN);
return true;
}
11 changes: 11 additions & 0 deletions Ghost 1.16/Horion/Command/Commands/CommandBlockExploitCommand.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#pragma once
#include "ICommand.h"

class CommandBlockExploitCommand : public IMCCommand {
public:
CommandBlockExploitCommand();
~CommandBlockExploitCommand();

// Inherited via IMCCommand
virtual bool execute(std::vector<std::string>* args) override;
};
24 changes: 24 additions & 0 deletions Ghost 1.16/Horion/Command/Commands/ConfigCommand.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include "ConfigCommand.h"

ConfigCommand::ConfigCommand() : IMCCommand("config", "Load/save configs", "<load/new/save> <name>") {
}

ConfigCommand::~ConfigCommand() {
}

bool ConfigCommand::execute(std::vector<std::string>* args) {
if (args->at(1) == "load") {
std::string name = args->at(2);
configMgr->loadConfig(name, false);
return true;
} else if (args->at(1) == "new") {
std::string name = args->at(2);
configMgr->loadConfig(name, true);
return true;
} else if (args->at(1) == "save") {
configMgr->saveConfig();
clientMessageF("[%sGhost Client%s] %sSuccessfully saved config %s%s%s!", GOLD, WHITE, GREEN, GRAY, configMgr->currentConfig.c_str(), GREEN);
return true;
}
return false;
}
15 changes: 15 additions & 0 deletions Ghost 1.16/Horion/Command/Commands/CoordsCommand.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "CoordsCommand.h"

CoordsCommand::CoordsCommand() : IMCCommand("coords", "Prints your coordinates", "") {
registerAlias("pos");
}

CoordsCommand::~CoordsCommand() {
}

bool CoordsCommand::execute(std::vector<std::string>* args) {
vec3_t* pos = g_Data.getLocalPlayer()->getPos();
float yPos = pos->y - 1.62f;
clientMessageF("[%sGhost Client%s] %sX: %.2f Y: %.2f Z: %.2f", GOLD, WHITE, GREEN, pos->x, yPos /* eye height */, pos->z);
return true;
}
29 changes: 29 additions & 0 deletions Ghost 1.16/Horion/Command/Commands/DamageCommand.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "DamageCommand.h"

#include "../../Module/ModuleManager.h"

DamageCommand::DamageCommand() : IMCCommand("damage", "Damage yourself (relies on falldamage)", "<amount>") {
registerAlias("dmg");
}

DamageCommand::~DamageCommand() {
}

bool DamageCommand::execute(std::vector<std::string>* args) {
assertTrue(g_Data.getLocalPlayer() != nullptr);
float amount = assertFloat(args->at(1));
if (amount < 1.f) {
clientMessageF("%sPlease put a number bigger than 0", RED);
return true;
}
auto noFallMod = moduleMgr->getModule<NoFall>();

if (noFallMod->isEnabled()) {
noFallMod->setEnabled(false);
g_Data.getLocalPlayer()->causeFallDamage(amount + 3.f);
noFallMod->setEnabled(true);
} else {
g_Data.getLocalPlayer()->causeFallDamage(amount + 3.f);
}
return true;
}
Loading

0 comments on commit a142785

Please sign in to comment.