Skip to content

Instantly share code, notes, and snippets.

@linghuiluo
linghuiluo / MavenList.txt
Last active August 23, 2022 12:36
Maven Packages Artifact ID
cxf-bundle-minimal-2.3.0
org.wso2.carbon.apimgt.impl-6.5.267
vaadin-shared-deps-1.0.5
akka-http-experimental_2.12.0-RC1-2.4.11
activemq-osgi-5.14.5
hazelcast-all-3.6-RC1
quickfixj-all-2.1.1
org.apache.servicemix.bundles.solr-solrj-8.3.1_1
org.apache.servicemix.bundles.gwt-user-2.6.0_1
akka-remote_2.13.0-RC2-2.5.23
@linghuiluo
linghuiluo / sootCFG.md
Last active July 28, 2020 08:35
Different Types of CFGs in Soot
  • BriefUnitGraph

    A CFG where the nodes are Unit instances, and where no edges are included to account for control flow associated with exceptions.

  • ExceptionalUnitGraph

    control flow associated with exceptions is taken into account.

  • CompleteUnitGraph

@linghuiluo
linghuiluo / bytecode.md
Created April 19, 2020 20:46
Java Bytecode Execution
public class Spin
{

    private int a;
    private String b;

    protected void spin()
    {
        int i;
@linghuiluo
linghuiluo / example-no-lambda.md
Created April 19, 2020 18:18
Example without Lambda Expressions
 public class Example
  minor version: 0
  major version: 52
  flags: ACC_PUBLIC, ACC_SUPER
Constant pool:
   #1 = Methodref          #11.#39        // Example.lambda$main$1:(II)I
   #2 = Methodref          #11.#40        // Example.lambda$main$0:(II)I
   #3 = Methodref          #12.#41        // java/lang/Object."<init>":()V
   #4 = Class              #42            // Addition
@linghuiluo
linghuiluo / example-lambda.md
Created April 19, 2020 18:15
Example Class With Lambda Expression
public class Example
  minor version: 0
  major version: 52
  flags: ACC_PUBLIC, ACC_SUPER
Constant pool:
   #1 = Methodref          #8.#30         // java/lang/Object."<init>":()V
   #2 = Class              #31            // Addition
   #3 = Methodref          #2.#30         // Addition."<init>":()V
   #4 = InvokeDynamic      #0:#36         // #0:operation:()LOperator;
@linghuiluo
linghuiluo / lambdas.md
Last active April 19, 2020 18:32
Lambda Expression From Java Source to Bytecode & Desugaring in Bytecode

Lambda Expression From Java Source to Bytecode & Desugaring

This is a walk-through example I played to understand the lambda expression at Java bytecode level better and how to desugar it.

Consider the following source code example with the lamda-expressions in class Example:

public interface Operator{

       public int operation(int a, int b); 
@linghuiluo
linghuiluo / javatype.md
Last active August 2, 2019 10:22
Java Type System

Java Type System

Concepts

  • Statically typed language: variables have definite types, it is a compile-time error to assign a value of an incompatible type to a variable, e.g., Java
  • Dynamically typed language: only check type compatiblity at runtime, e.g., JavaScript
  • Mutliple Inheritance of State, Implementation, and Type

Types in Java

  • Top-level types:
    • Primitive types
@linghuiluo
linghuiluo / benchmak.md
Last active October 11, 2021 19:55
Security Benchmarks
@linghuiluo
linghuiluo / walaVSsoot2.md
Last active March 12, 2019 14:37
WALA VS. SOOT (Method Declaration)
  • The method void setRequestMethod(java.lang.String) is declared in class java.net.HttpURLConnection.
  • The methods void setDoInput(boolean) and void connect() are declared in class java.net.URLConnection.

JAVA SOURCE CODE

 private void connect() throws IOException{
    	URL url = new URL(URL);
    	HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 
 conn.setRequestMethod("GET");
@linghuiluo
linghuiluo / walaVSsoot1.md
Last active March 11, 2019 12:20
WALA VS. SOOT (Public static field initialization)

JAVA SOURCE CODE

public final class R {
     public static final class style {
            public static final int AppBaseTheme=0x7f050000;
            public static final int AppTheme=0x7f050001;
        }
 }