Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Rohan Online: GMF Models

Post questions about game models here, or help out others!
User avatar
Rimbros
ultra-veteran
ultra-veteran
Posts: 495
Joined: Fri Jul 09, 2010 12:23 am
Has thanked: 41 times
Been thanked: 16 times

Re:

Post by Rimbros »

fatduck wrote:Forgot to mention that the skeleton format had been tested correct as well.
Since I am not going to write any program for it so I am not able to test the animation. I should leave these for anyone who interested in! :P
Something maxscript to load meshes, and how to extract these formats i see only geel and gem.
Renders Art by Rimbros
http://s303.photobucket.com/albums/nn12 ... E/Renders/

Personal Game repository samples, send PM
User avatar
Rimbros
ultra-veteran
ultra-veteran
Posts: 495
Joined: Fri Jul 09, 2010 12:23 am
Has thanked: 41 times
Been thanked: 16 times

Re: Re:

Post by Rimbros »

Rimbros wrote:
fatduck wrote:Forgot to mention that the skeleton format had been tested correct as well.
Since I am not going to write any program for it so I am not able to test the animation. I should leave these for anyone who interested in! :P
Something maxscript to load meshes, and how to extract these formats i see only geel and gem.
I realy like this models are beautyfull, i not need the skeleton only need import the models also the models i posted in the tread of most wanted models are very beautifull bot more hard than this models of rohan to decript.
Renders Art by Rimbros
http://s303.photobucket.com/albums/nn12 ... E/Renders/

Personal Game repository samples, send PM
User avatar
Rimbros
ultra-veteran
ultra-veteran
Posts: 495
Joined: Fri Jul 09, 2010 12:23 am
Has thanked: 41 times
Been thanked: 16 times

Re: Rohan Online: GMF Models

Post by Rimbros »

liquidwad wrote:Thank you to fatduck for figuring out and releasing numerous file formats for rohan. Thanks also to Spintz for the extraction code. One problem when extracting all the meshes and textures is that it hard to tell what pieces go together. IEF files contain this information, so I would like to share its format with you:

Code: Select all

/* ROHAN ONLINE .IEF FORMAT
 * BY PRINCEWADII
 * 01/27/08 4:50 AM
 * Description: .ief files group all meshes that 
 * belong together and store their .gmf file names
 * and material names.
 */

//=============
//   HEADER
//=============
dword header		//always 0x00 00 00 00
dword typeCount  	

//============
//    DATA
//============

struct Type[typeCount]   //normal armor, event armor, head deco, etc..
{
	dword typeID     	
	dword setCount 		 

	struct Set[setCount]  //combination of parts that form a full armor for example
	{
		dword setID 
		struct Part[4]
		/*Parts always come in sets of 4 (ex: upper body, 
		lower body, glove, boot)*/
		{
			dword partLen  		
			char[partLen] bodyPart   //Example: Upper Body
			dword meshCount		//Number of meshes per part

			struct Mesh [meshCount]
			{
				dword meshLen		
				char[meshLen] meshName	//example: c_am_body01.gmf 
				dword matCount		//Number of materials per mesh
				struct Materials [matCount]
				{
					dword matLen		
					char[matLen] material	//Example: Material #01001 
				}
			}
		}
	}
}
Just as an example, using .ief files, I was able to do this:

Image

(This tool will also extract and convert full sets from .gmf to .x. I plan on releasing it once it is 100% perfect).
Posted: Sat Nov 01, 2008 2:06 am, around years ago, i think you leave the project, can please share the information abouth this to others can continue with the project? thanks :)
Renders Art by Rimbros
http://s303.photobucket.com/albums/nn12 ... E/Renders/

Personal Game repository samples, send PM
ghoul
ultra-n00b
Posts: 5
Joined: Sun Jan 02, 2011 4:11 pm

Re: Rohan Online: GMF Models

Post by ghoul »

Guys do anyone know how to import gmf files to 3ds max? Thanks to spintz I finally extract .gem and .gel files. Now I need some meshes but I dont have any idea how to use .gmf files. I see some codes in c++ but Im not good programist so do anyone can explain me how can I use code I can see above? Ultimate Unwrap 3D is little expensive for me so please guys if anyone know or have something I can use to get that meshes then please share it. I MUST HAVE SOME ARMORS from this excellent game!!! xD

Im sorry for my english Im from Poland.
User avatar
Rimbros
ultra-veteran
ultra-veteran
Posts: 495
Joined: Fri Jul 09, 2010 12:23 am
Has thanked: 41 times
Been thanked: 16 times

Re: Rohan Online: GMF Models

Post by Rimbros »

ghoul wrote:Guys do anyone know how to import gmf files to 3ds max? Thanks to spintz I finally extract .gem and .gel files. Now I need some meshes but I dont have any idea how to use .gmf files. I see some codes in c++ but Im not good programist so do anyone can explain me how can I use code I can see above? Ultimate Unwrap 3D is little expensive for me so please guys if anyone know or have something I can use to get that meshes then please share it. I MUST HAVE SOME ARMORS from this excellent game!!! xD

Im sorry for my english Im from Poland.
Can you make a guide how to unpack the files? a friend tell me maybe he can make a guide too abouth import gmf files, but its not easy.
Renders Art by Rimbros
http://s303.photobucket.com/albums/nn12 ... E/Renders/

Personal Game repository samples, send PM
ghoul
ultra-n00b
Posts: 5
Joined: Sun Jan 02, 2011 4:11 pm

Re: Rohan Online: GMF Models

Post by ghoul »

First you need to download Program Dev C++ from internet, use google. Install it and run. Then choose: File -> New-> Source Code.
Copy this

Code: Select all

#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <tchar.h>
#include <stdlib.h>
#include <stdio.h>
#include <string>

struct GELHeader
{
   int i1;
   int i2;
   int numberOfElements;
   int i4;
   int i5;
   int i6;

   void print()
   {
      //printf( "i1 = %d\n", i1 );
      //printf( "i2 = %d\n", i2 );
      printf( "numberOfElements = %d\n", numberOfElements );
      //printf( "i4 = %d\n", i4 );
      //printf( "i5 = %d\n", i5 );
      //printf( "i6 = %d\n", i6 );
      printf( "\n" );
   }
};

struct GELEntry
{
   int i1;
   int i2;
   char filename[128];
   int i3;
   int startOffset;
   int dataSize;
   int i6;

   void print()
   {
      //printf( "i1 = %d\n", i1 );
      //printf( "i2 = %d\n", i2 );
      printf( "filename = %s\n", filename );
      //printf( "i3 = %d\n", i3 );
      printf( "startOffset = %d\n", startOffset );
      printf( "dataSize = %d\n", dataSize );
      //printf( "i6 = %d\n", i6 );
      printf( "\n" );
   }
};

// Set this to the .GEL file that you want to extract
std::string srcGel = "F:\\Paker\\animation.gel";
// Set this to the .GEM file that matches the .GEL file you want to extract
std::string srcGem = "F:\\Paker\\animation.gem";
// This is the path where all the files will be extracted to
std::string destPath = "F:\\Paker\\Animation\\";

int iiii = 0;
/*
char hextoascii(char a, char b)
{
char hex[5], *stopper;
hex[0] = '0';
hex[1] = 'x';
hex[2] = a;
hex[3] = b;
//hex[4] = '0';
return strtol(hex, &stopper, 16);

}
*/
int main()
{
   FILE* gelFP;
   gelFP = fopen(srcGel.c_str(), "rb" );

   if( gelFP )
   {
      FILE* gemFP;
      gemFP = fopen(srcGem.c_str(), "rb" );

      if( gemFP )
      {
         GELHeader gelHeader;
         fread( &gelHeader, sizeof( GELHeader ), 1, gelFP );
         //gelHeader.print();
        printf("Extracting Files: \n");
         for( int i=0; i<gelHeader.numberOfElements; i++ )
         {
            GELEntry gelEntry;
            fread( &gelEntry, sizeof( GELEntry ), 1, gelFP );
            //gelEntry.print();
            printf( "\b\b\b\b\b\b\b%d", i + 1 );

            if( gelEntry.dataSize > 0 )
            {
               // Create the file
               std::string sFilename = gelEntry.filename;
               size_t pos = sFilename.find_last_of( "\\" );

               std::string path = sFilename.substr( 0, pos + 1 );
               std::string filename = sFilename.substr( pos + 1, sFilename.length() - pos );
               //printf( "Path = %s\nFile = %s\n", path.c_str(), filename.c_str() );

               std::string newPath = destPath;
               newPath.append( path );
               CreateDirectory( newPath.c_str(), NULL );

               // Detect GTX files (DDS files with the header changed and the extension changed
               pos = filename.find_last_of( "." );
               //printf( "pos = %d\n", pos );
               std::string ext = filename.substr( pos + 1, filename.length() - pos - 1 );
               //printf( "ext = %s\n", ext.c_str() );

               if( ext.find( "gtx" ) != std::string::npos )
               {
                  //printf( "Found GTX file!\n" );
                  char* data = (char*)malloc( gelEntry.dataSize );
                  fseek( gemFP, gelEntry.startOffset, 0 );
                  fread( data, gelEntry.dataSize, 1, gemFP );
                  printf("%d",gelEntry.startOffset);
                  if( data[0] == 'G' && data[1] == 'E' && data[2] == 'O' )
                  {
                     // Most gtx files are DDS files with the "Magic Word" changed to GEO.  We change that here, before
                     // writing the file
                     filename.replace( pos + 1, 3, "tga" );
                     std::string fullPath = newPath;
                     fullPath.append( "\\" );
                     fullPath.append( filename );
                     //data[0] = hextoascii('0','0');
                     //data[1] = hextoascii('0','0');
                     //data[2] = hextoascii('0','a');
                     //data[0] = NULL;
                     //data[1] = NULL;
                     //data[2] = NULL;


                     FILE* outFP;
                     outFP = fopen(fullPath.c_str(), "wb" );
                     if( outFP )
                     {
                        fwrite( data, gelEntry.dataSize, 1, outFP );
                        fclose( outFP );
                     }
                  }
                  else if( data[0] == 'D' && data[1] == 'D' && data[2] == 'S' )
                  {
                     // Sometimes, DDS files have the proper header in them
                     filename.replace( pos + 1, 3, "dds" );
                     std::string fullPath = newPath;
                     fullPath.append( "\\" );
                     fullPath.append( filename );

                     FILE* outFP;
                     outFP = fopen(fullPath.c_str(), "wb" );
                     if( outFP )
                     {
                        fwrite( data, gelEntry.dataSize, 1, outFP );
                        fclose( outFP );
                     }
                  }
                  else
                  {

                     // Haven't come across this yet, but just in case, we'll know.
                     printf( "\n" );
                     printf( "Encountered UNKNOWN GTX file!\n" );
                     printf( "%c %c %c\n", data[0], data[1], data[2] );
                     printf( "\n" );
                  }

                  free( data );
               }
               else
               {
                  std::string fullPath = newPath;
                  fullPath.append( "\\" );
                  fullPath.append( filename );

                  FILE* outFP;
                  outFP = fopen(fullPath.c_str(), "wb" );
                  if( outFP )
                  {
                     void* data = malloc( gelEntry.dataSize );
                     fseek( gemFP, gelEntry.startOffset, 0 );
                     fread( data, gelEntry.dataSize, 1, gemFP );
                     fwrite( data, gelEntry.dataSize, 1, outFP );
                     free( data );
                     fclose( outFP );
                  }
               }
            }
         }

         printf( "\n\nProcess Completed\n\n" );
         fclose( gemFP );
      }

      fclose( gelFP );
   }

   return 0;
}
And paste it to Dev C++.

Code: Select all

// Set this to the .GEL file that you want to extract
std::string srcGel = "F:\\Paker\\animation.gel";
// Set this to the .GEM file that matches the .GEL file you want to extract
std::string srcGem = "F:\\Paker\\animation.gem";
// This is the path where all the files will be extracted to
std::string destPath = "F:\\Paker\\Animation\\";
This is part of code you should edit to your own. Then Compile and run.
User avatar
Rimbros
ultra-veteran
ultra-veteran
Posts: 495
Joined: Fri Jul 09, 2010 12:23 am
Has thanked: 41 times
Been thanked: 16 times

Re: Rohan Online: GMF Models

Post by Rimbros »

Thanks goul, this its very usefull.
Renders Art by Rimbros
http://s303.photobucket.com/albums/nn12 ... E/Renders/

Personal Game repository samples, send PM
User avatar
Rimbros
ultra-veteran
ultra-veteran
Posts: 495
Joined: Fri Jul 09, 2010 12:23 am
Has thanked: 41 times
Been thanked: 16 times

Re: Rohan Online: GMF Models

Post by Rimbros »

Well this its the end of the way, a friend send me to this forum to investigate this, take a look i see more advances of Rohan extraction models
LINK
http://shader.tistory.com/category/%EA% ... me%20Model
Image
Image

LINK
http://shader.tistory.com/category/%EA% ... x%20Script

Image

Bad very Bad i not found the scrip to import the files inside of max, if you found please share.

I think this man its fatduck but now he its called MrShaderKr

I see something offsets can be readed maybe its posible found this and make a script for max from the trash. MarioKart its expert in maxscripts he make a guide.
Renders Art by Rimbros
http://s303.photobucket.com/albums/nn12 ... E/Renders/

Personal Game repository samples, send PM
ghoul
ultra-n00b
Posts: 5
Joined: Sun Jan 02, 2011 4:11 pm

Re: Rohan Online: GMF Models

Post by ghoul »

It's a dead end...
deadlydata
ultra-n00b
Posts: 6
Joined: Wed Aug 02, 2006 12:48 am

Re: Rohan Online: GMF Models

Post by deadlydata »

Code: Select all

struct GELHeader
{
	int m_ID;
	int m_Version;
	int m_MaxAllocFileNum;
	int m_MissingFileSize;
	int m_Reserved;
	int m_Reserved1;
};

Code: Select all

struct GELEntry
{
	int m_Index;
	int m_FullIndex;
	char m_FileName[128];
	int m_TablePos;
	int m_DataPos;
	int m_DataSize;
	int m_Reserved;

};

Code: Select all

int __cdecl GOpenArchive(const char *szGemName, unsigned int dwFlags, void **phGEM, bool usememorymap)
{
  DWORD v4; // ebp@1
  int v5; // eax@1
  char *v6; // eax@5
  const char *v7; // eax@6
  HANDLE v8; // ebx@8
  void *v9; // esi@12
  char *v10; // eax@14
  int v11; // edx@16
  char v12; // cl@17
  size_t v13; // eax@18
  const char *v14; // ecx@18
  void *v15; // eax@21
  int v16; // eax@22
  void *v17; // eax@26
  int v18; // eax@27
  int result; // eax@46
  void *ha; // [sp+0h] [bp-3Ch]@1
  void **v21; // [sp+4h] [bp-38h]@1
  void *v22; // [sp+8h] [bp-34h]@21
  int dwTransferred; // [sp+Ch] [bp-30h]@32
  std::basic_string<char,std::char_traits<char>,std::allocator<char> > lowername; // [sp+10h] [bp-2Ch]@5
  unsigned int v25; // [sp+2Ch] [bp-10h]@1
  int v26; // [sp+30h] [bp-Ch]@1
  int (*v27)(); // [sp+34h] [bp-8h]@1
  int v28; // [sp+38h] [bp-4h]@1

  v28 = -1;
  v27 = _ehhandler__GOpenArchive;
  v26 = v5;
  v25 = (unsigned int)&ha ^ __security_cookie;
  v4 = 0;
  v21 = phGEM;
  ha = 0;
  if ( !szGemName || !*szGemName || !phGEM )
    v4 = 87;
  v6 = strlwr((char *)szGemName);
  lowername._Myres = 15;
  lowername._Mysize = 0;
  lowername._Bx._Buf[0] = 0;
  std__basic_string_char_std__char_traits_char__std__allocator_char____assign(&lowername, v6, strlen(v6));
  v28 = 0;
  if ( !v4 )
  {
    v7 = *(const char **)&lowername._Bx._Buf[0];
    if ( lowername._Myres < 0x10 )
      v7 = (const char *)&lowername._Bx;
    v8 = CreateFileA(v7, dwFlags, 1u, 0, 3u, 0, 0);
    if ( v8 == (HANDLE)-1 )
    {
      GetLastError();
      if ( lowername._Myres >= 0x10 )
        operator delete(*(void **)&lowername._Bx._Buf[0]);
      goto LABEL_46;
    }
    v9 = malloc(0x240u);
    ha = v9;
    if ( v9 )
    {
      memset(v9, 0, 0x240u);
      v10 = *(char **)&lowername._Bx._Buf[0];
      if ( lowername._Myres < 0x10 )
        v10 = (char *)&lowername._Bx;
      v11 = (int)(v10 + 1);
      do
        v12 = *v10++;
      while ( v12 );
      v14 = *(const char **)&lowername._Bx._Buf[0];
      v13 = (size_t)&v10[-v11];
      if ( lowername._Myres < 0x10 )
        v14 = (const char *)&lowername._Bx;
      strncpy((char *)v9, v14, v13);
      *((_DWORD *)v9 + 65) = v8;
      if ( !*((_DWORD *)v9 + 142) )
      {
        v15 = operator new(0x10u);
        v22 = v15;
        LOBYTE(v28) = 1;
        if ( v15 )
          CFileTableListManager__CFileTableListManager((CFileTableListManager *)v15);
        else
          v16 = 0;
        LOBYTE(v28) = 0;
        *((_DWORD *)v9 + 142) = v16;
      }
      if ( !*((_DWORD *)v9 + 143) )
      {
        v17 = operator new(0x600u);
        v22 = v17;
        LOBYTE(v28) = 2;
        if ( v17 )
          CHashFileTableManager__CHashFileTableManager((CHashFileTableManager *)v17);
        else
          v18 = 0;
        LOBYTE(v28) = 0;
        *((_DWORD *)v9 + 143) = v18;
      }
      *((_BYTE *)v9 + 560) = usememorymap;
      if ( SetFilePointer(*((HANDLE *)v9 + 65), 0, 0, 0) != -1 || (v4 = GetLastError(), !v4) )
      {
        if ( ReadFile(*((HANDLE *)v9 + 65), (char *)v9 + 264, 8u, (LPDWORD)&dwTransferred, 0)
          || (v4 = GetLastError(), !v4) )
        {
          if ( dwTransferred != 8 )
          {
            v4 = 11;
            SetLastError(0xBu);
          }
          if ( *((CWorldMgr **)v9 + 66) == (CWorldMgr *)((char *)&g_WorldManager.m_world[5].m_heightMap[102512] + 1) )
          {
            if ( !v4 )
            {
              v4 = GOpenListFile((GemArchive *)v9, dwFlags);
              if ( !v4 )
                goto LABEL_41;
            }
          }
          else
          {
            v4 = 11;
            SetLastError(0xBu);
          }
        }
      }
    }
    else
    {
      v4 = 8;
    }
  }
  FreeGemArchive((GemArchive **)&ha);
  SetLastError(v4);
  v9 = ha;
LABEL_41:
  *v21 = v9;
  if ( !v4 )
  {
    if ( usememorymap )
      *((_DWORD *)v9 + 141) = CreateFileMappingA(
                                *((HANDLE *)v9 + 65),
                                (LPSECURITY_ATTRIBUTES)v4,
                                2u,
                                v4,
                                v4,
                                (LPCSTR)v4);
  }
  if ( lowername._Myres >= 0x10 )
    operator delete(*(void **)&lowername._Bx._Buf[0]);
LABEL_46:
  __security_check_cookie((unsigned int)&ha ^ v25);
  return result;
}

Code: Select all

int __cdecl GOpenListFile(GemArchive *ha, unsigned int dwFlags)
{
  int v2; // eax@1
  DWORD v3; // ebx@1
  char v4; // cl@2
  HANDLE v5; // edi@3
  int result; // eax@16
  unsigned int v7; // ebp@18
  void *v8; // edi@19
  int dwTransferred; // [sp+0h] [bp-8B4h]@1
  char *v10; // [sp+4h] [bp-8B0h]@3
  std::basic_string<char,std::char_traits<char>,std::allocator<char> > name; // [sp+8h] [bp-8ACh]@1
  char filetitle[64]; // [sp+24h] [bp-890h]@1
  char drive[64]; // [sp+64h] [bp-850h]@1
  char dir[1024]; // [sp+A4h] [bp-810h]@1
  char string; // [sp+4A4h] [bp-410h]@24
  unsigned int v16; // [sp+8A4h] [bp-10h]@1
  int v17; // [sp+8B0h] [bp-4h]@1

  v3 = 0;
  v16 = (unsigned int)&dwTransferred ^ __security_cookie;
  name._Myres = 15;
  name._Mysize = 0;
  name._Bx._Buf[0] = 0;
  v17 = 0;
  _splitpath(ha->szGemFileName, drive, dir, filetitle, 0);
  v2 = (int)filetitle;
  do
    v4 = *(_BYTE *)v2++;
  while ( v4 );
  std__basic_string_char_std__char_traits_char__std__allocator_char____assign(
    &name,
    filetitle,
    v2 - (_DWORD)&filetitle[1]);
  std__basic_string_char_std__char_traits_char__std__allocator_char____append(&name, ".gel", 4u);
  v10 = ha->szGelFileName;
  sprintf(ha->szGelFileName, "%s%s%s");
  v5 = CreateFileA(ha->szGelFileName, dwFlags, 1u, 0, 3u, 0, 0);
  if ( v5 != (HANDLE)-1 || (v3 = GetLastError(), !v3) )
  {
    if ( SetFilePointer(v5, 0, 0, 0) != -1 || (v3 = GetLastError(), !v3) )
    {
      ha->hGelFile = v5;
      if ( ReadFile(v5, &ha->m_GelHeader, 0x18u, (LPDWORD)&dwTransferred, 0) || (v3 = GetLastError(), !v3) )
      {
        if ( dwTransferred != 24 )
          v3 = 11;
        if ( ha->m_GelHeader.m_ID != 269488144 )
          v3 = 11;
        if ( ha->m_GelHeader.m_Version == ha->m_GemHeader.m_Version )
        {
          if ( !v3 )
          {
            v7 = 0;
            if ( ha->m_GelHeader.m_MaxAllocFileNum )
            {
              do
              {
                v8 = malloc(0x98u);
                if ( !ReadFile(ha->hGelFile, v8, 0x98u, (LPDWORD)&dwTransferred, 0) )
                {
                  GetLastError();
                  _snprintf(&string, 0x400u, "error: %d file: %s");
                  MessageBoxA(0, "open gel file failed", "error", 0);
                  ExitProcess(0);
                }
                CFileTableListManager__Add(ha->m_TableManager, (GelFileTable *)v8);
                if ( *((_DWORD *)v8 + 36) != -1 )
                  CHashFileTableManager__Add(ha->m_HashManager, (GelFileTable *)v8);
                ++v7;
              }
              while ( v7 < ha->m_GelHeader.m_MaxAllocFileNum );
            }
          }
        }
      }
    }
  }
  if ( name._Myres >= 0x10 )
    operator delete(*(void **)&name._Bx._Buf[0]);
  __security_check_cookie((unsigned int)&dwTransferred ^ v16);
  return result;
}

Code: Select all

bool __cdecl GReadFile(void *hFile, void *lpBuffer, unsigned int dwToRead, unsigned int *pdwRead)
{
  unsigned int *v4; // eax@1
  DWORD v5; // esi@1
  int v6; // eax@1
  int v7; // edi@7
  unsigned int v8; // eax@8
  int v9; // edx@8
  int v10; // esi@8
  int v11; // edi@13
  unsigned int v12; // eax@16
  int v13; // ecx@16
  bool result; // al@20
  char v15; // [sp-Ch] [bp-28h]@1
  unsigned int dwBytes; // [sp+0h] [bp-1Ch]@1
  char *v17; // [sp+4h] [bp-18h]@1
  int v18; // [sp+Ch] [bp-10h]@1
  int (__cdecl *v19)(int, _EH3_EXCEPTION_REGISTRATION *, int); // [sp+10h] [bp-Ch]@1
  int v20; // [sp+14h] [bp-8h]@1
  int v21; // [sp+18h] [bp-4h]@1

  v21 = -1;
  v20 = (int)dword_6F08C0;
  v19 = _except_handler3;
  v18 = v6;
  v17 = &v15;
  dwBytes = 0;
  v5 = 0;
  v4 = pdwRead;
  if ( pdwRead )
    *pdwRead = 0;
  if ( !hFile || !lpBuffer )
    v5 = 87;
  if ( !v5 )
  {
    v7 = *((_DWORD *)hFile + 1);
    if ( v7 )
    {
      v10 = *((_DWORD *)hFile + 2);
      v8 = *(_DWORD *)(*((_DWORD *)hFile + 4) + 144);
      v9 = dwToRead;
      if ( v8 < v10 + dwToRead )
        v9 = v8 - v10;
      memcpy(lpBuffer, (const void *)(v7 + v10), v9);
      v21 = -1;
      *((_DWORD *)hFile + 2) += v9;
      if ( pdwRead )
        *pdwRead = v9;
      dwBytes = v9;
      goto LABEL_27;
    }
    v11 = dwToRead;
    if ( dwToRead )
    {
      if ( SetFilePointer(
             *(HANDLE *)(*((_DWORD *)hFile + 3) + 260),
             *((_DWORD *)hFile + 2) + *(_DWORD *)(*((_DWORD *)hFile + 4) + 140),
             0,
             0) == -1 )
        v5 = GetLastError();
      v13 = *((_DWORD *)hFile + 2);
      v12 = *(_DWORD *)(*((_DWORD *)hFile + 4) + 144);
      if ( v13 + dwToRead > v12 )
      {
        dwToRead = v12 - v13;
        v11 = v12 - v13;
      }
      if ( !v5 )
      {
        if ( !GeoReadFileTry(*(void **)(*((_DWORD *)hFile + 3) + 260), lpBuffer, v11, &dwBytes) )
        {
          GetLastError();
          return 0;
        }
        if ( dwBytes == -1 )
        {
          SetLastError(0x3EBu);
          return 0;
        }
      }
      *((_DWORD *)hFile + 2) += dwBytes;
      v4 = pdwRead;
    }
    if ( v4 )
      *v4 = dwBytes;
  }
  v9 = dwToRead;
LABEL_27:
  if ( dwBytes >= v9 )
  {
    result = 1;
  }
  else
  {
    SetLastError(0x26u);
    result = 0;
  }
  return result;
}

Code: Select all

void *__thiscall CGemManager__OpenFileForRead(CGemManager *this, std::basic_string<char,std::char_traits<char>,std::allocator<char> > *name)
{
  char *v2; // eax@1
  CGemManager *v3; // edi@1
  int v4; // eax@1
  void *v5; // eax@3
  char *v6; // esi@3
  void *v7; // esi@4
  const char *v8; // eax@9
  _iobuf *v9; // eax@11
  const char *v10; // eax@28
  void *result; // eax@42
  std::basic_string<char,std::char_traits<char>,std::allocator<char> > lowername; // [sp+0h] [bp-48h]@1
  std::basic_string<char,std::char_traits<char>,std::allocator<char> > tempstring; // [sp+1Ch] [bp-2Ch]@1
  unsigned int v14; // [sp+38h] [bp-10h]@1
  int v15; // [sp+3Ch] [bp-Ch]@1
  int (*v16)(); // [sp+40h] [bp-8h]@1
  int v17; // [sp+44h] [bp-4h]@1

  v17 = -1;
  v16 = _ehhandler__OpenFileForRead;
  v15 = v4;
  v14 = (unsigned int)&lowername ^ __security_cookie;
  v3 = this;
  tempstring._Myres = 15;
  tempstring._Mysize = 0;
  tempstring._Bx._Buf[0] = 0;
  std__basic_string_char_std__char_traits_char__std__allocator_char____assign(&tempstring, name, 0, 0xFFFFFFFFu);
  v2 = *(char **)&tempstring._Bx._Buf[0];
  v17 = 0;
  if ( tempstring._Myres < 0x10 )
    v2 = (char *)&tempstring._Bx;
  v6 = strlwr(v2);
  lowername._Myres = 15;
  lowername._Mysize = 0;
  lowername._Bx._Buf[0] = 0;
  std__basic_string_char_std__char_traits_char__std__allocator_char____assign(&lowername, v6, strlen(v6));
  LOBYTE(v17) = 1;
  v5 = operator new(0x2Cu);
  if ( v5 )
  {
    *((_DWORD *)v5 + 8) = 15;
    *((_DWORD *)v5 + 7) = 0;
    *((_BYTE *)v5 + 12) = 0;
    *((_DWORD *)v5 + 10) = 0;
    *(_DWORD *)v5 = 0;
    *((_DWORD *)v5 + 9) = 0;
    *((_BYTE *)v5 + 4) = 0;
    v7 = v5;
  }
  else
  {
    v7 = 0;
  }
  if ( v3->m_UseGemFile )
  {
    if ( !CGemManager__CheckUsePackAndLock(v3, &lowername, (MultiFilePointer *)v7) )
    {
      if ( v7 )
      {
        if ( *((_DWORD *)v7 + 8) >= 0x10u )
          operator delete(*((void **)v7 + 3));
        *((_DWORD *)v7 + 8) = 15;
        *((_DWORD *)v7 + 7) = 0;
        *((_BYTE *)v7 + 12) = 0;
        operator delete(v7);
      }
      if ( lowername._Myres >= 0x10 )
        operator delete(*(void **)&lowername._Bx._Buf[0]);
      lowername._Myres = 15;
      lowername._Mysize = 0;
      lowername._Bx._Buf[0] = 0;
      if ( tempstring._Myres >= 0x10 )
        operator delete(*(void **)&tempstring._Bx._Buf[0]);
      goto LABEL_42;
    }
  }
  else
  {
    *((_BYTE *)v7 + 4) = 0;
  }
  if ( !*((_BYTE *)v7 + 4) )
  {
    v8 = *(const char **)&lowername._Bx._Buf[0];
    if ( lowername._Myres < 0x10 )
      v8 = (const char *)&lowername._Bx;
    v9 = fopen(v8, "rb");
    *(_DWORD *)v7 = v9;
    if ( !v9 )
    {
      if ( *((_DWORD *)v7 + 8) >= 0x10u )
        operator delete(*((void **)v7 + 3));
      *((_DWORD *)v7 + 8) = 15;
      *((_DWORD *)v7 + 7) = 0;
      *((_BYTE *)v7 + 12) = 0;
      operator delete(v7);
      if ( lowername._Myres >= 0x10 )
        operator delete(*(void **)&lowername._Bx._Buf[0]);
      lowername._Myres = 15;
      lowername._Mysize = 0;
      lowername._Bx._Buf[0] = 0;
      if ( tempstring._Myres >= 0x10 )
        operator delete(*(void **)&tempstring._Bx._Buf[0]);
      goto LABEL_42;
    }
    goto LABEL_38;
  }
  if ( *((_DWORD *)v7 + 8) < 0x10u )
    v10 = (char *)v7 + 12;
  else
    v10 = (const char *)*((_DWORD *)v7 + 3);
  GOpenFileForReading(*((void **)v7 + 9), v10, (void **)v7);
  if ( *(_DWORD *)v7 )
  {
LABEL_38:
    if ( lowername._Myres >= 0x10 )
      operator delete(*(void **)&lowername._Bx._Buf[0]);
    lowername._Myres = 15;
    lowername._Mysize = 0;
    lowername._Bx._Buf[0] = 0;
    if ( tempstring._Myres >= 0x10 )
      operator delete(*(void **)&tempstring._Bx._Buf[0]);
    goto LABEL_42;
  }
  EnterCriticalSection(&v3->m_cs);
  --*(_DWORD *)(*((_DWORD *)v7 + 10) + 64);
  LeaveCriticalSection(&v3->m_cs);
  if ( *((_DWORD *)v7 + 8) >= 0x10u )
    operator delete(*((void **)v7 + 3));
  *((_DWORD *)v7 + 8) = 15;
  *((_DWORD *)v7 + 7) = 0;
  *((_BYTE *)v7 + 12) = 0;
  operator delete(v7);
  if ( lowername._Myres >= 0x10 )
    operator delete(*(void **)&lowername._Bx._Buf[0]);
  lowername._Myres = 15;
  lowername._Mysize = 0;
  lowername._Bx._Buf[0] = 0;
  if ( tempstring._Myres >= 0x10 )
    operator delete(*(void **)&tempstring._Bx._Buf[0]);
LABEL_42:
  __security_check_cookie((unsigned int)&lowername ^ v14);
  return result;
}

Code: Select all

int __cdecl GOpenFileForReading(void *hGEM, const char *szFileName, void **phFile)
{
  void *v3; // esi@1
  int v4; // eax@1
  DWORD v5; // edi@3
  char *v6; // eax@3
  const char *v7; // eax@4
  GelFileTable *v8; // eax@6
  unsigned int v9; // ebp@12
  LPVOID v10; // eax@14
  int v11; // ebp@14
  int v12; // edi@14
  DWORD v13; // eax@14
  int result; // eax@19
  DWORD nError; // [sp+0h] [bp-5Ch]@1
  void *hf; // [sp+4h] [bp-58h]@1
  void **v17; // [sp+8h] [bp-54h]@1
  _SYSTEM_INFO systeminfo; // [sp+Ch] [bp-50h]@13
  std::basic_string<char,std::char_traits<char>,std::allocator<char> > lowername; // [sp+30h] [bp-2Ch]@3
  unsigned int v20; // [sp+4Ch] [bp-10h]@1
  int v21; // [sp+50h] [bp-Ch]@1
  int (*v22)(); // [sp+54h] [bp-8h]@1
  int v23; // [sp+58h] [bp-4h]@1

  v23 = -1;
  v22 = _ehhandler__GOpenFileForReading;
  v21 = v4;
  v20 = (unsigned int)&nError ^ __security_cookie;
  v17 = phFile;
  nError = 0;
  v3 = malloc(0x14u);
  hf = v3;
  if ( !v3 )
    nError = 8;
  v6 = strlwr((char *)szFileName);
  lowername._Myres = 15;
  lowername._Mysize = 0;
  lowername._Bx._Buf[0] = 0;
  std__basic_string_char_std__char_traits_char__std__allocator_char____assign(&lowername, v6, strlen(v6));
  v5 = nError;
  v23 = 0;
  if ( nError )
    goto LABEL_8;
  *(_DWORD *)v3 = 0;
  *((_DWORD *)v3 + 1) = 0;
  *((_DWORD *)v3 + 2) = 0;
  *((_DWORD *)v3 + 3) = 0;
  *((_DWORD *)v3 + 4) = 0;
  *((_DWORD *)v3 + 3) = hGEM;
  v7 = *(const char **)&lowername._Bx._Buf[0];
  if ( lowername._Myres < 0x10 )
    v7 = (const char *)&lowername._Bx;
  v8 = CHashFileTableManager__Get(*((CHashFileTableManager **)hGEM + 143), v7);
  *((_DWORD *)v3 + 4) = v8;
  if ( !v8 )
  {
    nError = 2;
    v5 = 2;
LABEL_8:
    FreeGemFile((GemFile **)&hf);
    SetLastError(v5);
    v3 = hf;
  }
  *v17 = v3;
  if ( !v5 && *((_BYTE *)hGEM + 560) && *((_DWORD *)hGEM + 141) )
  {
    v9 = granularity;
    if ( !granularity )
    {
      GetSystemInfo(&systeminfo);
      v9 = systeminfo.dwAllocationGranularity;
      granularity = systeminfo.dwAllocationGranularity;
    }
    v12 = *((_DWORD *)v3 + 4);
    v13 = v9 * *(_DWORD *)(v12 + 140) / v9;
    v11 = *(_DWORD *)(v12 + 140) - v13;
    v10 = MapViewOfFile(*((HANDLE *)hGEM + 141), 4u, 0, v13, v11 + *(_DWORD *)(v12 + 144));
    *(_DWORD *)v3 = v10;
    if ( !v10 )
    {
      std__basic_string_char_std__char_traits_char__std__allocator_char_____basic_string_char_std__char_traits_char__std__allocator_char__(&lowername);
      goto LABEL_19;
    }
    *((_DWORD *)v3 + 1) = (char *)v10 + v11;
  }
  if ( lowername._Myres >= 0x10 )
    operator delete(*(void **)&lowername._Bx._Buf[0]);
LABEL_19:
  __security_check_cookie((unsigned int)&nError ^ v20);
  return result;
}

Tadur
ultra-n00b
Posts: 3
Joined: Mon Feb 14, 2011 5:31 pm

Re: Rohan Online: GMF Models

Post by Tadur »

Where u enter this Code ?
What Program u use for this Code ?
What are the filenames ?
User avatar
Rimbros
ultra-veteran
ultra-veteran
Posts: 495
Joined: Fri Jul 09, 2010 12:23 am
Has thanked: 41 times
Been thanked: 16 times

Re: Rohan Online: GMF Models

Post by Rimbros »

I like the tutorial how to use this codes... thanks deadlydata by the explanation.
Renders Art by Rimbros
http://s303.photobucket.com/albums/nn12 ... E/Renders/

Personal Game repository samples, send PM
Tadur
ultra-n00b
Posts: 3
Joined: Mon Feb 14, 2011 5:31 pm

Re: Rohan Online: GMF Models

Post by Tadur »

Can u pls send me the guide how to use this code ?
Szkaradek123
mega-veteran
mega-veteran
Posts: 292
Joined: Wed May 05, 2010 8:21 pm
Location: Poland Głogów
Has thanked: 21 times
Been thanked: 742 times

Re: Rohan Online: GMF Models

Post by Szkaradek123 »

The contents of this post was deleted because of possible forum rules violation.
You do not have the required permissions to view the files attached to this post.
User avatar
Rimbros
ultra-veteran
ultra-veteran
Posts: 495
Joined: Fri Jul 09, 2010 12:23 am
Has thanked: 41 times
Been thanked: 16 times

Re: Rohan Online: GMF Models

Post by Rimbros »

JAJAJAJAJAJA Its this a jocke man?, thousands of treads in forums, and lots of experts asking abouth this, and you make the script for blender in a few days :eek: , where are you? from other planet or something?... RESPECT x 10000000000 for you.
Renders Art by Rimbros
http://s303.photobucket.com/albums/nn12 ... E/Renders/

Personal Game repository samples, send PM
Post Reply