Guest User

Untitled

a guest
Apr 21st, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.90 KB | None | 0 0
  1. int __cdecl fseek(FILE *File, __int32 Offset, int Origin)
  2. {
  3.   char v3; // ST14_1@2
  4.   int result; // eax@8
  5.  
  6.   if ( !File )
  7.   {
  8.     if ( _CrtDbgReport(2, (int)"fseek.c", 146, 0, "str != NULL", v3) == 1 )
  9.       __asm { int     3               ; Trap to Debugger }
  10.   }
  11.   if ( File->_flag & 0x83 && (!Origin || Origin == 1 || Origin == 2) )
  12.   {
  13.     File->_flag &= 0xFFFFFFEFu;
  14.     if ( Origin == 1 )
  15.     {
  16.       Offset += ftell(File);
  17.       Origin = 0;
  18.     }
  19.     _flush(File);
  20.     if ( File->_flag & 0x80 )
  21.     {
  22.       File->_flag &= 0xFFFFFFFCu;
  23.     }
  24.     else
  25.     {
  26.       if ( File->_flag & 1 )
  27.       {
  28.         if ( File->_flag & 8 )
  29.         {
  30.           if ( !(File->_flag & 0x400) )
  31.             File->_bufsiz = 512;
  32.         }
  33.       }
  34.     }
  35.     result = (_lseek(File->_file, Offset, Origin) != -1) - 1;
  36.   }
  37.   else
  38.   {
  39.     dword_4DA378 = 22;
  40.     result = -1;
  41.   }
  42.   return result;
  43. }
Add Comment
Please, Sign In to add comment