strcmp

Description of the 'strcmp' function in HyperDbg Scripts

Function

strcmp

Syntax

strcmp( Str1, Str2 );

Parameters

[Str1]

A MASM-like expression or a string to compare with Str2.

[Str2]

A MASM-like expression or a string to compare with Str1.

Description

Compares the string Str1 to the string Str2.

Return value

Returns an integer value indicating the relationship between the strings:

Return ValueIndicates

<0

The first character that does not match has a lower value in Str1 than in Str2.

0

The contents of both strings are equal.

>0

The first character that does not match has a greater value in Str1 than in Str2.

Examples

strcmp(fffff806`6de00000, @rax+c0);

Compare the string located at fffff806`6de00000 with the string located at @rax+c0.

strcmp(@rcx, "Test String");

Compare the string located at @rcx with the string "Test String".

strcmp("Test String1", "Test String2");

Compare the string "Test String1" with the string "Test String2".

Remarks

This function checks for the validity of both the source and the destination address before the comparison.

The support for this function is added from v0.7.

wcscmp

memcmp

Last updated