Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


VS_VERSIONINFO

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
nwongfeiying
Grandmaster Cheater
Reputation: 2

Joined: 25 Jun 2007
Posts: 695

PostPosted: Mon Apr 20, 2009 8:25 am    Post subject: VS_VERSIONINFO Reply with quote

How do I apply those 'file description', 'file type', 'copyright', 'comment' to my executable? I've looked at VS_FIXEDINFO and VS_VERSIONINFO, but I didn't comprehend all of it.

The best way for me to learn is by a code example. Please help someone?
Back to top
View user's profile Send private message
Bizarro
I post too much
Reputation: 0

Joined: 01 May 2007
Posts: 2648

PostPosted: Mon Apr 20, 2009 9:02 am    Post subject: Reply with quote

u can simply add VS_version_info from resource assuming u are doing it in VSC++. and edit any version infomation you like there

i retrieve those info using following method

Code:

typedef struct FILEVERSION_INFOSTRUCT
{
   char * CompanyName;
   char * FileDescription;
   char * FileVersion;
   char * InternalName;
   char * LegalCopyright;
   char * OriginalFilename;
   char * ProductName;
   char * ProductVersion;
   char * Comments;
   char * LegalTrademarks;
   char * PrivateBuild;
   char * SpecialBuild;
   FILEVERSION_INFOSTRUCT()
   {
      CompanyName="";
      FileDescription="";
      FileVersion="";
      InternalName="";
      LegalCopyright="";
      OriginalFilename="";
      ProductName="";
      ProductVersion="";
      Comments="";
      LegalTrademarks="";
      PrivateBuild="";
      SpecialBuild="";
   }

}FILEVERSION_INFOSTRUCT;


   FILEVERSION_INFOSTRUCT* pVersion=new FILEVERSION_INFOSTRUCT;

   dwSize=GetFileVersionInfoSize(lpszFilePath,&dwNull);
   LPBYTE pData=new BYTE[dwSize];

           sprintf(sQuery,"\\StringFileInfo\\%04x%04x\\CompanyName",LOWORD(pLangs[0]),HIWORD(pLangs[0]));
         VerQueryValue(pData,TEXT(sQuery),(void **)&pVersion->CompanyName,&dwBytes);
         sprintf(sQuery,"\\StringFileInfo\\%04x%04x\\FileDescription",LOWORD(pLangs[0]),HIWORD(pLangs[0]));
         VerQueryValue(pData,TEXT(sQuery),(void**)&pVersion->FileDescription,&dwBytes);
         sprintf(sQuery,"\\StringFileInfo\\%04x%04x\\FileVersion",LOWORD(pLangs[0]),HIWORD(pLangs[0]));
         VerQueryValue(pData,TEXT(sQuery),(void**)&pVersion->FileVersion,&dwBytes);
         sprintf(sQuery,"\\StringFileInfo\\%04x%04x\\InternalName",LOWORD(pLangs[0]),HIWORD(pLangs[0]));
         VerQueryValue(pData,TEXT(sQuery),(void**)&pVersion->InternalName,&dwBytes);
         sprintf(sQuery,"\\StringFileInfo\\%04x%04x\\LegalCopyright",LOWORD(pLangs[0]),HIWORD(pLangs[0]));
         VerQueryValue(pData,TEXT(sQuery),(void**)&pVersion->LegalCopyright,&dwBytes);
         sprintf(sQuery,"\\StringFileInfo\\%04x%04x\\OriginalFilename",LOWORD(pLangs[0]),HIWORD(pLangs[0]));
         VerQueryValue(pData,TEXT(sQuery),(void**)&pVersion->OriginalFilename,&dwBytes);
         sprintf(sQuery,"\\StringFileInfo\\%04x%04x\\ProductName",LOWORD(pLangs[0]),HIWORD(pLangs[0]));
         VerQueryValue(pData,TEXT(sQuery),(void**)&pVersion->ProductName,&dwBytes);
         sprintf(sQuery,"\\StringFileInfo\\%04x%04x\\ProductVersion",LOWORD(pLangs[0]),HIWORD(pLangs[0]));
         VerQueryValue(pData,TEXT(sQuery),(void**)&pVersion->ProductVersion,&dwBytes);
         sprintf(sQuery,"\\StringFileInfo\\%04x%04x\\Comments",LOWORD(pLangs[0]),HIWORD(pLangs[0]));
         VerQueryValue(pData,TEXT(sQuery),(void**)&pVersion->Comments,&dwBytes);
         sprintf(sQuery,"\\StringFileInfo\\%04x%04x\\LegalTrademarks",LOWORD(pLangs[0]),HIWORD(pLangs[0]));
         VerQueryValue(pData,TEXT(sQuery),(void**)&pVersion->LegalTrademarks,&dwBytes);
         sprintf(sQuery,"\\StringFileInfo\\%04x%04x\\SpecialBuild",LOWORD(pLangs[0]),HIWORD(pLangs[0]));
         VerQueryValue(pData,TEXT(sQuery),(void**)&pVersion->SpecialBuild,&dwBytes);


std::string String_filedescription(pVersion->FileDescription);

so string String_filedescription contains the info you entered in FileDescription.

_________________

w8 baby.com Banner contest, Come join NOW!!
Check us out for Prize deatils
Back to top
View user's profile Send private message
nwongfeiying
Grandmaster Cheater
Reputation: 2

Joined: 25 Jun 2007
Posts: 695

PostPosted: Mon Apr 20, 2009 9:29 pm    Post subject: Reply with quote

What about writing the VS_VERSIONINFO for your own program?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites