Skip to content

Instantly share code, notes, and snippets.

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

- Romain-P

🈴
/home
View GitHub Profile
@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;
@domnikl
domnikl / build.gradle.kts
Last active April 12, 2024 22:34
Gradle Kotlin DSL: set main class attribute for jar
tasks.withType<Jar> {
manifest {
attributes["Main-Class"] = "com.example.MainKt"
}
}
@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

@yuhki50
yuhki50 / intArray2byteArray.kt
Last active January 4, 2024 17:47
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()) } }
@Fonger
Fonger / HideModule.cpp
Last active January 5, 2023 04:15
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())
@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
@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.
*/
@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".
# 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