找回密码
 加入
搜索
查看: 1678|回复: 4

请教 16进制代码 转换为 文字字符 的命令。

[复制链接]
发表于 2008-11-22 01:10:00 | 显示全部楼层 |阅读模式
读取内存 找到了 对象名称 的代码,
但是不知道 在autoit 里 用什么命令 来把代码转换为 文字?
请知道的高手 指导 一下,感谢!

[ 本帖最后由 gaoyuan22 于 2008-12-2 15:38 编辑 ]
发表于 2008-11-22 02:23:46 | 显示全部楼层

#include <string.au3>
$String = "I like AutoIt3"
$Hex = _StringToHex($String)
MsgBox(0, "Hex", "Original String: " & $String & @LF & " Hex: " & $Hex)

$Hex = "49206C696B65204175746F497433"
$String = _HexToString($Hex)
MsgBox(0, "Hex", "Original Hex: " & $Hex & @LF & " String: " & $String)
发表于 2008-11-22 11:37:19 | 显示全部楼层
2楼的代码,在新版不支持中文了,楼主可以考虑用如下吧
; Binary ANSI to String 
$buffer = StringToBinary("Hello - 你好")
MsgBox(4096, "String() representation" , $buffer)
$buffer = BinaryToString($buffer)
MsgBox(4096, "BinaryToString() ANSI representation" , $buffer)

; Binary UTF16-LE to String 
$buffer = StringToBinary("Hello - 你好", 2)
MsgBox(4096, "String() representation" , $buffer)
$buffer = BinaryToString($buffer, 2)
MsgBox(4096, "BinaryToString() UTF16-LE representation" , $buffer)

; Binary UTF16-BE to String 
$buffer = StringToBinary("Hello - 你好", 3)
MsgBox(4096, "String() representation" , $buffer)
$buffer = BinaryToString($buffer, 3)
MsgBox(4096, "BinaryToString() UTF16-BE representation" , $buffer)

; Binary UTF8 to String 
$buffer = StringToBinary("Hello - 你好", 4)
MsgBox(4096, "String() representation" , $buffer)
$buffer = BinaryToString($buffer, 4)
MsgBox(4096, "BinaryToString() UTF8 representation" , $buffer)
发表于 2008-11-22 12:36:14 | 显示全部楼层
去官网看看,有一个函数可以实现
发表于 2008-11-24 14:10:18 | 显示全部楼层
原帖由 netegg 于 2008-11-22 12:36 发表
去官网看看,有一个函数可以实现


e文看不懂!可否直接告诉俺?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-6 03:45 , Processed in 0.073077 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表