memcmp

Description of the 'memcmp' function in HyperDbg Scripts

Function

memcmp

Syntax

memcmp( Ptr1, Ptr2, Num );

Parameters

[Ptr1]

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

[Ptr2]

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

[Num]

Number of bytes to compare.

Description

Compares the first Num bytes of the block of memory pointed by Ptr1 to the first num bytes pointed by Ptr2.

Return value

Returns an integer value indicating the relationship between the content of the memory blocks:

Examples

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

Compare the first 5 bytes of the memory located at fffff806`6de00000 with the memory located at @rax+c0.

memcmp(@rcx, "Test1", 5);

Compare the first 5 bytes of the memory located at @rcx with the string "Test1".

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.

strcmp

wcscmp

Last updated