Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. ---- TheyCallMeTim13
  2. ---- Writes a zero terminated string to the given address.
  3. ----
  4. ---- writeStringZT(address, text)
  5. ---- writeStringZT(address, text, wideChar)
  6. ----
  7. ---- Parameters:
  8. ----    address : number - string :
  9. ----        The address to write to.
  10. ----    text : string :
  11. ----        The string to write to memory.
  12. ----    wideChar (optional): boolean :
  13. ----        Set to true for wide character strings.
  14. function writeStringZT(address, text, wideChar)
  15.     address = getAddressSafe(address)
  16.     if not address then return end
  17.     writeString(address, text, wideChar)
  18.     local len = #text
  19.     if wideChar then len = len * 2 end
  20.     writeBytes(address + len, { 0x00, 0x00 })
  21. end
  22. registerLuaFunctionHighlight('writeStringZT')
  23. ----
  24. ---- Writes a zero terminated string to the given address targeting the CE process.
  25. ----
  26. ---- writeStringLocalZT(address, text)
  27. ---- writeStringLocalZT(address, text, wideChar)
  28. ----
  29. ---- Parameters:
  30. ----    address : number - string :
  31. ----        The address to write to.
  32. ----    text : string :
  33. ----        The string to write to memory.
  34. ----    wideChar (optional): boolean :
  35. ----        Set to true for wide character strings.
  36. function writeStringLocalZT(address, text, wideChar)
  37.     address = getAddressSafe(address, true)
  38.     if not address then return end
  39.     writeStringLocal(address, text, wideChar)
  40.     local len = #text
  41.     if wideChar then len = len * 2 end
  42.     writeBytesLocal(address + len, { 0x00, 0x00 })
  43. end
  44. registerLuaFunctionHighlight('writeStringLocalZT')