Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What Can This Function Possibly Do?

Name: Anonymous 2011-09-28 5:17

I'm all lost...

libEntity *__cdecl cyLibDataEntry254(libEntity *E, entityPair *P)
{
  libEntity *L; // edx@1
  libEntity *Result; // eax@5
  libEntity *R; // edx@7

  L = E->L;
  if ( L )
  {
    L->R = E->R;
again:
    R = E->R;
    if ( R )
    {
      Result = E->L;
      R->L = Result;
    }
    else
    {
      if ( P->R != E )
        debugfail(254, "cglib/src/cylibdataentry.cpp");
      Result = E->L;
      P->R = Result;
    }
    E->L = 0;
    E->R = 0;
    return Result;
  }
  if ( P->L == E )
  {
    P->L = E->R;
    goto again;
  }
  if ( E->R )
    debugfail(243, "cglib/src/cylibdataentry.cpp");
  return Result;
}

Name: Anonymous 2011-09-28 5:37

>>11
A small snippet like this surely serves a larger function in a program as big as a game. Even if you figure out what exactly this one function does, you may not understand the use of this part - just like understanding how one cog works in a large machine won't let you understand the machine. You need to understand the cog's purpose - where it is used. When does the program calls this function? What does it returns to the calling function? What other factions does it interacts with? All of these are important questions that need to be answered to figure out the true nature of a piece of code.

For a start, I am not entirely sure why you cannot simply do some guesswork and give this program a number of different inputs that it will accept, seeing if you recognize any pattern. This could give you the lead you need.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List