
13.01.2022, 22:24
|
|
Новичок
Регистрация: 16.12.2020
Сообщений: 13
С нами:
2846858
Репутация:
53
|
|
Всем привет, сделал показ информации о игроках которые на сервере (id, ping, score, name),
но на некоторых игроках пишет вместо ника, иероглифы.
Сообщение от Спойлер
C++:
Код:
RemotePlayer
[
i
]
.
id
=
i
;
RemotePlayer
[
i
]
.
ping
=
readMem
(
Memory
.
RemotePlayer_PTR
+
0x28
)
;
RemotePlayer
[
i
]
.
score
=
readMem
(
Memory
.
RemotePlayer_PTR
+
0x24
)
;
RemotePlayer
[
i
]
.
isNpc
=
readMem
(
Memory
.
RemotePlayer_PTR
+
0x4
)
;
char
remote_name
[
32
]
;
DWORD oldProtect
=
0
;
DWORD Address
=
Memory
.
RemotePlayer_PTR
+
0xC
;
VirtualProtectEx
(
Memory
.
processHandle
,
(
void
*
)
Address
,
sizeof
(
remote_name
)
,
PAGE_EXECUTE_READWRITE
,
&
oldProtect
)
;
ReadProcessMemory
(
Memory
.
processHandle
,
(
LPVOID
)
(
Address
)
,
&
remote_name
,
sizeof
(
remote_name
)
,
NULL
)
;
VirtualProtectEx
(
Memory
.
processHandle
,
(
void
*
)
Address
,
sizeof
(
remote_name
)
,
oldProtect
,
NULL
)
;
RemotePlayer
[
i
]
.
name
=
remote_name
;
RemotePlayer
[
i
]
.
address
=
Memory
.
RemotePlayer_PTR
;
Сообщение от Спойлер
C++:
[CODE]
int
player
=
MenuFunction
.
test
;
if
(
player
>
REDFIRE_MAX_PLAYER
||
player
Сообщение от Спойлер
C++:
Код:
void
DrawStrokeText
(
int
x
,
int
y
,
RGBA
*
color
,
const
char
*
str
)
{
ImFont a
;
std
::
string utf_8_1
=
std
::
string
(
str
)
;
std
::
string utf_8_2
=
string_To_UTF8
(
utf_8_1
)
;
ImGui
::
GetForegroundDrawList
(
)
->
AddText
(
ImVec2
(
x
,
y
-
1
)
,
ImGui
::
ColorConvertFloat4ToU32
(
ImVec4
(
1
/
255.0
,
1
/
255.0
,
1
/
255.0
,
255
/
255.0
)
)
,
utf_8_2
.
c_str
(
)
)
;
ImGui
::
GetForegroundDrawList
(
)
->
AddText
(
ImVec2
(
x
,
y
+
1
)
,
ImGui
::
ColorConvertFloat4ToU32
(
ImVec4
(
1
/
255.0
,
1
/
255.0
,
1
/
255.0
,
255
/
255.0
)
)
,
utf_8_2
.
c_str
(
)
)
;
ImGui
::
GetForegroundDrawList
(
)
->
AddText
(
ImVec2
(
x
-
1
,
y
)
,
ImGui
::
ColorConvertFloat4ToU32
(
ImVec4
(
1
/
255.0
,
1
/
255.0
,
1
/
255.0
,
255
/
255.0
)
)
,
utf_8_2
.
c_str
(
)
)
;
ImGui
::
GetForegroundDrawList
(
)
->
AddText
(
ImVec2
(
x
+
1
,
y
)
,
ImGui
::
ColorConvertFloat4ToU32
(
ImVec4
(
1
/
255.0
,
1
/
255.0
,
1
/
255.0
,
255
/
255.0
)
)
,
utf_8_2
.
c_str
(
)
)
;
ImGui
::
GetForegroundDrawList
(
)
->
AddText
(
ImVec2
(
x
,
y
)
,
ImGui
::
ColorConvertFloat4ToU32
(
ImVec4
(
color
->
R
/
255.0
,
color
->
G
/
255.0
,
color
->
B
/
255.0
,
color
->
A
/
255.0
)
)
,
utf_8_2
.
c_str
(
)
)
;
}
Сообщение от Спойлер
C++:
Код:
std
::
string
string_To_UTF8
(
const
std
::
string
&
str
)
{
int
nwLen
=
::
MultiByteToWideChar
(
CP_ACP
,
0
,
str
.
c_str
(
)
,
-
1
,
NULL
,
0
)
;
wchar_t
*
pwBuf
=
new
wchar_t
[
nwLen
+
1
]
;
ZeroMemory
(
pwBuf
,
nwLen
*
2
+
2
)
;
::
MultiByteToWideChar
(
CP_ACP
,
0
,
str
.
c_str
(
)
,
str
.
length
(
)
,
pwBuf
,
nwLen
)
;
int
nLen
=
::
WideCharToMultiByte
(
CP_UTF8
,
0
,
pwBuf
,
-
1
,
NULL
,
NULL
,
NULL
,
NULL
)
;
char
*
pBuf
=
new
char
[
nLen
+
1
]
;
ZeroMemory
(
pBuf
,
nLen
+
1
)
;
::
WideCharToMultiByte
(
CP_UTF8
,
0
,
pwBuf
,
nwLen
,
pBuf
,
nLen
,
NULL
,
NULL
)
;
std
::
string
retStr
(
pBuf
)
;
delete
[
]
pwBuf
;
delete
[
]
pBuf
;
pwBuf
=
NULL
;
pBuf
=
NULL
;
return
retStr
;
}


|
|
|
|
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|