CELua[RU]
    • Категории
    • Последние
    • Метки
    • Популярные
    • Пользователи
    • Группы
    • Зарегистрироваться
    • Войти

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

    Запланировано Прикреплена Закрыта Перенесена MasterGH
    custom types
    1 Сообщения 1 Posters 26 Просмотры 1 Watching
    Загружаем больше сообщений
    • Сначала старые
    • Сначала новые
    • По количеству голосов
    Ответить
    • Ответить, создав новую тему
    Авторизуйтесь, чтобы ответить
    Эта тема была удалена. Только пользователи с правом управления темами могут её видеть.
    • MasterGHM Не в сети
      MasterGH Администраторы
      отредактировано MasterGH

      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

      • 1 / 1
      • Первое сообщение
        Последнее сообщение
      Powered by NodeBB | Contributors
      СeLua[RU] 2025©