Results 1 to 7 of 7

Thread: Convert IDA HexRays Decompiler source to working C source

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Private First Class
    Join Date
    Oct 2013
    Posts
    219
    Thanks
    56
    Thanked 105 Times in 66 Posts
    I'm trying to convert the following to libcod;

    PHP Code:
    int __cdecl sub_809479A(int a1)
    {
      
    int result// eax@1
      
    char s// [sp+20h] [bp-28h]@2
      
    int v3// [sp+24h] [bp-24h]@4
      
    char v4// [sp+28h] [bp-20h]@2
      
    int v5// [sp+2Ch] [bp-1Ch]@16
      
    int v6// [sp+30h] [bp-18h]@18
      
    int v7// [sp+34h] [bp-14h]@20
      
    char v8// [sp+38h] [bp-10h]@8
      
    char v9// [sp+39h] [bp-Fh]@12

      
    result a1;
      if ( *(
    _DWORD *)(a1 134212) )
      {
        
    memset(&s00x1Cu);
        
    v4 = *(_BYTE *)(sub_808FE02(-1653759219 * ((a1 - (signed int)dword_841FB0C) >> 2)) + 212);
        if ( !
    sub_81069A6(-1653759219 * ((a1 - (signed int)dword_841FB0C) >> 2)) )
        {
          if ( 
    sub_80A1410() < 0.5 )
            
    v3 |= 1u;
          if ( 
    sub_80A1410() < 0.5 )
            
    v3 |= 0x28u;
          if ( 
    sub_80A1410() >= 0.33000001 )
          {
            if ( 
    sub_80A1410() < 0.5 )
              
    v8 = -127;
          }
          else
          {
            
    v8 127;
          }
          if ( 
    sub_80A1410() >= 0.33000001 )
          {
            if ( 
    sub_80A1410() < 0.5 )
              
    v9 = -127;
          }
          else
          {
            
    v9 127;
          }
          if ( 
    sub_80A1410() < 0.33000001 )
            
    v5 = (signed int)(sub_80A142E() * 360.0);
          if ( 
    sub_80A1410() < 0.33000001 )
            
    v6 = (signed int)(sub_80A142E() * 360.0);
          if ( 
    sub_80A1410() < 0.33000001 )
            
    v7 = (signed int)(sub_80A142E() * 360.0);
        }
        *(
    _DWORD *)(a1 134408) = *(_DWORD *)(a1 452020) - 1;
        
    result sub_808F488(a1, (int)&s);
      }
      return 
    result;

    but unsure how to convert
    PHP Code:
    v4 = *(_BYTE *)(sub_808FE02(-1653759219 * ((a1 - (signed int)dword_841FB0C) >> 2)) + 212); 
    I tried
    PHP Code:
    v4 = *(int8_t *)(sub_808FE02(-1653759219 * ((a1 - *(signed int *)0x0841FB0C) >> 2)) + 212); 
    With no luck. I know its wrong but unsure what it needs to be.

    Reason I need this func converted is that with addtestclient() there is a bug that will make hips/legs unaligned from the torso and disabling this function will fix it (However it also disables bot shooting, so I need to rewrite certain parts of the function). Would appreciate it immensely if someone went ahead and converted it all.

    OR

    Does anyone know a way to make a client shoot their gun?
    Last edited by filthy_freak_; 7th July 2015 at 08:18.

Posting Permissions

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