Skip to content

Instantly share code, notes, and snippets.

View markhc's full-sized avatar
🏠
Working from home

Marcelo Conceição markhc

🏠
Working from home
View GitHub Profile
@markhc
markhc / HelloImSnith.py
Last active November 27, 2015 01:59
Dank bot
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import praw
import time
import datetime
#default value
COUNTER = 2276
@markhc
markhc / logger.js
Created December 6, 2015 14:13
TwitchChat Logger
"use strict";
var irc = require("tmi.js");
var mysql = require('mysql');
var database_options = {
host : 'localhost',
user : 'root',
password : 'password',
database : 'irc_logger'
};
#include "SpoofedConvar.hpp"
using namespace SourceEngine;
SpoofedConvar::SpoofedConvar(const char* szCVar) {
m_pOriginalCVar = SourceEngine::Interfaces::CVar()->FindVar(szCVar);
Spoof();
}
SpoofedConvar::SpoofedConvar(SourceEngine::ConVar* pCVar) {
m_pOriginalCVar = pCVar;
NTSTATUS RDrvInjectModule(
IN PINJECT_MODULE pInput,
OUT PINJECT_MODULE_RESULT pOutput
) {
NTSTATUS status = STATUS_SUCCESS;
PEPROCESS pProcess = NULL;
KAPC_STATE apc;
status = PsLookupProcessByProcessId((HANDLE)pInput->TargetProcessId, &pProcess);
if(NT_SUCCESS(status)) {
UCHAR pCodeBuffer[] =
{
0x55, //push ebp // 0x00
0x89, 0xE5, //mov ebp,esp // 0x01
0x68, 0x00, 0x00, 0x00, 0x00, //push pModuleHandle // 0x03
0x68, 0x00, 0x00, 0x00, 0x00, //push pszModulePath // 0x08
0x6A, 0x00, //push 0 // 0x0D
0x6A, 0x00, //push 0 // 0x0F
0xE8, 0x00, 0x00, 0x00, 0x00, //call LdrLoadDll // 0x11
0x5D, //pop ebp // 0x16
static int times = 0;
if(g_Options.MiscHideName) {
static SourceSDK::ConVar* name = SourceSDK::Interfaces::CVar()->FindVar("name");
*reinterpret_cast<int*>(reinterpret_cast<DWORD>(&name->m_fnChangeCallbacks) + 0xC) = 0;
if(times < 50) {
static string szName = "\n";
if(szName[0] == '\n') {
for(int i = 1; i < SourceSDK::Interfaces::EngineClient()->GetMaxClients(); i++) {
auto pEntity = static_cast<C_CSPlayer*>(SourceSDK::Interfaces::EntityList()->GetClientEntity(i));
SourceSDK::player_info_t info;
static int times = 0;
if(g_Options.MiscHideName) {
static SourceSDK::ConVar* name = SourceSDK::Interfaces::CVar()->FindVar("name");
*reinterpret_cast<int*>(reinterpret_cast<DWORD>(&name->m_fnChangeCallbacks) + 0xC) = 0;
if(times < 50) {
static string szName = "\n";
if(szName[0] == '\n') {
for(int i = 1; i < SourceSDK::Interfaces::EngineClient()->GetMaxClients(); i++) {
auto pEntity = static_cast<C_CSPlayer*>(SourceSDK::Interfaces::EntityList()->GetClientEntity(i));
SourceSDK::player_info_t info;
bool PerformStep(
QAngle src,
QAngle dst,
float maxStep,
SourceSDK::QAngle &res)
{
Vector delta = dst - src;
res = src;
if(delta.Length() > maxStep) {
res += (delta.Normalized() * maxStep);
NTSTATUS RDrvAddToInvertedFunctionTable(
VOID
)
{
NTSTATUS status = STATUS_SUCCESS;
PRTL_INVERTED_FUNCTION_TABLE pInvertedFunctionTable;
CONST UCHAR szPattern[] = "\x89\x74\xCD\x20";
CONST UCHAR szMask[] = "xxxx";
status = RDrvGetKernelInfo(NULL, NULL); //Find kernel base & size
#include <Windows.h>
#include <Psapi.h>
#include <ntstatus.h>
#include <cstdint>
#include <functional>
#include <Shlwapi.h>
#include <winternl.h>
#pragma comment(lib, "ntdll.lib")
#pragma comment(lib, "Shlwapi.lib")