I'm trying to reverse engineer.NET binary with dnspy. I have a decryption routine that is used to display useful strings. It takes one integer value as a parameter and uses it in the decryption process, I wrote a script to decrypt one string per value.

This routine is called many times. I want to retrieve all integer values passed to this function to decrypt all strings.

How to automate this process using python for example?

  • 1
    why not simply brute force for i in range(0,1,200,1): decrypte(i)
    – blabb
    Commented Feb 13, 2022 at 9:22
  • you could probably also script it in dnSpy, but not in python by C# (via C# interactive?) Commented Feb 13, 2022 at 9:44
  • @blabb Thanks for replying but these values are randomly hardcoded and if I pass a wrong value the decryption will fail.
    – Raafat
    Commented Feb 13, 2022 at 19:48
  • @Paweł Łukasik Could you explain more! I just want all references to this function to get all passed values.
    – Raafat
    Commented Feb 13, 2022 at 19:49
  • 1
    brute force is by nature letting something fail intentionally and finding all those which does not fail
    – blabb
    Commented Feb 14, 2022 at 8:31


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.