Skip to content

Instantly share code, notes, and snippets.

View jackbergus's full-sized avatar
🏖️

Giacomo Bergami jackbergus

🏖️
View GitHub Profile
/*
* ReflectiveFactoryMethod.java
* This file is part of ReflectiveFactoryMethod.java
*
* Copyright (C) 2022 - Giacomo Bergami
*
* ReflectiveFactoryMethod.java is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2022 Giacomo Bergami
#
# This file is part of MaxCDijkstra
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@jackbergus
jackbergus / vuln.c
Last active May 4, 2021 13:00
An example of Buffer Overflow Attack for x64 architectures.
/*
* vuln2.c
* This file is part of bufovattack
*
* Copyright (C) 2021 - Giacomo Bergami
*
* bufovattack is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@jackbergus
jackbergus / CMakeLists.txt
Created November 9, 2020 23:30
Reading a .tar.xx file using a more C++ structured fashion via libarchive
cmake_minimum_required(VERSION 3.16)
project(read_archive)
set(CMAKE_CXX_STANDARD 14)
find_library(LibArchive 3.4.0)
add_executable(read_archive main.cpp)
target_link_libraries(read_archive archive)
/*
* HierarchicalDistance.java
* This file is part of HierarchicalDistance
*
* Copyright (C) 2019 - Giacomo Bergami
*
* HierarchicalDistance is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
@jackbergus
jackbergus / stack.ll
Created December 8, 2017 18:14 — forked from barrucadu/stack.ll
Stack implementation in LLVM IR
; The stack pointer is going to be an index into the stack, and the
; stack is an array of words. The alternative would be to have the
; stack pointer me a pointer to memory, but this is perhaps a bit
; nicer, as where the stack actually lives is totally irrelevant.
@stack = global [1000 x i64] undef
@sp = global i64 undef;
; Now we have the basic stack operations: push, pop, and peek. As can
; be seen from the definitions, LLVM is typed, which is really nice as
@jackbergus
jackbergus / cleaner.py
Created November 5, 2017 09:44
Script that deletes the mails from senders specified by a json file
#!/usr/bin/python
#! -*- coding: utf-8 -*-
#
# cleaner.py
# This file is part of Cleaner
#
# Copyright (C) 2012 - Giacomo Bergami
#
# Cleaner is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@jackbergus
jackbergus / HML.ml
Created November 5, 2017 09:42
Implements the Hennessy–Milner logic on OCaml
(*
* HML.ml
* This file is part of hml
*
* Copyright (C) 2013 - Giacomo Bergami
*
* hml is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.

Keybase proof

I hereby claim:

  • I am jackbergus on github.
  • I am begi (https://keybase.io/begi) on keybase.
  • I have a public key ASBS1dRqgwgsxptuKHQOHngUyFLSFO_OzkFLumeC81c5cgo

To claim this, I am signing this object:

@jackbergus
jackbergus / split_and_to_mp3.py
Created July 20, 2017 14:52
Splists a file readable by ffmpeg into several mp3 files
#!/usr/bin/python
# -*- coding: utf-8 -*-
import unicodedata
import codecs
import re
from subprocess import call
import os.path
import string
import sys