evildojo

Cromulence Interview Preparation

Interview topics will be (in greatest importance first)...

  1. Instruction lifting and intermediate representation
  2. String parsing algorithm
  3. ELF Execution Life-Cycle
  4. Secure key exchange
  5. Crypto algorithms

My Preparation Instructions:

For each topic:

1. Research topic
    - read about topic
    - extract key points
    - draw visuals
    - look at examples
    - watch youtube videos
    - clock time spent studying

Study Log:


  1. Instruction lifting and intermediate representation

Example of generating llvm intermediate representation (ir):

$ clang -Os -S -emit-llvm sample.c -o sample.ll

define i32 @square_unsigned(i32 %a) {
  %1 = mul i32 %a, %a
  ret i32 %1
}

Optimizing

$ opt-3.0 -S sample.ll

IR to machine code

$ llc-3.0 -O3 sample.ll -march=x86-64 -o sample-x86-64.s
$ llc-3.0 -O3 sample.ll -march=x86 -o sample-x86.s
$ llc-3.0 -O3 sample.ll -march=arm -o sample-arm.s

Vectors in IR

define <4 x i32> @multiply_four(<4 x i32> %a, <4 x i32> %b) {
       %1 = mul <4 x i32> %a,  %b
       ret <4 x i32> %1
}

-march=avx,sse41
-march=neon


  1. String parsing algorithm

  1. ELF Execution Life-Cycle

  1. Secure key exchange

  1. Crypto algorithms