import os

import angr
import simuvex
import claripy as cp
import logging

test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests'))

def regression_test_memcmp_strlen_simprocedure_interaction():
    logging.getLogger('angr.manager').setLevel(logging.DEBUG)

    bin_path = os.path.join(test_location, 'i386/cpp_regression_test_ch25')
    p = angr.Project(bin_path)
    argv1 = cp.Concat(*[cp.BVS('argv%d' % i, 8) for i in range(48)])

    state = p.factory.full_init_state(args=[bin_path, argv1],
            add_options=simuvex.o.unicorn,
            remove_options={simuvex.o.LAZY_SOLVES})

    sm = p.factory.simgr(state)
    x = sm.explore(find=0x8048b9b, num_find=3)

    print x
    for s in x.found:
        solution = s.state.se.eval_one(argv1, cast_to=str)
        print solution

if __name__ == '__main__':
    regression_test_memcmp_strlen_simprocedure_interaction()

@@ -15,20 +15,27 @@
 ort 
-angr
+nose.tools%0A
 %0Aimport 
 simu
@@ -30,23 +30,20 @@
 %0Aimport 
-simuvex
+angr
 %0Aimport 
@@ -59,23 +59,8 @@
 s cp
-%0Aimport logging
 %0A%0Ate
@@ -142,20 +142,26 @@
  '..
-/../
+', '..', '
 binaries
 /tes
@@ -156,17 +156,20 @@
 binaries
-/
+', '
 tests'))
@@ -170,16 +170,17 @@
 sts'))%0A%0A
+%0A
 def regr
@@ -236,16 +236,39 @@
 n():%0A   
+ # import logging%0A    #
  logging
@@ -371,9 +371,12 @@
 i386
-/
+', '
 cpp_
@@ -427,17 +427,92 @@
 bin_path
-)
+, auto_load_libs=True)  # this binary requires the loading of libstdc++.so.6
 %0A    arg
@@ -652,37 +652,70 @@
     
-add_options=simuvex.o
+                          add_options=angr.sim_options
 .unicorn
 ,%0A  
@@ -710,17 +710,16 @@
 .unicorn
-,
 %0A       
@@ -727,46 +727,34 @@
     
-remove_options=%7Bsimuvex.o.LAZY_SOLVES%7D
+                          
 )%0A%0A 
@@ -840,15 +840,48 @@
     
-print x
+nose.tools.assert_equal(len(x.found), 1)
 %0A   
@@ -961,31 +961,116 @@
 str)
-%0A        print solution
+.strip(%22%5Cx00%22)%0A        nose.tools.assert_equal(solution, %22Here_you_have_to_understand_a_little_C++_stuffs%22)%0A
 %0A%0Aif

Fix test case regression_memcmp_definite_size. It now works under Windows. (#902)