Skip to content

Instantly share code, notes, and snippets.

View Romain-P's full-sized avatar
🈴
/home

- Romain-P

🈴
/home
View GitHub Profile
# Makefile template for a shared library in C
# https://www.topbug.net/blog/2019/10/28/makefile-template-for-a-shared-library-in-c-with-explanations/
CC = gcc # C compiler
CFLAGS = -fPIC -Wall -Wextra -O2 -g # C flags
LDFLAGS = -shared # linking flags
RM = rm -f # rm command
TARGET_LIB = libtarget.so # target lib
SRCS = main.c src1.c src2.c # source files
@jsumners
jsumners / logback.xml
Last active March 19, 2018 18:32
A basic Logback configuration template for use in an IntelliJ IDEA file template. Very easily used as a generic template as well.
<configuration scan="true" scanPeriod="1 minute">
<variable
name="logPattern"
value="%-30(%d{MMM dd YYYY HH:mm:ss.SSS} [%thread]) %-5level %logger{5} [%file:%line] - %msg%n" />
<!--
The base name of the log file. For "example.log" this would
simply be "example". Or if it were "logs/example.log" then
"logs/example".
@kala13x
kala13x / strtoken.c
Last active April 17, 2019 16:58
Thread safe alternative of the strtok() function
/*
* strtoken.c
*
* Copyleft (C) 2015 Sun Dro (a.k.a. kala13x)
*
* This source is thread safe alternative of the strtok().
* See usage of the get_token() below at main() function.
*/
@nosmall
nosmall / README - TrinityCore restarter
Last active June 22, 2020 09:45
(simple) TrinityCore (linux (Debian)) restarter (using a bashscript) for posterus.cz
# (simple) TrinityCore (linux (Debian)) restarter (using a bashscript) for posterus.cz
# required applications
# sudo apt-get update && sudo apt-get install screen mutt gdb
# INFO
# ./_restarter > Starts the world server with restarter
# ./_auth_starter > Starts the auth server without restarter
# ./_world_starter > Starts the world server without restarter
@Fonger
Fonger / HideModule.cpp
Last active September 6, 2024 15:43
Hide DLL ( 32bit and 64bit support)
#include "stdafx.h"
#include "HideModule.h"
std::vector<UNLINKED_MODULE> UnlinkedModules;
void RelinkModuleToPEB(HMODULE hModule)
{
std::vector<UNLINKED_MODULE>::iterator it = std::find_if(UnlinkedModules.begin(), UnlinkedModules.end(), FindModuleHandle(hModule));
if (it == UnlinkedModules.end())
@yuhki50
yuhki50 / intArray2byteArray.kt
Last active October 2, 2024 20:02
Kotlin intArray to byteArray
val ints = intArrayOf(0x01, 0xFF)
val bytes = ints.foldIndexed(ByteArray(ints.size)) { i, a, v -> a.apply { set(i, v.toByte()) } }
@mattwarren
mattwarren / veh_hook.cpp
Created January 5, 2018 10:24 — forked from ReubenBond/veh_hook.cpp
INT3 Vectored Exception Handler hooking
/**
veh_hook Vectored Exception Handler hooking library
Version: 24-March-2008
**/
#define WINVER 0x0501
#define _WIN32_WINNT 0x0501
#include <windows.h>
#include "veh_hook.h"
static veh_list_t* list = NULL;
@LoadLow
LoadLow / Readme.md
Last active November 5, 2018 23:34
INS'HACK CTF 2018 - Web Crypt0r part 2 - Extend the hash - RushB%
  1. Guessed integrity check : user : hash : b64_encoded_info in cookie user

  2. info in YAML format

  3. Some YAML parsers allow to redefine the same key, that replaces the old value

  4. We have a hint : /src-code/ contains a swp file, original file was removed. It's easy to extract from it the src code of the web app. Of course it's a double-key permissive YAML parser

@domnikl
domnikl / build.gradle.kts
Last active October 11, 2024 11:06
Gradle Kotlin DSL: set main class attribute for jar
tasks.withType<Jar> {
manifest {
attributes["Main-Class"] = "com.example.MainKt"
}
}
@ensingerphilipp
ensingerphilipp / ChaCha20Poly1305.java
Last active January 5, 2024 11:51
ChaCha20Poly1305 Encryption in Java11
package chaCha20Poly1305Encryption;
import javax.crypto.*;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.spec.AlgorithmParameterSpec;
import java.util.Base64;