Results 1 to 2 of 2

Thread: IDA PRO pseudocode -> C++ (to libcod)

  1. #1
    Corporal maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    319
    Thanks
    68
    Thanked 53 Times in 46 Posts

    IDA PRO pseudocode -> C++ (to libcod)

    Guys, i need help for rewrite function of the game to Libcod.
    PHP Code:
    /* ORIGINAL: */
    void __cdecl sub_8077DBA(int a1char *a2int a3)
    {
      
    char *v3// eax@6
      
    int v4// ST14_4@9
      
    int v5// eax@9
      
    char *v6// eax@10

      
    if ( !a2 )
      {
        
    sub_80609A8(a1"<frozen thread>\n");
        return;
      }
      if ( (
    _UNKNOWN *)a2 == &unk_83D4100 )
      {
        
    sub_80609A8(a1"<removed thread>\n");
      }
      else
      {
        if ( 
    byte_839400A )
        {
          if ( 
    dword_8394048 && sub_80757CC((int)a2) )
          {
            
    v4 sub_8077D5A((unsigned int)(a2 1));
            
    v5 sub_807752A((unsigned int)(a2 1), a3);
            
    sub_8077B96(a1, *((_DWORD *)dword_8283ED4 v4 1), *((_BYTE **)dword_8283ED4 v4 2), v5);
            return;
          }
        }
        else if ( 
    sub_80757CC((int)(a2 1)) )
        {
          
    v3 sub_80B59CE("@ %d\n", &a2[-dword_8394048]);
          
    sub_80609A8(a1v3);
          return;
        }
        
    v6 sub_80B59CE("%s\n\n"a2);
        
    sub_80609A8(a1v6);
      }
    }
    // 839400A: using guessed type char byte_839400A;
    // 8394048: using guessed type int dword_8394048; 
    My attempt:
    PHP Code:
    /* SEMI-SHIT */
    void sub_8077DBA(int a1char *a2int a3)
    {
      
    //char *v3; // eax@6
      
    int v4// ST14_4@9
      
    int v5// eax@9
      
    char *v6// eax@10
      
      
    unsigned *unk_83D4100 = (int*)0x83D4100;
      
    char *byte_839400A = (int*)0x839400A;
      
    int *dword_8394048 = (int*)0x8394048;
      
    void *dword_8283ED4 = (int*)0x8283ED4;
      
      
    void (*sub_80609A8)(int a1char *s);
      *(
    int *)&sub_80609A8 0x80609A8;
      
    bool (*sub_80757CC)(int a1);
      *(
    int *)&sub_80757CC 0x80757CC;
      
    int (*sub_8077D5A)(unsigned int a1)$
      *(
    int *)&sub_8077D5A 0x8077D5A;
      
    int (*sub_807752A)(unsigned int a1int a2);
      *(
    int *)&sub_807752A 0x807752A;
      
    void (*sub_8077B96)(int a1int a2int *a3int a4);
      *(
    int *)&sub_8077B96 0x8077B96;
      
    char *(*sub_80B59CE)(char *format, ...);
      *(
    int *)&sub_80B59CE 0x80B59CE;
      
      if ( !
    a2 )
      {
        
    sub_80609A8(a1"<frozen thread>\n");
        return;
      }
      if ( (
    int *)a2 == &unk_83D4100 )
      {
        
    sub_80609A8(a1"<removed thread>\n");
      }
      else
      {
        if ( 
    byte_839400A )
        {
          if ( 
    dword_8394048 && sub_80757CC((int)a2) )
          {
            
    v4 sub_8077D5A((unsigned int)(a2 1));
            
    v5 sub_807752A((unsigned int)(a2 1), a3);
            
    sub_8077B96(a1, *((float *)dword_8283ED4 v4 1), *((int **)dword_8283ED4 v4 2), v5);
            return;
          }
        }
        
    /* THIS NO NEED
        else if ( sub_80757CC((int)(a2 - 1)) )
        {
          v3 = sub_80B59CE("@ %d\n", &a2[-dword_8394048]);
          sub_80609A8(a1, v3);
          return;
        }*///!!!!!!!!!!!!!!!!!!!
        
    v6 sub_80B59CE("%s\n\n"a2);
        
    sub_80609A8(a1v6);
      }

    i rewrited functions, args, adresses
    write shit code's

  2. #2
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    1,824
    Thanks
    1,683
    Thanked 968 Times in 673 Posts
    You need to fix the hardcoded addresses at least: https://killtube.org/showthread.php?...rking-C-source
    i scroll at stuff

  3. The Following User Says Thank You to kung foo man For This Useful Post:

    kubislav23 (29th September 2017)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •