Skip to content

Instantly share code, notes, and snippets.

View SecSamDev's full-sized avatar

Samuel Garcés Marín SecSamDev

View GitHub Profile
@SecSamDev
SecSamDev / lip_sync.js
Last active January 23, 2024 21:11
Gothic3: Pack file extractor and LipSync readed
const fs = require('fs');
let file = ''
file = "./Speech_English_pak/English_LipSyncData/SVM_Zuben_WeatherRain_English.xlip"//2.81 sec
file = "./Speech_English_pak/English_LipSyncData/SVM_Zuben_WhatDoYouWant_English.xlip"//1.84 sec
file = "./Speech_English_pak/English_LipSyncData/SVM_Zuben_WhatWasThat_English.xlip"//1.64secs
//file = './Speech_English_pak/English_LipSyncData/SVM_Zuben_InnosTeacher_00_English.xlip'//4.68
const file_content = fs.readFileSync(file);
@SecSamDev
SecSamDev / ElasticToNeo4j.ipynb
Last active August 1, 2023 16:36
Sysmon Graph in neo4j
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SecSamDev
SecSamDev / cargo.toml
Created September 7, 2022 08:45
XOR string obfuscation in Rust
[package]
name = "string-obfuscation"
version = "0.1.0"
edition = "2021"
[dependencies]
rand = "0.8"
proc-macro2 = "1.0"
quote = "1.0"
use std::io;
#[cfg(windows)] use winres::WindowsResource;
#[cfg(windows)] use static_vcruntime;
fn main() -> io::Result<()> {
#[cfg(windows)] {
static_vcruntime::metabuild();
WindowsResource::new()
.set_icon("icon.ico")
.compile()?;
@SecSamDev
SecSamDev / cargo.toml
Last active September 1, 2022 09:48
EnumerateLogonSessions
[package]
name = "test_rust"
version = "0.1.0"
edition = "2021"
[target.'cfg(target_os = "windows")'.dependencies.windows]
version = "0.39.0"
features = [
"Win32_Foundation",
"Win32_Security_Authentication_Identity"
@SecSamDev
SecSamDev / monkey-island.js
Created November 7, 2020 11:33
Telegram bot to battle using insults from MonkeyIsland
const TelegramBot = require('node-telegram-bot-api');
const token = 'TOKEN_TELEGRAM';
const FRASES_PIRATAS = [
{
init: ["¿Has dejado ya de usar pañales?", "Espero que tengas un barco para una rápida huida."],
res: "¿Por qué? ¿Acaso querías pedir uno prestado?"
},
{
worker_processes 1;
error_log /var/log/nginx/error.log debug;
events {
worker_connections 1024;
}
http {
server_tokens off;
include mime.types;
charset utf-8;
log_format rt_cache '$remote_addr - $upstream_cache_status [$time_local] '
@SecSamDev
SecSamDev / Quaternion.js
Created July 31, 2019 17:54
Compress quaternions for network transmission
//2^15 => 15 bits
const HALF_STEP = 16384n
const STEP = 32768
const QUATERNION_LIMITS = 2 / (STEP)
/**
* The purpose of this small library is the compression of quaternions
* for transmit them over the network, where the bandwidth is limited.
*/
class Quaternion {
@SecSamDev
SecSamDev / benchmark-hash.js
Last active September 21, 2023 15:15
Performance of native crypto hash algorithms
const crypto = require('crypto')
const myBuff = Buffer.allocUnsafe(1200);
const alg = crypto.getHashes()
for(let i = 0; i < alg.length; i++){
const initTime = new Date().getTime()
for (let j = 0; j < 100000; j++) {
let digBuff = crypto.createHash(alg[i]).update(myBuff).digest()
}
const endTime = new Date().getTime()
console.log(`${alg[i]} - ${100000/((endTime - initTime) / 1000)} hash/s`)
@SecSamDev
SecSamDev / Results.txt
Created July 16, 2019 19:27
Measuring of Nodejs Buffer allocation and copy bytes (performance, benchmark)
Allocating 1000 buffers of 30000 bytes => avg 9.7mils max 33mils min 3mils
Copy 3 buffers of 10000 bytes in 1000 buffers of 30000 bytes: 13.166666666666666 mils max 23mils min 8mils