Skip to content

Instantly share code, notes, and snippets.

@MasterEx
MasterEx / Coolphpobfuscator.java
Last active April 6, 2021 15:58
A PHP code obfuscator implemented in java as a proof of concept
package coolphpobfuscator;
import java.io.File;
import java.io.FileNotFoundException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Scanner;
@MasterEx
MasterEx / Code.java
Created August 26, 2011 16:07
A source code encoder and a demonstration using it with PHP as a proof of concept
package coder;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
@MasterEx
MasterEx / README.md
Created September 29, 2011 18:57
PHP function alters set of characters with the given one

This is a small function that removes the punctuation from a given string in Greek. I haven't added upper case letters or multitone letters (except one letter to show how it can be expanded to fit your needs).

This function is pretty useful when using uppercase functions in our templates, because having upper case letters with tones isn't pretty.

Besides that you can map any set of characters or strings with a given character/string and then use it to alter all the mapped elements with the given one.

@MasterEx
MasterEx / id.php
Created October 9, 2011 00:27
PHP - insert unique identifier to file - steganography
<?php
function sendfile($file,$identifier,$id_length) {
if (file_exists($file)) {
$filesize = filesize($file)+$id_length;
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
@MasterEx
MasterEx / grammateia-stats.pl
Created October 22, 2011 16:32
Perl script for printing stats for a given e-grammateia lesson
#!/usr/bin/env perl
# 22-10-2011 - Periklis Master_ex Ntanasis <pntanasis@gmail.com>
#
# Usage: grammateia-stats.pl <link-to-e-grammateia-page-with-lesson's-grades>
#
use Encode;
$egrmmateiapage = $ARGV[0];
<?php
function getDays($start,$end,$day) {
$days = array();
$now = strtotime("first $day $start");
$stop = strtotime("last $day $end");
while($now <= $stop) {
$days[] = $now;
$now = strtotime("next $day",$now);
}
@MasterEx
MasterEx / AdvancedAudioSynthesisDemoActivity.java
Created May 24, 2012 21:12
Audio Synthesis with android AudioTrack - 1
package pntanasis.master_ex.android;
import pntanasis.master_ex.android.Synthesizer.Note0;
import android.app.Activity;
import android.os.Bundle;
public class AudioSynthesisDemoActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
@MasterEx
MasterEx / Coolphpobfuscator.java
Created April 4, 2013 10:09
A more advanced implementation of the original coolphpobfuscator (https://gist.github.com/MasterEx/1171816) described in http://masterex.github.com/archive/2011/08/27/php-protect-the-code.html . Credit goes to Dan.
package coolphpobfuscator;
import java.io.*;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.Scanner;
@MasterEx
MasterEx / Readme.txt
Last active December 28, 2015 17:29
new Hedgewars mode, temporary name: Team5 This is a version for the Hedgewars 0.9.19
INSTALL
Windows
Copy the two files (team5.lua and team5.cfg) to My Documents/Hedgewars/Data/Scripts/Multiplayer
Linux
Copy the two files (team5.lua and team5.cfg) to ~/.hedgewars/Data/Scripts/Multiplayer
@MasterEx
MasterEx / Readme.txt
Created November 18, 2013 21:59
new Hedgewars mode, temporary name: Team5 This is a version for the Hedgewars 0.9.20
INSTALL
Windows
Copy the two files (team5.lua and team5.cfg) to My Documents/Hedgewars/Data/Scripts/Multiplayer
Linux
Copy the two files (team5.lua and team5.cfg) to ~/.hedgewars/Data/Scripts/Multiplayer