汇聚知识碎片,解决技术难题,专注提供易语言源码资源,视频教程,等在线学习交流论坛
 
发新帖
楼主: 666
查看: 401|回复: 0

Nt_Trans_* - Routine

[复制链接]
666VIP1 发表于 2021-5-26 18:33:19 | 显示全部楼层
  1. .版本 2

  2. .局部变量 unicode1_STRING, 长整数型
  3. .局部变量 unicode2_STRING, 长整数型
  4. .局部变量 unicode3_STRING, 长整数型
  5. .局部变量 ansi
  6. .局部变量 ansi_STRING, 长整数型
  7. .局部变量 ret
  8. .局部变量 unicode
  9. .局部变量 a
  10. .局部变量 b
  11. .局部变量 c

  12. ansi = Asm_GetDataH (“Administrator”)

  13. Asm_writeWord_1 (ansi_STRING, Asm_len (ansi))
  14. Asm_writeWord__1 (ansi_STRING, 2, Asm_len (ansi) + 1)
  15. Asm_writeDword__1 (ansi_STRING, 4, ansi)

  16. ' 调试输出 (到字节集 (“我”))
  17. ' 调试输出 (到字节集 (Nt_Trans_RtlAnsiCharToUnicodeChar (Asm_GetH (Asm_GetH (取字节集数据 (到字节集 (“我”), #短整数型, ))))))  ' ansi双字节转Unicode

  18. ret = Nt_Trans_RtlAnsiStringToUnicodeSize (Asm_GetH (ansi_STRING))  ' ansi转unicode长度
  19. ' 调试输出 (ret)

  20. Nt_Trans_RtlAnsiStringToUnicodeString (Asm_GetH (unicode1_STRING), Asm_GetH (ansi_STRING), 真)  ' 真 由函数在默认堆栈申请内存转换
  21. Nt_Trans_RtlFreeUnicodeString (Asm_GetH (unicode1_STRING))  ' 释放掉内存 自己也可以释放 Nt_Heap_RtlFreeHeap 默认堆栈传地址就行了


  22. unicode = Nt_Heap_RtlAllocateHeap (g_heap, 位或 (#HEAP_ZERO_MEMORY, #HEAP_GENERATE_EXCEPTIONS), ret)

  23. Asm_writeWord_1 (unicode1_STRING, 0)
  24. Asm_writeWord__1 (unicode1_STRING, 2, ret)
  25. Asm_writeDword__1 (unicode1_STRING, 4, unicode)
  26. Nt_Trans_RtlAnsiStringToUnicodeString (Asm_GetH (unicode1_STRING), Asm_GetH (ansi_STRING), 假)  ' 假 自己可控指针位置

  27. ' MessageBoxW (0, Asm_readDword__1 (unicode1_STRING, 4), 0, 0)

  28. ansi = Asm_GetDataH (“|我的Administrator”)
  29. Asm_writeWord_1 (ansi_STRING, Asm_len (ansi))
  30. Asm_writeWord__1 (ansi_STRING, 2, Asm_len (ansi) + 1)
  31. Asm_writeDword__1 (ansi_STRING, 4, ansi)

  32. unicode = Nt_Heap_RtlReAllocateHeap (g_heap, 位或 (#HEAP_ZERO_MEMORY, #HEAP_GENERATE_EXCEPTIONS), unicode, Asm_add (Nt_Heap_RtlSizeHeap (g_heap, 0, unicode), Nt_Trans_RtlAnsiStringToUnicodeSize (Asm_GetH (ansi_STRING)) - 2))
  33. Asm_writeWord__1 (unicode1_STRING, 2, Nt_Heap_RtlSizeHeap (g_heap, 0, unicode))
  34. Asm_writeDword__1 (unicode1_STRING, 4, unicode)

  35. Nt_Trans_RtlAnsiStringToUnicodeString (Asm_GetH (unicode2_STRING), Asm_GetH (ansi_STRING), 真)  ' 真 由函数在默认堆栈申请内存转换

  36. Nt_Trans_RtlAppendUnicodeToString (Asm_GetH (unicode1_STRING), Asm_readDword__1 (unicode2_STRING, 4))

  37. ' MessageBoxW (0, Asm_readDword__1 (unicode1_STRING, 4), 0, 0)

  38. unicode = Nt_Heap_RtlReAllocateHeap (g_heap, 位或 (#HEAP_ZERO_MEMORY, #HEAP_GENERATE_EXCEPTIONS), unicode, Asm_add (Nt_Heap_RtlSizeHeap (g_heap, 0, unicode), Nt_Trans_RtlAnsiStringToUnicodeSize (Asm_GetH (ansi_STRING)) - 2))
  39. Asm_writeWord__1 (unicode1_STRING, 2, Nt_Heap_RtlSizeHeap (g_heap, 0, unicode))
  40. Asm_writeDword__1 (unicode1_STRING, 4, unicode)


  41. Nt_Trans_RtlAppendUnicodeToString (Asm_GetH (unicode1_STRING), Asm_readDword__1 (unicode2_STRING, 4))



  42. ' MessageBoxW (0, Asm_readDword__1 (unicode1_STRING, 4), 0, 0)
  43. ' 输出调试文本 (Asm_readWord__1 (unicode1_STRING, 0))
  44. ' 输出调试文本 (Asm_readWord__1 (unicode2_STRING, 0))


  45. ' 输出调试文本 (Nt_Trans_RtlCompareUnicodeString (Asm_GetH (unicode1_STRING), Asm_GetH (unicode2_STRING), 假))
  46. ' 输出调试文本 (Nt_Trans_RtlEqualUnicodeString (Asm_GetH (unicode1_STRING), Asm_GetH (unicode2_STRING), 假))
  47. Nt_Trans_RtlCopyUnicodeString (Asm_GetH (unicode1_STRING), Asm_GetH (unicode2_STRING))  ' 复制
  48. ' 输出调试文本 (Nt_Trans_RtlEqualUnicodeString (Asm_GetH (unicode1_STRING), Asm_GetH (unicode2_STRING), 假))
  49. ' 输出调试文本 (Nt_Trans_RtlCompareUnicodeString (Asm_GetH (unicode1_STRING), Asm_GetH (unicode2_STRING), 假))


  50. Nt_Trans_RtlFreeUnicodeString (Asm_GetH (unicode1_STRING))  ' 释放掉内存
  51. Nt_Trans_RtlFreeUnicodeString (Asm_GetH (unicode2_STRING))  ' 释放掉内存
  52. ' -------------------------------------------------------------

  53. Nt_Trans_RtlCreateUnicodeString (Asm_GetH (unicode1_STRING), Asm_GetBinH ({ 97, 0, 98, 0, 99, 0, 0, 0 }))
  54. ' MessageBoxW (0, Asm_readDword__1 (unicode1_STRING, 4), 0, 0)
  55. Nt_Trans_RtlFreeUnicodeString (Asm_GetH (unicode1_STRING))  ' 释放掉内存

  56. Nt_Trans_RtlCreateUnicodeStringFromAsciiz (Asm_GetH (unicode1_STRING), Asm_GetDataH (“ABC”))
  57. ' MessageBoxW (0, Asm_readDword__1 (unicode1_STRING, 4), 0, 0)
  58. Nt_Trans_RtlFreeUnicodeString (Asm_GetH (unicode1_STRING))  ' 释放掉内存

  59. ' 调试输出 (到字节集 (“A”))
  60. ' 输出调试文本 (字符 (Nt_Trans_RtlDowncaseUnicodeChar (65))) '单字符转换

  61. Nt_Trans_RtlCreateUnicodeStringFromAsciiz (Asm_GetH (unicode1_STRING), Asm_GetDataH (“ABC”))

  62. Nt_Trans_RtlDowncaseUnicodeString (Asm_GetH (unicode2_STRING), Asm_GetH (unicode1_STRING), 真)

  63. Asm_writeDword__1 (unicode2_STRING, 4, Nt_Heap_RtlReAllocateHeap (g_heap, 位或 (#HEAP_ZERO_MEMORY, #HEAP_GENERATE_EXCEPTIONS), Asm_readDword__1 (unicode2_STRING, 4), Asm_add (Nt_Heap_RtlSizeHeap (g_heap, 0, Asm_readDword__1 (unicode2_STRING, 4)), 2)))
  64. Asm_writeWord__1 (unicode2_STRING, 2, Nt_Heap_RtlSizeHeap (g_heap, 0, Asm_readDword__1 (unicode2_STRING, 4)))
  65. ' MessageBoxW (0, Asm_readDword__1 (unicode2_STRING, 4), 0, 0)
  66. Nt_Trans_RtlFreeUnicodeString (Asm_GetH (unicode2_STRING))  ' 释放掉内存

  67. ' Nt_Trans_RtlCreateUnicodeStringFromAsciiz (Asm_GetH (unicode1_STRING), Asm_GetDataH (“ABC”))
  68. ' 输出调试文本 (Nt_Trans_RtlEraseUnicodeString (Asm_GetH (unicode1_STRING)))
  69. ' 调试输出 (到字节集 (unicode1_STRING))

  70. Nt_Trans_RtlCreateUnicodeStringFromAsciiz (Asm_GetH (unicode1_STRING), Asm_GetDataH (“abcd”))
  71. Nt_Trans_RtlCreateUnicodeStringFromAsciiz (Asm_GetH (unicode2_STRING), Asm_GetDataH (“d”))
  72. Nt_Trans_RtlFindCharInUnicodeString (0, Asm_GetH (unicode1_STRING), Asm_GetH (unicode2_STRING), Asm_GetH (ret))
  73. ' 输出调试文本 (ret)
  74. Nt_Trans_RtlFindUnicodeSubstring (Asm_GetH (unicode1_STRING), Asm_GetH (unicode2_STRING), Asm_GetH (ret))
  75. ' 输出调试文本 (ret)

  76. ' 输出调试文本 (Nt_Trans_RtlHashUnicodeString (Asm_GetH (unicode1_STRING), 假, 0, Asm_GetH (ret)))
  77. ' 调试输出 (到字节集 (ret))

  78. Nt_Trans_RtlFreeUnicodeString (Asm_GetH (unicode1_STRING))  ' 释放掉内存
  79. Nt_Trans_RtlFreeUnicodeString (Asm_GetH (unicode2_STRING))  ' 释放掉内存


  80. Nt_Trans_RtlCreateUnicodeStringFromAsciiz (Asm_GetH (unicode1_STRING), Asm_GetDataH (“www.我爱你.com”))

  81. a = Nt_Heap_RtlAllocateHeap (g_heap, 12, 255)
  82. ret = 255
  83. Nt_Trans_RtlIdnToAscii (1, Asm_readDword__1 (unicode1_STRING, 4), -1, a, Asm_GetH (ret))
  84. ' 调试输出 (指针到字节集 (a, ret × 2))

  85. b = Nt_Heap_RtlAllocateHeap (g_heap, 12, 255)
  86. c = ret
  87. ret = 255
  88. Nt_Trans_RtlIdnToUnicode (1, a, c, b, Asm_GetH (ret))
  89. ' 调试输出 (指针到字节集 (b, ret × 2))

  90. Nt_RtlZeroMemory (a, 255)

  91. ret = 255
  92. Nt_Trans_RtlIdnToNameprepUnicode (1, b, -1, a, Asm_GetH (ret))
  93. ' 调试输出 (指针到字节集 (a, ret × 2))
  94. Nt_Heap_RtlFreeHeap (g_heap, 0, b)

  95. Nt_Trans_RtlMultiByteToUnicodeSize (Asm_GetH (ret), Asm_GetDataH (“123你好”), Asm_len (Asm_GetDataH (“123你好”)))
  96. ' 输出调试文本 (ret)
复制代码
.版本 2

' RtlAnsiCharToUnicodeChar
' RtlAnsiStringToUnicodeSize
' RtlAnsiStringToUnicodeString
' RtlAppendAsciizToString
' RtlAppendStringToString
' RtlAppendUnicodeStringToString
' RtlAppendUnicodeToString
' RtlCharToInteger
' RtlCompareString
' RtlCompareUnicodeString
' RtlCompareUnicodeStrings
' RtlConsoleMultiByteToUnicodeN'放弃
' RtlConvertDeviceFamilyInfoToString'放弃
' RtlConvertLCIDToString'放弃
' RtlConvertSidToUnicodeString'放弃
' RtlCopyString
' RtlCopyUnicodeString
' RtlCreateUnicodeString
' RtlCreateUnicodeStringFromAsciiz
' RtlCustomCPToUnicodeN'该RtlCustomCPToUnicodeN程序保留给系统使用。请参见RtlMultiByteToUnicodeN和RtlOemToUnicodeN。
' RtlDowncaseUnicodeChar
' RtlDowncaseUnicodeString
' RtlDuplicateUnicodeString
' RtlEqualString
' RtlEqualUnicodeString
' RtlEraseUnicodeString
' RtlFindCharInUnicodeString
' RtlFindUnicodeSubstring
' RtlFreeAnsiString
' RtlFreeOemString
' RtlFreeUTF8String
' RtlFreeUnicodeString
' RtlGUIDFromString
' RtlStringFromGUIDEx
' RtlHashUnicodeString
' RtlIdnToNameprepUnicode
' RtlIdnToUnicode
' RtlIdnToAscii
' RtlInitAnsiString
' RtlInitAnsiStringEx
' RtlInitString
' RtlInitStringEx
' RtlInitUTF8String
' RtlInitUTF8StringEx
' RtlInitUnicodeString
' RtlInitUnicodeStringEx
' RtlInt64ToUnicodeString
' RtlIntegerToChar
' RtlIntegerToUnicodeString
' RtlIsTextUnicode '放弃
' RtlLargeIntegerToChar '放弃
' RtlLengthSidAsUnicodeString
' RtlMultiAppendUnicodeStringBuffer'放弃
' RtlMultiByteToUnicodeN
' RtlMultiByteToUnicodeSize
' RtlNormalizeString'放弃
' RtlOemStringToUnicodeSize
' RtlOemStringToUnicodeString
' RtlOemToUnicodeN
' RtlPrefixString
' RtlPrefixUnicodeString
' RtlRunDecodeUnicodeString
' RtlRunEncodeUnicodeString
' RtlUTF8StringToUnicodeString
' RtlUTF8ToUnicodeN
' RtlUnicodeStringToAnsiSize
' RtlUnicodeStringToAnsiString
' RtlUnicodeStringToCountedOemString
' RtlUnicodeStringToInteger
' RtlUnicodeStringToOemSize
' RtlUnicodeStringToOemString
' RtlUnicodeStringToUTF8String
' RtlUnicodeToCustomCPN'该RtlUnicodeToCustomCPN程序保留给系统使用。
' RtlUnicodeToMultiByteN
' RtlUnicodeToMultiByteSize
' RtlUnicodeToOemN
' RtlUnicodeToUTF8N
' RtlUpcaseUnicodeChar
' RtlUpcaseUnicodeString
' RtlUpcaseUnicodeStringToAnsiString
' RtlUpcaseUnicodeStringToCountedOemString
' RtlUpcaseUnicodeStringToOemString
' RtlUpcaseUnicodeToCustomCPN'该RtlUpcaseUnicodeToCustomCPN程序保留给系统使用。
' RtlUpcaseUnicodeToMultiByteN
' RtlUpcaseUnicodeToOemN
' RtlUpperChar
' RtlUpperString
' RtlValidateUnicodeString
' RtlxAnsiStringToUnicodeSize
' RtlxOemStringToUnicodeSize
' RtlxUnicodeStringToAnsiSize
' RtlxUnicodeStringToOemSize


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