Hi mr doublesine
Can help me to adapt code Patch for VisualAssist on new 64 version dll for latest VS 2022 native x64?
Build 2022.1
Release date: 2022.01.21
Version 10.9.2443
VA_X64.dll
https://mega.nz/file/6s1wCZBA#zycmnktPFNw12sV37xMXVYVLtRPvnnpsfgKSnFw_tCI
Thanks and Best Regards
a1 = C8 83 c8 84 c8 8c c8 85 c8 aa c8 8e c8 8c c8 85 c8 92 c9 84 c8 83 c8 9e
a1 is a correct result....
I try to replicate in C# the same whitout success in this way :
1) [DllImport("kernel32.dll")]
static extern int WideCharToMultiByte(uint CodePage, uint dwFlags,
[MarshalAs(UnmanagedType.LPWStr)] string lpWideCharStr, int cchWideChar,
[MarshalAs(UnmanagedType.LPArray)] Byte[] lpMultiByteStr, int cbMultiByte, IntPtr lpDefaultChar,
out bool lpUsedDefaultChar);
Int32 iNewDataLen = 0x34;
Byte[] byNewData = null;
bool bDefaultChar = false;
string s = Encoding.UTF8.GetString(.......);
int sl = s.Length;
byNewData = new Byte[0x34];
iNewDataLen = WideCharToMultiByte(0xfde9, 0, s, sl, byNewData, iNewDataLen, IntPtr.Zero, out bDefaultChar);
but byNewData for me is wrong... you know another way?
tks for any reply
@Double Sine I have a little OT...
I need if possible an help on this problems :
I have this string hex :
1) 03 02 04 02 0c 02 05 02 2a 02 0e 02 0c 02 05 02 12 02 44 02 03 02 1e 02
and an sw passed this string hex at call c++ WideCharToMultiByte:
Codepage = 0xfde9;
v4 = 0xD;
result = (LPSTR *)WideCharToMultiByte(CodePage, 0, lpString, v4, *a1, 4 * v4, 0, 0);
a1 = C8 83 c8 84 c8 8c c8 85 c8 aa c8 8e c8 8c c8 85 c8 92 c9 84 c8 83 c8 9e
a1 is a correct result....
I try to replicate in C# the same whitout success in this way :
1) [DllImport("kernel32.dll")]
static extern int WideCharToMultiByte(uint CodePage, uint dwFlags,
[MarshalAs(UnmanagedType.LPWStr)] string lpWideCharStr, int cchWideChar,
[MarshalAs(UnmanagedType.LPArray)] Byte[] lpMultiByteStr, int cbMultiByte, IntPtr lpDefaultChar,
out bool lpUsedDefaultChar);
Int32 iNewDataLen = 0x34;
Byte[] byNewData = null;
bool bDefaultChar = false;
string s = Encoding.UTF8.GetString(.......);
int sl = s.Length;
byNewData = new Byte[0x34];
iNewDataLen = WideCharToMultiByte(0xfde9, 0, s, sl, byNewData, iNewDataLen, IntPtr.Zero, out bDefaultChar);
but byNewData for me is wrong... you know another way?
tks for any reply
WideCharToMultiByte with code page CP_UTF8(0xfde9) is just converting a UNICODE-encoded byte array to a UTF8-encoded byte array where UNICODE-encoded is actually UTF16-LE-encoded.
Hi mr doublesine Can help me to adapt code Patch for VisualAssist on new 64 version dll for latest VS 2022 native x64?
Build 2022.1 Release date: 2022.01.21 Version 10.9.2443
VA_X64.dll
https://mega.nz/file/6s1wCZBA#zycmnktPFNw12sV37xMXVYVLtRPvnnpsfgKSnFw_tCI
Thanks and Best Regards
OK, I will take a look as soon as possible.
many thank's for your time...
The patched VA_X64.dll for 10.9.2443.0 has been uploaded.
Many thanks you Think about updating the code on the HyperSine github?
Best regards
Code has been uploaded. Previous code is archived in
archived-cpp
branch.Many thanks for all..
@Double Sine I have a little OT...
I need if possible an help on this problems :
I have this string hex :
1) 03 02 04 02 0c 02 05 02 2a 02 0e 02 0c 02 05 02 12 02 44 02 03 02 1e 02
and an sw passed this string hex at call c++ WideCharToMultiByte:
Codepage = 0xfde9; v4 = 0xD;
result = (LPSTR *)WideCharToMultiByte(CodePage, 0, lpString, v4, *a1, 4 * v4, 0, 0);
a1 = C8 83 c8 84 c8 8c c8 85 c8 aa c8 8e c8 8c c8 85 c8 92 c9 84 c8 83 c8 9e
a1 is a correct result....
I try to replicate in C# the same whitout success in this way :
1) [DllImport("kernel32.dll")]
[MarshalAs(UnmanagedType.LPWStr)] string lpWideCharStr, int cchWideChar, [MarshalAs(UnmanagedType.LPArray)] Byte[] lpMultiByteStr, int cbMultiByte, IntPtr lpDefaultChar, out bool lpUsedDefaultChar);
Int32 iNewDataLen = 0x34;
but byNewData for me is wrong... you know another way?
tks for any reply
WideCharToMultiByte
with code pageCP_UTF8(0xfde9)
is just converting a UNICODE-encoded byte array to a UTF8-encoded byte array where UNICODE-encoded is actually UTF16-LE-encoded.So the hex string you give
is UNICODE-encoded.
The correct result
is UTF8-encoded.
You should decode source hex string in UNICODE and then encode in UTF8, which is quite simple and you don't have to call Win32 API explictly:
I thank you for the many things I have learned from you over the years.