Skip to content

Commit 3b77ffa

Browse files
committed
exit process when the concolic analysis has finished
Technically it should already end but the debug thread keeps hanging around currently...
1 parent 13ac35c commit 3b77ffa

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

platforms/CLI-Emulator/main.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,25 @@ void install_concolic_primitives(Interpreter *interpreter) {
762762
return true;
763763
},
764764
&NoneToOneU32);
765+
766+
// Primitives that return a constant should also have a symbolic constant.
767+
interpreter->register_primitive(
768+
"display_width",
769+
[](Module *m) -> bool {
770+
pushUInt32(320);
771+
m->symbolic_stack[get_ectx(m)->sp] = m->ctx.bv_val(320, 32);
772+
return true;
773+
},
774+
&NoneToOneU32);
775+
776+
interpreter->register_primitive(
777+
"display_height",
778+
[](Module *m) -> bool {
779+
pushUInt32(240);
780+
m->symbolic_stack[get_ectx(m)->sp] = m->ctx.bv_val(240, 32);
781+
return true;
782+
},
783+
&NoneToOneU32);
765784
}
766785

767786
void run_concolic(const std::vector<std::string>& snapshot_messages, int max_instructions = 50, int max_sym_vars = -1, int max_iterations = -1, int stop_at_pc = -1) {
@@ -962,6 +981,7 @@ void run_concolic(const std::vector<std::string>& snapshot_messages, int max_ins
962981
json_models["models"].push_back(j);
963982
}
964983
std::cout << json_models << std::endl;*/
984+
exit(0);
965985
}
966986

967987
int main(int argc, const char *argv[]) {

src/Primitives/emulated.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,14 +441,12 @@ def_prim(display_set_orientation, oneToNoneI32) {
441441
def_prim(display_width, NoneToOneU32) {
442442
printf("EMU: display_width()\n");
443443
pushUInt32(320);
444-
m->symbolic_stack[get_ectx(m)->sp] = m->ctx.bv_val(320, 32);
445444
return true;
446445
}
447446

448447
def_prim(display_height, NoneToOneU32) {
449448
printf("EMU: display_height()\n");
450449
pushUInt32(240);
451-
m->symbolic_stack[get_ectx(m)->sp] = m->ctx.bv_val(240, 32);
452450
return true;
453451
}
454452

0 commit comments

Comments
 (0)