Skip to content

Instantly share code, notes, and snippets.

View Green-Sky's full-sized avatar
😜
*typing...*

Erik Scholz Green-Sky

😜
*typing...*
View GitHub Profile
@Green-Sky
Green-Sky / powerdelta.cpp
Created January 29, 2017 10:06
quick n dirty code to monitor powerconsumption
#include <iostream>
#include <chrono>
#include <thread>
#include <fstream>
#define PATH "/sys/class/powercap/intel-rapl:0/energy_uj"
int main(void) {
std::ifstream file(PATH);
@Green-Sky
Green-Sky / insel-test.cpp
Created September 4, 2017 20:13
anno1602 island (.scp) parser v1
#include "island.hpp"
#include <cassert>
void printIsland(Island* i) {
for (uint8_t y = 0; y < i->dim_y; y++) {
for (uint8_t x = 0; x < i->dim_x; x++) {
short num = i->map[std::make_pair(x, y)].num;
if (num > 900 && num <= 1000)
std::cout << "FF";
@Green-Sky
Green-Sky / ao_dissector.lua
Created April 29, 2019 20:04
albion online wireshark dissector (some photon stuff only atm)
-- albion online wireshark dissector.... or at least a beginning
-- used as ref: https://github.com/rafalfigura/AO-Radar/blob/master/AlbionRadaro/PhotonPacketHandler/PhotonPacketHandler.cs
-- (c) Green Sky
photon_protocol = Proto("Photon", "Photon Protocol")
peer_id = ProtoField.uint16("photon.peer_id", "peer_id", base.DEC)
crc_enabled = ProtoField.bool( "photon.crc_enabled", "crc_enabled")
command_count = ProtoField.uint8( "photon.command_count", "command_count", base.DEC)
time_stamp = ProtoField.int32( "photon.time_stamp", "time_stamp", base.DEC)
{
intel-driver 1
Memcheck:Addr1
obj:/usr/lib/x86_64-linux-gnu/dri/i965_dri.so
}
{
intel-driver 1 2
Memcheck:Addr1
fun:*
@Green-Sky
Green-Sky / tracy_sink.hpp
Created June 17, 2020 19:57
adds a spdlog sink for tracy profiler
#pragma once
#ifdef TRACY_ENABLE
#include <spdlog/sinks/base_sink.h>
#include <tracy/Tracy.hpp>
namespace spdlog::sinks {
static uint32_t level_to_color(spdlog::level::level_enum level) {
@Green-Sky
Green-Sky / entt_organizer_graph_to_dot.cpp
Last active November 12, 2020 01:01
Generates a .dot GraphViz
// Generates a .dot GraphViz
// license is CC0 (this means public domain in most countries)
std::ostream& operator<<(std::ostream& out, const std::vector<entt::organizer::vertex>& nodes) {
out << "digraph EnTT_organizer {\n";
for (size_t i = 0; i < nodes.size(); i++) {
out << "n" << i << "[label=\"" << (nodes[i].name() == nullptr ? "NoName" : nodes[i].name()) << "\"];\n";
}
@Green-Sky
Green-Sky / tox_save.hexpat
Created March 1, 2022 19:40
ImHex pattern file for toxcore save files
// tox save pattern for unencrypted data
#pragma endian little
#include <std/cint.pat>
#include <std/io.pat>
#include <std/sys.pat>
#include <std/mem.pat>
#!/bin/bash
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.
rm ~/.config/tox/DHTnodes.json
for i in {0..19}
do
# inital setup client if save file does not exist
if [[ ! -f "tmp_udp_ngc_testnet$i.tox" ]]; then
@Green-Sky
Green-Sky / tox_save.ksy
Created May 14, 2022 20:32
kaitai toxsave file wip v1
meta:
id: tox_save
file-extension: tox_save
license: CC0-1.0
ks-version: 0.9
endian: le
doc: |
Toxcore save file parser (wip)
@Green-Sky
Green-Sky / tox_save.ksy
Created May 14, 2022 20:45
kaitai toxsave file wip ngc test
meta:
id: tox_save
license: CC0-1.0
ks-version: 0.9
endian: le
imports:
- /serialization/msgpack
doc: |
Toxcore save file parser (wip)