Reverse Engineering: Recursion in Bomb4.exe


    Function that calls itself
  •     May take the form of circular call relationship
  •     Determine what the base cases are.
  •     Example of when you might see recursion:
  •     Divide and conquer algorithms
  •     Sorting
  •     Tree or graph traversal, such as directory or file search
Here is the pseudocode:

    {
    int result; // eax@4
    int v2; // [esp+0h] [ebp-Ch]@1
    int v3; // [esp+8h] [ebp-4h]@1 v2 v2 = sscanf(Src, aD, &v3); if (
    if ( v2 != 1 || v3 < 1 )
    BombBlowupFunc(v2);
    result = fibonacci(v3); if (
    if ( result != 55 )
    BombBlowupFunc(1); return
    return result; }
    {
    int v2; // esi@3

    if ( a1 <= 1 )
    return 1;
    v2 = fibonacci(a1 – 1);
    return v2 + fibonacci(a1 – 2);
    }

    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out /  Change )

    Google photo

    You are commenting using your Google account. Log Out /  Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )

    Connecting to %s