Closed gogo9th closed 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)); } ));
Merged, thank you :)
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)); } ));