Skip to content
Snippets Groups Projects
Select Git revision
  • e31f54b6fd22c8706b347c69065931ea3c0f406a
  • master default protected
  • hai
  • isaac
  • CheHao
  • Eldar
  • mpriymak
  • master-before-merging-with-hai
  • master-before-merging-with-isaac
  • rmi-working-before-merging-with-isaac
  • all-code-merged-by-hai-v1
11 results

MySharedKey.java

Blame
  • Fuzzer.java 1.34 KiB
    import java.io.IOException;
    import java.io.FileOutputStream;
    import java.io.PrintWriter;
    
    
    /* a stub for your team's fuzzer */
    public class Fuzzer {
    
        private static final String OUTPUT_FILE = "fuzz.s";
        
        public static void main(String[] args) throws IOException {
            FileOutputStream out = null;
            PrintWriter pw = null;
            try {
                out = new FileOutputStream(OUTPUT_FILE);
                pw = new PrintWriter(out);
                
                /* We just print one instruction.
                   Hint: you might want to make use of the instruction
                   grammar which is effectively encoded in Instruction.java */
                /*pw.println("MOV R1 0");
                for(int x=0;x<20000;x++){
                    pw.println("LDR R0 R1 " + x);
                }
                pw.println("RET R0");
                */
                //pw.println("RET R-1");
                pw.println("MOV R0 512");
                //pw.println("DIV R0 R0 R1");
                for(int x=0;x<31;x++){
                pw.println("ADD R"+(x+1)+" R"+x +" R"+x);
                };
                pw.println("RET R31");
            }catch (Exception e){
                e.printStackTrace(System.err);
                System.exit(1);
            }finally{
                if (pw != null){
                    pw.flush();
                }
                if (out != null){
                    out.close();
                }
            }
    
        }
    
    }