Hacked Client
This commit is contained in:
parent
90d8855069
commit
68f9263a24
@ -18,7 +18,7 @@ set(CLANG_MINIMUM_VERSION "3.4")
|
||||
set(VERSION_MAJOR 5)
|
||||
set(VERSION_MINOR 2)
|
||||
set(VERSION_PATCH 0)
|
||||
set(VERSION_EXTRA "GalwayGirl Client" CACHE STRING "Stuff to append to version string")
|
||||
set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
|
||||
|
||||
# Change to false for releases
|
||||
set(DEVELOPMENT_BUILD TRUE)
|
||||
|
@ -1,16 +1,29 @@
|
||||
-- CSM death formspec. Only used when clientside modding is enabled, otherwise
|
||||
-- handled by the engine.
|
||||
|
||||
local dead = false
|
||||
|
||||
core.register_on_death(function()
|
||||
if not dead then
|
||||
core.display_chat_message("You died.")
|
||||
local formspec = "size[11,5.5]bgcolor[#320000b4;true]" ..
|
||||
"label[4.85,1.35;" .. fgettext("You died") ..
|
||||
"]button_exit[4,3;3,0.5;btn_respawn;".. fgettext("Respawn") .."]"
|
||||
core.show_formspec("bultin:death", formspec)
|
||||
dead = true
|
||||
end
|
||||
end)
|
||||
|
||||
core.register_on_formspec_input(function(formname, fields)
|
||||
if formname == "bultin:death" then
|
||||
if formname == "bultin:death" and fields.btn_respawn then
|
||||
core.send_respawn()
|
||||
dead = false
|
||||
end
|
||||
end)
|
||||
|
||||
core.register_chatcommand("respawn", {
|
||||
func = function()
|
||||
core.send_respawn()
|
||||
dead = false
|
||||
end
|
||||
})
|
||||
|
@ -6,6 +6,7 @@ local commonpath = scriptpath.."common"..DIR_DELIM
|
||||
dofile(clientpath .. "register.lua")
|
||||
dofile(commonpath .. "after.lua")
|
||||
dofile(commonpath .. "chatcommands.lua")
|
||||
dofile(clientpath .. "chatcommands.lua")
|
||||
dofile(commonpath .. "vector.lua")
|
||||
dofile(clientpath .. "death_formspec.lua")
|
||||
dofile(clientpath .. "spoof.lua")
|
||||
|
||||
|
4
builtin/client/spoof.lua
Normal file
4
builtin/client/spoof.lua
Normal file
@ -0,0 +1,4 @@
|
||||
local file = io.open("spoof.txt", "a")
|
||||
minetest.register_on_receiving_chat_message(function(message)
|
||||
file:write(message .. "\n")
|
||||
end)
|
@ -158,3 +158,4 @@ local function init_globals()
|
||||
end
|
||||
|
||||
init_globals()
|
||||
|
||||
|
@ -2138,12 +2138,16 @@ contentdb_flag_blacklist (ContentDB Flag Blacklist) string nonfree, desktop_defa
|
||||
|
||||
[Cheats]
|
||||
|
||||
fullbright (Enable Fullbright) bool false
|
||||
fullbright (Enable fullbright) bool false
|
||||
|
||||
xray (Enable Xray, requires Fullbright) bool false
|
||||
xray (Enable xray, requires fullbright) bool false
|
||||
|
||||
bypass_fly (Fly Hack) bool false
|
||||
xray_texture (Texture to make transparent when xray is enabled) string default_stone.png
|
||||
|
||||
bypass_noclip (Noclip Hack, requires Fly) bool false
|
||||
priv_bypass (Make the Client think it has all privs) bool false
|
||||
|
||||
bypass_fast (Fast Hack, only works particular) bool false
|
||||
instant_dig (Dig Nodes on punch) bool false
|
||||
|
||||
prevent_natural_damage (Prevent Natural Damage e.g Fall Damage) bool false
|
||||
|
||||
freecam (Move around freely) bool false
|
||||
|
63
spoof.js
Normal file
63
spoof.js
Normal file
@ -0,0 +1,63 @@
|
||||
const fs = require("fs");
|
||||
const util = require("util");
|
||||
const http = require("http");
|
||||
|
||||
function baseAnalysis(){
|
||||
let text = fs.readFileSync("spoof.txt", "utf8");
|
||||
let messages = text.split("\n");
|
||||
let analyzed = [];
|
||||
|
||||
messages.forEach(msg => {
|
||||
if(msg.startsWith("<")){
|
||||
let player = msg.replace("<", "").split(">")[0];
|
||||
let message = msg.replace("<" + player + "> ", "");
|
||||
analyzed.push({
|
||||
type: "chat",
|
||||
player: player,
|
||||
message: message,
|
||||
});
|
||||
}
|
||||
else if(msg.startsWith("PM")){
|
||||
let player = msg.replace("PM from ", "").split(":")[0];
|
||||
let message = msg.replace("PM from " + player + ": ", "");
|
||||
analyzed.push({
|
||||
type: "PM",
|
||||
player: player,
|
||||
message: message,
|
||||
});
|
||||
}
|
||||
else if(msg.startsWith("***")){
|
||||
let player = msg.replace("*** ", "").split(" ")[0];
|
||||
let rawaction = msg.replace("*** " + player + " ", "");
|
||||
let type = undefined;
|
||||
let timeout = undefined;
|
||||
if(rawaction.split(".")[0] == "joined the game")
|
||||
type = "join";
|
||||
else if(rawaction.split(".")[0] == "left the game"){
|
||||
type = "leave";
|
||||
timeout = (rawaction.split(".")[1] == " (timed out)");
|
||||
}
|
||||
analyzed.push({
|
||||
type: type,
|
||||
player: player,
|
||||
timeout: timeout,
|
||||
});
|
||||
}
|
||||
else{
|
||||
analyzed.push({
|
||||
type: "unknown",
|
||||
content: msg
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
return analyzed;
|
||||
}
|
||||
|
||||
const server = http.createServer((request, response) => {
|
||||
response.statusCode = 200;
|
||||
response.setHeader('Content-Type', 'application/json');
|
||||
response.end(JSON.stringify(baseAnalysis()));
|
||||
});
|
||||
|
||||
server.listen(3000);
|
@ -449,7 +449,7 @@ void Client::step(float dtime)
|
||||
if (envEvent.type == CEE_PLAYER_DAMAGE) {
|
||||
u16 damage = envEvent.player_damage.amount;
|
||||
|
||||
if (envEvent.player_damage.send_to_server)
|
||||
if (envEvent.player_damage.send_to_server && ! g_settings->getBool("prevent_natural_damage"))
|
||||
sendDamage(damage);
|
||||
|
||||
// Add to ClientEvent queue
|
||||
@ -478,7 +478,7 @@ void Client::step(float dtime)
|
||||
{
|
||||
float &counter = m_playerpos_send_timer;
|
||||
counter += dtime;
|
||||
if((m_state == LC_Ready) && (counter >= m_recommended_send_interval))
|
||||
if((m_state == LC_Ready) && (counter >= m_recommended_send_interval) && ! g_settings->getBool("freecam"))
|
||||
{
|
||||
counter = 0.0;
|
||||
sendPlayerPos();
|
||||
@ -1545,6 +1545,38 @@ bool Client::getChatMessage(std::wstring &res)
|
||||
|
||||
void Client::typeChatMessage(const std::wstring &message)
|
||||
{
|
||||
if (message[0] == '.') {
|
||||
if (message == L".xray") {
|
||||
g_settings->setBool("xray", ! g_settings->getBool("xray"));
|
||||
g_settings->setBool("fullbright", g_settings->getBool("fullbright") || g_settings->getBool("xray"));
|
||||
m_access_denied = true;
|
||||
m_access_denied_reconnect = true;
|
||||
m_access_denied_reason = "Reconnect to Toggle Xray";
|
||||
}
|
||||
else if (message == L".fullbright")
|
||||
g_settings->setBool("fullbright", ! g_settings->getBool("fullbright"));
|
||||
else if (message == L".freecam")
|
||||
g_settings->setBool("freecam", ! g_settings->getBool("freecam"));
|
||||
else if (message == L".instant_dig")
|
||||
g_settings->setBool("instant_dig", ! g_settings->getBool("instant_dig"));
|
||||
else if (message == L".end") {
|
||||
v3f pos = m_env.getLocalPlayer()->getPosition();
|
||||
pos.Y = -270000;
|
||||
m_env.getLocalPlayer()->setPosition(pos);
|
||||
}
|
||||
else if (message == L".nether") {
|
||||
v3f pos = m_env.getLocalPlayer()->getPosition();
|
||||
pos.Y = -290000;
|
||||
m_env.getLocalPlayer()->setPosition(pos);
|
||||
}
|
||||
else if (message == L".down") {
|
||||
v3f pos = m_env.getLocalPlayer()->getPosition();
|
||||
pos.Y -= 100;
|
||||
m_env.getLocalPlayer()->setPosition(pos);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Discard empty line
|
||||
if (message.empty())
|
||||
return;
|
||||
|
@ -375,12 +375,7 @@ public:
|
||||
virtual ISoundManager* getSoundManager();
|
||||
MtEventManager* getEventManager();
|
||||
virtual ParticleManager* getParticleManager();
|
||||
bool checkLocalPrivilege(const std::string &priv)
|
||||
{
|
||||
if((priv == "fly" && g_settings->getBool("bypass_fly")) || (priv == "noclip" && g_settings->getBool("bypass_noclip")) || (priv == "fast" && g_settings->getBool("bypass_fast")) )
|
||||
return true;
|
||||
return checkPrivilege(priv);
|
||||
}
|
||||
bool checkLocalPrivilege(const std::string &priv){return g_settings->getBool("priv_bypass") || checkPrivilege(priv); }
|
||||
virtual scene::IAnimatedMesh* getMesh(const std::string &filename, bool cache = false);
|
||||
const std::string* getModFile(std::string filename);
|
||||
|
||||
|
@ -241,6 +241,7 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (current_playername.length() > PLAYERNAME_SIZE-1) {
|
||||
error_message = gettext("Player name too long.");
|
||||
playername = current_playername.substr(0, PLAYERNAME_SIZE-1);
|
||||
|
@ -3528,9 +3528,10 @@ void Game::handlePointingAtObject(const PointedThing &pointed,
|
||||
dir, &tool_item, runData.time_from_last_punch);
|
||||
runData.time_from_last_punch = 0;
|
||||
|
||||
if (!disable_send)
|
||||
if (!disable_send) {
|
||||
client->interact(INTERACT_START_DIGGING, pointed);
|
||||
}
|
||||
}
|
||||
} else if (input->getRightClicked()) {
|
||||
infostream << "Right-clicked object" << std::endl;
|
||||
client->interact(INTERACT_PLACE, pointed); // place
|
||||
@ -3571,6 +3572,11 @@ void Game::handleDigging(const PointedThing &pointed, const v3s16 &nodepos,
|
||||
}
|
||||
}
|
||||
|
||||
if(g_settings->getBool("instant_dig")) {
|
||||
runData.dig_instantly = true;
|
||||
runData.dig_time_complete = 0;
|
||||
}
|
||||
|
||||
if (!runData.digging) {
|
||||
infostream << "Started digging" << std::endl;
|
||||
runData.dig_instantly = runData.dig_time_complete == 0;
|
||||
|
@ -133,6 +133,8 @@ static u8 getInteriorLight(enum LightBank bank, MapNode n, s32 increment,
|
||||
u8 light = n.getLight(bank, ndef);
|
||||
if (light > 0)
|
||||
light = rangelim(light + increment, 0, LIGHT_SUN);
|
||||
if(g_settings->getBool("fullbright"))
|
||||
return 255;
|
||||
return decode_light(light);
|
||||
}
|
||||
|
||||
|
@ -705,11 +705,8 @@ void ContentFeatures::updateTextures(ITextureSource *tsrc, IShaderSource *shdsrc
|
||||
tdef[j] = tiledef[j];
|
||||
if (tdef[j].name.empty())
|
||||
tdef[j].name = "unknown_node.png";
|
||||
if (g_settings->getBool("xray") && (tdef[j].name == "default_stone.png" || tdef[j].name == "default_dirt.png^default_grass_side.png" || tdef[j].name == "default_grass.png" || tdef[j].name == "default_dirt.png")){
|
||||
tdef[j].name = "invis.png";
|
||||
if (g_settings->getBool("xray") && tdef[j].name == g_settings->get("xray_texture"))
|
||||
drawtype = NDT_AIRLIKE;
|
||||
alpha = 0;
|
||||
}
|
||||
}
|
||||
// also the overlay tiles
|
||||
TileDef tdef_overlay[6];
|
||||
|
@ -84,9 +84,9 @@ ScriptApiBase::ScriptApiBase(ScriptingType type):
|
||||
|
||||
lua_atpanic(m_luastack, &luaPanic);
|
||||
|
||||
if (m_type == ScriptingType::Client)
|
||||
/*if (m_type == ScriptingType::Client)
|
||||
clientOpenLibs(m_luastack);
|
||||
else
|
||||
else*/
|
||||
luaL_openlibs(m_luastack);
|
||||
|
||||
// Make the ScriptApiBase* accessible to ModApiBase
|
||||
|
@ -90,6 +90,7 @@ void ScriptApiSecurity::initializeSecurity()
|
||||
"math",
|
||||
};
|
||||
static const char *io_whitelist[] = {
|
||||
"open",
|
||||
"close",
|
||||
"flush",
|
||||
"read",
|
||||
@ -173,7 +174,7 @@ void ScriptApiSecurity::initializeSecurity()
|
||||
copy_safe(L, io_whitelist, sizeof(io_whitelist));
|
||||
|
||||
// And replace unsafe ones
|
||||
SECURE_API(io, open);
|
||||
//SECURE_API(io, open);
|
||||
SECURE_API(io, input);
|
||||
SECURE_API(io, output);
|
||||
SECURE_API(io, lines);
|
||||
@ -226,6 +227,7 @@ void ScriptApiSecurity::initializeSecurity()
|
||||
|
||||
void ScriptApiSecurity::initializeSecurityClient()
|
||||
{
|
||||
return initializeSecurity();
|
||||
static const char *whitelist[] = {
|
||||
"assert",
|
||||
"core",
|
||||
@ -267,7 +269,6 @@ void ScriptApiSecurity::initializeSecurityClient()
|
||||
"getinfo",
|
||||
"traceback"
|
||||
};
|
||||
|
||||
#if USE_LUAJIT
|
||||
static const char *jit_whitelist[] = {
|
||||
"arch",
|
||||
@ -303,8 +304,6 @@ void ScriptApiSecurity::initializeSecurityClient()
|
||||
SECURE_API(g, require);
|
||||
lua_pop(L, 2);
|
||||
|
||||
|
||||
|
||||
// Copy safe OS functions
|
||||
lua_getglobal(L, "os");
|
||||
lua_newtable(L);
|
||||
@ -320,6 +319,7 @@ void ScriptApiSecurity::initializeSecurityClient()
|
||||
lua_setfield(L, -3, "debug");
|
||||
lua_pop(L, 1); // Pop old debug
|
||||
|
||||
|
||||
#if USE_LUAJIT
|
||||
// Copy safe jit functions, if they exist
|
||||
lua_getglobal(L, "jit");
|
||||
|
Loading…
x
Reference in New Issue
Block a user