diff --git a/reversing/reversing-tools-basic-methods/angr/angr-examples.md b/reversing/reversing-tools-basic-methods/angr/angr-examples.md index 985575bfd..24b97f948 100644 --- a/reversing/reversing-tools-basic-methods/angr/angr-examples.md +++ b/reversing/reversing-tools-basic-methods/angr/angr-examples.md @@ -416,5 +416,82 @@ Note that the symbolic file could also contain constant data merged with symboli ``` {% endhint %} +### Applying Constrains + +{% hint style="info" %} +Sometimes simple human operations like compare 2 words of length 16 **char by char** \(loop\), **cost** a lot to a **angr** because it needs to generate branches **exponentially** because it generates 1 branch per if: `2^16` +Therefore, it's easier to **ask angr get to a previous point** \(where the real difficult part was already done\) and **set those constrains manually**. +{% endhint %} + +```python +# After perform some complex poperations to the input the program checks +# char by char the password against another password saved, like in the snippet: +# +# #define REFERENCE_PASSWORD = "AABBCCDDEEFFGGHH"; +# int check_equals_AABBCCDDEEFFGGHH(char* to_check, size_t length) { +# uint32_t num_correct = 0; +# for (int i=0; i