Q: Why my string parameter is different when called in c++ import method I'm using C++ method in my C# code, everything works fine except one method
I've printed the value of the parameter in my c++ code and he is different from what i'm using in my C# code
That's the method i'm invoking in my C# code
__declspec(dllexport) unsigned int _stdcall FindPattern(const char* signature, const char* mask)
{
    return Networking::instance()->findPattern(signature, mask);
}

Import
[DllImport("NtCore.dll", CallingConvention = CallingConvention.StdCall)]
internal static extern uint FindPattern(string signature, string mask);

Call
uint address = _session.FindPattern("\x3B\x43\x00\x75\x0E\x8B\x44\xBB\x08", "xx?xxxxxx");

The signature parameters is equals to ";C" instead of "\x3B\x43\x00\x75\x0E\x8B\x44\xBB\x08"

A: "\x3B\x43\x00" is actually a series of bytes that are equivalent to ";C". 0x3b is the semicolon, 0x43 is upper-case C, and 0x00 is a NUL terminator.
If you want the literal string, you should escape the \ characters with something like:
"\\x3B\\x43\\x00\\x75\\x0E\\x8B\\x44\\xBB\\x08"

