View dumpmem.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <psapi.h> // for GetMappedFileName | |
#include <stdio.h> | |
static const struct memprot_name_type { | |
unsigned int value; | |
const char *short_name; | |
const char *desc; | |
} memprot_names[] = { | |
{PAGE_NOACCESS, "noa", "PAGE_NOACCESS"}, |
View machine-learning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Naive Bayes | |
Logistic Regression | |
Sequential Minimal Optimization | |
Laxy-Ibk | |
Random Committee | |
Decision Table | |
PART | |
J48 | |
LMT | |
Random Forest Tree |
View DiscretionaryRoundRobin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Discretionary Round Robin | |
A DFQ tries to achieve the same criterias as in a Round Robin Queue | |
1. No starvation. | |
2. Traffic Shaping: throughput and burst guarantee | |
Instead of controlling _when_ to send as in normal traffic shaping queue, | |
DRR decides whether to send. When a sender wants to send a packet, it first | |
calls Flow.send(size). DRR either returns "Yes. You can send now" or "No. | |
Check with me again after t seconds." | |
*/ |
View DiscretionaryFairQueue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Discretionary Fair Queue | |
A DFQ tries to achieve the same criterias as in WFQ: | |
1. Fairness: equivelent to byte-level round-robin | |
2. Traffic Shaping: throughput and burst guarantee | |
Instead of controlling _when_ to send as in WFQ, DFQ decides whether to | |
send. When a sender wants to send a packet, it first calls | |
Flow.send(size). DFQ either returns "Yes. You can send now" or "No. Check | |
with me again after t seconds." | |
*/ |
View TestSelect.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.InetSocketAddress; | |
import java.nio.channels.Selector; | |
import java.nio.channels.SelectionKey; | |
import java.nio.channels.SocketChannel; | |
import java.nio.ByteBuffer; | |
public class TestSelect | |
{ | |
public static void main (String [] args) throws Exception | |
{ |
View CFBTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.crypto.Cipher; | |
import javax.crypto.spec.SecretKeySpec; | |
import javax.crypto.spec.IvParameterSpec; | |
public class CFBTest | |
{ | |
final protected static char[] hexArray = "0123456789abcdef".toCharArray(); | |
public static String bytesToHex(byte[] bytes, int offset, int size) { | |
char[] hexChars = new char[size * 2]; | |
for ( int j = 0; j < size; j++ ) { |
View gist:b9a9bf4900841c1d4e6d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Problem: re-order correction code | |
You need to send a message through a datagram channel which may reorder | |
packets. It only reorder packets, but not drop or duplicate packets. You are | |
asked to design an efficient error correction code that can reliably deliver a | |
message. Minimal packets should be used. Specifically, you need to design two | |
functions (Java syntax for illustration purpose): | |
1. byte[][] encode (byte[] message, int packetSize) | |
2. byte[] decode (byte[][] packets) |
View ECDH_BC.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.math.BigInteger; | |
import java.security.PublicKey; | |
import java.security.PrivateKey; | |
import java.security.KeyFactory; | |
import java.security.Security; | |
import java.security.KeyPairGenerator; | |
import java.security.KeyPair; | |
import java.security.SecureRandom; | |
import java.security.spec.PKCS8EncodedKeySpec; | |
import java.security.spec.ECGenParameterSpec; |
View CBackend.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Writing an LLVM Backend" http://llvm.org/docs/WritingAnLLVMBackend.html | |
"llvm commit: Remove the C backend" https://github.com/llvm-mirror/llvm/commit/a443e5b1f1013612950fc3c9ebfafca60a1c20df | |
"clang commit: Remove the vestiges of the C backend" https://github.com/llvm-mirror/clang/commit/f102c45ed9caf6f0002edb2adb19687e25ec20d3 |
View soot-error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git log -1 | |
commit 6ec014ac4b72e309c561f01726c2c7c8e39284be | |
Author: Steven Arzt <Steven.Arzt@cased.de> | |
Date: Thu May 15 11:39:04 2014 +0200 | |
Fixed some previously horribly hacky code for parsing annotations. Now it also works with malware samples that do not provide a full InnerClass annotation | |
$ git diff | |
diff --git a/src/soot/Scene.java b/src/soot/Scene.java |