ExpoSEJS / ExpoSE

A Dynamic Symbolic Execution (DSE) engine for JavaScript. ExpoSE is highly scalable, compatible with recent JavaScript standards, and supports symbolic modelling of strings and regular expressions.
MIT License
183 stars 36 forks source link

Quick fix suggestions #91

Closed gogo9th closed 4 years ago

gogo9th commented 4 years ago

File "scripts/analyse": --- (node --max_old_space_size=4096 Distributor/bin/Distributor.js "$1" ${@:2}) +++ (node --max_old_space_size=4096 Distributor/bin/Distributor.js "$1" "${@:2}")

File "Analyser/src/SymbolicExecution.js" ... --- if (offset == "referer") { +++ if (offset == "referrer") { ...

File "Analyser/src/Models/MathModels.js"    model.add(Math.ceil, symbolicHook(       Math.ceil,       (base, args) => state.isSymbolic(args[0]),       (base, args, r) => {          const intArg = ctx.mkRealToInt(state.asSymbolic(args[0]));          const floored = ctx.mkIntToReal(intArg);          --- return new ConcolicValue(r, floored);          +++ const one_real = ctx.mkIntToReal(ctx.mkIntVal(1))));         +++ return new ConcolicValue(r, ctx.mkIte(ctx.mkLt(floored, state.asSymbolic(args[0])), ctx.mkAdd(floored, one_real, floored));       }    ));    model.add(Math.round, symbolicHook(       Math.round,       (base, args) => state.isSymbolic(args[0]),       (base, args, r) => {          const intArg = ctx.mkRealToInt(state.asSymbolic(args[0]));          const floored = ctx.mkIntToReal(intArg);          --- return new ConcolicValue(r, floored);          +++ const half_real = ctx.mkDiv(ctx.mkIntToReal(ctx.mkIntVal(1)), 2);         +++ const realArgPlusHalf = ctx.mkAdd(state.asSymbolic(args[0]), half_real));          +++ const intArgPlusHalf = ctx.mkRealToInt(realArgPlusHalf);          +++ const flooredPlusHalf = ctx.mkIntToReal(ingArgPlusHalf);          +++ return new ConcolicValue(r, ctx.mkIte(ctx.mkLt(floored, flooredPlusHalf)), flooredPlusHalf, floored));       }    ));

jawline commented 4 years ago

Merged, thank you :)