Skip to main content
2 of 4
added 222 characters in body

How to search a sequence of instructions in Ghidra?

I'd like to identify in Ghidra a specific sequence of instructions, which I get from MSVC Debug in Visual Studio compiling my own function:

enter image description here

What I'm looking for so is (for the same DLL, decompiled in Ghidra) to intercept the sequence movss/movss/movss/movss/lea/lea/lea, in the hoping to intercept the C++ Clamp function I've defined:

template <typename T>
T Clamp(const T& min, const T& max, const T& value)
{
    if (value < min)
    {
        return min;
    }
    else if (value > max)
    {
        return max;
    }
    return value;
}

What's the correct way to do this in Ghidra?

If I try Instruction Pattern Search feature and I insert 4 manual movss (selecting only instructions):

enter image description here

It says not result found...