Skip to content
  • Категории
  • Последние
  • Метки
  • Популярные
  • Пользователи
  • Группы
Collapse
Brand Logo

CELua[RU]

  1. Главная
  2. Общение
  3. MasterGH
  4. Пользовательские тип данных в hex-окне (пример)

Пользовательские тип данных в hex-окне (пример)

Запланировано Прикреплена Закрыта Перенесена MasterGH
custom types
1 Сообщения 1 Posters 19 Просмотры
  • Сначала старые
  • Сначала новые
  • По количеству голосов
Ответить
  • Ответить, создав новую тему
Авторизуйтесь, чтобы ответить
Эта тема была удалена. Только пользователи с правом управления темами могут её видеть.
  • MasterGHM Не в сети
    MasterGHM Не в сети
    MasterGH Администраторы
    написал в отредактировано MasterGH
    #1
    function bytes_to_value_function(b1,b2,b3,b4)
      -- для примера
      local table = {b1, b2, b3, b4}
      local dword = byteTableToDword(table)
      local refDataFromAddress = getAddressSafe(dword)
      if dataPointer ~= nil then
         return refDataFromAddress
      end
      return dword
    end
    
    function value_to_bytes_function(integer)
      -- просто для примера
      return bXor(integer, 100)
    end
    local isFloat = false
    registerCustomTypeLua('Pointer 2', 4, bytes_to_value_function, value_to_bytes_function, isFloat)
    

    Справка

    CustomType class (Object)
    The custom type is an convertor of raw data, to a human readable interpretation.
    
    global functions
      registerCustomTypeLua(typename, bytecount, bytestovaluefunction, valuetobytesfunction, isFloat)
        Registers a Custom type based on lua functions
        The bytes to value function should be defined as "function bytestovalue (b1,b2,b3,b4)" and return an integer as result
        The value to bytes function should be defined as "function valuetobytes (integer)" and return the bytes it should write
    
        returns the Custom Type object
    
    
      registerCustomTypeAutoAssembler(script)
        Registers a custom type based on an auto assembler script. The script must allocate an "ConvertRoutine" and "ConvertBackRoutine"
    
        returns the Custom Type object
    
      getCustomType(typename) : Returns the custom type object, or nil if not found
    
    properties
      name: string
      functiontypename: string
      CustomTypeType: TCustomTypeType - The type of the script
      script: string - The custom type script
      scriptUsesFloat: boolean - True if this script interprets it's user side values as float
    
    methods
      byteTableToValue({bytetable},Address Optional)
      valueToByteTable(value, Address Optional)
    
    1 ответ Последний ответ
    0

Powered by NodeBB | Contributors
СeLua[RU] 2024©
  • Войти

  • Нет учётной записи? Зарегистрироваться

  • Login or register to search.
  • Первое сообщение
    Последнее сообщение
0
  • Категории
  • Последние
  • Метки
  • Популярные
  • Пользователи
  • Группы