Description of the 'interlocked_exchange_add' function in HyperDbg Scripts
interlocked_exchange_add
interlocked_exchange_add( *Variable, Expression );
[*Variable (Addend)]
A reference to a variable (most of the time a global variable) to add the value of the resulting instruction to it.
[Expression (Value)]
The value which is added to the global variable.
Performs an atomic addition of two values.
The function returns the initial value of the Variable(Addend) parameter.
Variable(Addend)
Result = interlocked_exchange_add(.my_gloabl_counter, 0x55);
Adds the value (0x55) to the global variable and saves the initial value of the .my_gloabl_counter into a local variable named Result.
0x55
.my_gloabl_counter
Result
You can also perform the subtraction by addition (using the 2's-complement system).
interlocked_compare_exchangearrow-up-right
interlocked_incrementarrow-up-right
interlocked_exchangearrow-up-right
interlocked_decrementarrow-up-right
Last updated 2 years ago