Quality Software Solutions
  • Specializing in professional hex editor tools,
    including disk editing and process editing.





010 Editor - Hex Editor Homepage


The following is a list of string functions that can be used when writing Templates or Scripts.

double Atof( const char s[] )
Converts a string to a floating-point number. Returns zero on error.

int Atoi( const char s[] )
Converts a string to an integer. Returns zero on error.

string DosDateToString( DOSDATE d )
Converts the given DOSDATE into a string and returns the results. The date will be in the format 'MM/DD/YYYY'. Click here for more information on the DOSDATE type and see the FileTimeToString function for an example of using SScanf to parse the resulting string.

string DosTimeToString( DOSTIME t )
Converts the given DOSTIME into a string and returns the results. The time will be in the format 'HH:MM:SS'. Click here for more information on the DOSTIME type and see the FileTimeToString function for an example of using SScanf to parse the resulting string.

string EnumToString( enum e )
If the given variable e is an enum, the value is converted into the string which represents that enum value and returned. The enum may be a constant or an enum variable. For example:

    enum { FIRST, SECOND, THIRD } value;
    string s1, s2;
    value = SECOND;
    s1 = EnumToString( THIRD ); //s1 = "THIRD"
    s2 = EnumToString( value ); //s2 = "SECOND"
Note that if e is a valid enum but no string corresponds to that enum value, an empty string is returned.

string FileTimeToString( FILETIME ft )
Converts the given FILETIME into a string and returns the results. The time will be in the format 'MM/DD/YYYY HH:NN:SS'. Click here for more information on the FILETIME type. The resulting string can be separated into parts using the SScanf function. For example:

    int hour, minute, second, day, month, year;
    string s = FileTimeToString( ft );
    SScanf( s, "%02d/%02d/%04d %02d:%02d:%02d", 
        month, day, year, hour, minute, second );
    year++;
    SPrintf( s, "%02d/%02d/%04d %02d:%02d:%02d", 
        month, day, year, hour, minute, second );

int Memcmp( const uchar s1[], const uchar s2[], int n )
Compares the first n bytes of s1 and s2. Returns a value less than zero if s1 is less than s2, zero if they are equal, or a value greater than zero if s1 is greater than s2.

void Memcpy( uchar dest[], const uchar src[], int n )
Copies a block of n bytes from src to dest.

void Memset( uchar s[], int c, int n)
Sets the first n bytes of s to the byte c.

string OleTimeToString( OLETIME ot )
Converts the given OLETIME into a string and returns the results. The time will be in the format 'MM/DD/YYYY HH:NN:SS'. Click here for more information on the OLETIME type and see the FileTimeToString function for an example of using SScanf to parse the resulting string.

int SPrintf( char buffer[], const char format[] [, argument, ... ] )
Performs a Printf starting from format and places the result into buffer. See Printf for more information.

int SScanf( char str[], char format[], ... )
This function parses the str parameter into a number of variables according to the format string. The format string uses the same specifiers as the Printf function. Following the format must be a list of arguments, one for each format specifier in the format string. Note that unlike the regular C function, do not use '&' for each argument. For example:

    int a, b;
    SScanf( "34, 62", "%d, %d", a, b );

would read the value 34 and 62 into a and b. The return value will be the number of successfully read arguments (in this example the return value would be 2).

void Strcat( char dest[], const char src[] )
Appends the characters from src to the end of the string dest. The string may be resized if necessary. The += operator can also be used for a similar result.

int Strchr( const char s[], char c )
Scans the string s for the first occurrence of the character c. Returns the index of the match, or -1 if no characters match.

int Strcmp( const char s1[], const char s2[] )
Compares the one string to another. Returns a value less than zero if s1 is less than s2, zero if they are equal, or a value greater than zero if s1 is greater than s2.

void Strcpy( char dest[], const char src[] )
Copies string src, to string dest, stopping when the null-character has been copied.

char[] StrDel( const char str[], int start, int count )
Removes count characters from str starting at the index start and returns the resulting string.

int Stricmp( const char s1[], const char s2[] )
Identical to Strcmp except the strings are compared without case sensitivity.

int StringToDosDate( string s, DOSDATE &d )
Converts the given string into a DOSDATE and stores the results in d. The string should be in the format 'MM/DD/YYYY'. This function returns true if it succeeds. More information on date types is available here.

int StringToDosTime( string s, DOSTIME &t )
Converts the given string into a DOSTIME and stores the results in t. The string should be in the format 'HH:MM:SS'. This function returns true if it succeeds. More information on date types is available here.

int StringToFileTime( string s, FILETIME &ft )
Converts the given string into a FILETIME and stores the results in ft. The string should be in the format 'MM/DD/YYYY HH:NN:SS'. This function returns true if it succeeds. More information on date types is available here.

int StringToOleTime( string s, OLETIME &ot )
Converts the given string into an OLETIME and stores the results in ot. The string should be in the format 'MM/DD/YYYY HH:NN:SS'. This function returns true if it succeeds. More information on date types is available here.

int StringToTimeT( string s, time_t &t )
Converts the given string into a time_t and stores the results in t. The string should be in the format 'MM/DD/YYYY HH:NN:SS'. This function returns true if it succeeds. More information on date types is available here.

int Strlen( const char s[] )
Returns the number of characters in s before the null-character.

int Strncmp( const char s1[], const char s2[], int n )
Similar to Strcmp, except that no more than n characters are compared.

int Strncpy( char dest[], const char src[], int n )
Similar to Strcpy, except that at most n characters will be copied.

int Strnicmp( const char s1[], const char s2[], int n )
Similar to Strcmp except that at most n characters are compared and the characters are compared without case sensitivity.

int Strstr( const char s1[], const char s2[] )
Scans the string s1 for the first occurrence of s2. Returns the index of the first matching character, or -1 if no match is found.

char[] SubStr( const char str[], int start, int count=0 )
Returns a string containing count characters from str starting at the index start. If count is zero, all the characters from the start index to the end of the string are returned.

string TimeTToString( time_t t )
Converts the given time_t into a string and returns the results. The time will be in the format 'MM/DD/YYYY HH:NN:SS'. Click here for more information on the time_t type and see the FileTimeToString function for an example of using SScanf to parse the resulting string.

















This is the manual for 010 Editor, a professional hex editor and binary file editor. Use 010 Editor to edit the individual bytes of any binary file, hard drive, or process on your machine. 010 Editor contains a whole host of powerful analysis and editing tools, plus Binary Templates technology that allows any binary format to be understood.






SweetScape Software
148 Pownal Rd. RR#1
Pownal, PEI
C0A 1Z0, Canada

E-mail: