Dear all
Can some one tell me how to read TCVN3 character in process (I control) by C# programming language.
I See C# only Support ASCII and Unicode? is it right?
I Had use below code and received Character same here
- Use ASCII received: Tr?i Cung, T?
- Use Unicode received: T#?i Cu#g, T?#
The problem is how to Read Full Character TCVN3 in process!
Thanks a lots for help
What I have tried:
My Code Read memeory Process: use ReadProcessMemory (API)
public class clsMemoryEditor
{
[DllImport("Kernel32.dll")]
static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, UInt32 nSize, ref UInt32 lpNumberOfBytesRead);
IntPtr hand;
public clsMemoryEditor(IntPtr handle)
{
hand = handle;
}
public byte[] Read(int Address, int length)
{
byte[] ret = new byte[length];
uint o = 0;
ReadProcessMemory(hand, (IntPtr)Address, ret, (UInt32)ret.Length, ref o);
return ret;
}
public int ReadInt32(int Address)
{
return BitConverter.ToInt32(Read(Address, 4), 0);
}
public string ReadString(int Address, int length, bool isUnicode)
{
if (isUnicode)
{
UnicodeEncoding enc = new UnicodeEncoding();
return enc.GetString(Read(Address, length));
}
else
{
ASCIIEncoding enc = new ASCIIEncoding();
return enc.GetString(Read(Address, length));
}
}
}