<commit_before>module Net
  module TTI
    class DataTypeNegotiationRequest < Message
      # BinData fields

      # Not sure why this is duplicated, but clients always send the same
      # character set in both fields.
      # Character sets:
      #  0x00b2 (178) - US-ASCII
      #  0x0369 (873) - UTF-8
      uint16le  :charset1
      uint16le  :charset2
      
      string    :dty_body

      def _ttc_code()
        TTC_CODE_DATA_TYPE_NEGOTIATION
      end
      private :_ttc_code

      def self.create_request(platform, architecture)
        request = self.new
        
        case architecture
        when :x86
          request.character_set = 0x00b2        
          request.dty_body = "4227060101010F010106010101010101017FFF030A030701017F017FFF01090101BF010506000107040702010000180003800000003C3C3C800000000000000ED007".tns_unhexify
        when :x64
          request.character_set = 0x0369
          request.dty_body = "0227060101010D010106010101010101017FFF030A030301007F017FFF010501013F010306000103010702010000180003800000003C3C3C800000000000000BD007000100010001000000020002000A00000008000800010000000C000C000A000000170017000100000018001800010000001900190018001900010000001A001A0019001A00010000001B001B000A001B00010000001C001C0016001C00010000001D001D0017001D00010000001E001E0017001E00010000001F001F0019001F0001000000200020000A00200001000000210021000A002100010000000A000A00010000000B000B0001000000280028000100000029002900010000007500750001000000780078000100000122012200010000012301230001012300010000012401240001000001250125000100000126012600010000012A012A00010000012B012B00010000012C012C00010000012D012D00010000012E012E00010000012F012F000100000130013000010000013101310001000001320132000100000133013300010000013401340001000001350135000100000136013600010000013701370001000001380138000100000139013900010000013B013B00010000013C013C00010000013D013D00010000013E013E00010000013F013F000100000140014000010000014101410001000001420142000100000143014300010000014701470001000001480148000100000149014900010000014B014B00010000014D014D00010000014E014E00010000014F014F00010000015001500001000001510151000100000152015200010000015301530001000001540154000100000155015500010000015601560001000001570157000101570001000001580158000100000159015900010000015A015A00010000015C015C00010000015D015D00010000016201620001000001630163000100000167016700010000016B016B00010000017C017C0001014200010000017D017D00010000017E017E00010000017F017F00010000018001800001000001810181000100000182018200010000018301830001000001840184000100000185018500010000018601860001000001870187000100000189018900010000018A018A00010000018B018B00010000018C018C00010000018D018D00010000018E018E00010000018F018F0001000001900190000100000191019100010000019401940001012500010000019501950001000001960196000100000197019700010000019D019D00010000019E019E00010000019F019F0001000001A001A00001000001A101A10001000001A201A20001000001A301A30001000001A401A40001000001A501A50001000001A601A60001000001A701A70001000001A801A80001000001A901A90001000001AA01AA0001000001AB01AB0001000001AD01AD0001000001AE01AE0001000001AF01AF0001000001B001B00001000001B101B10001000001C101C10001000001C201C2000101250001000001C601C60001000001C701C70001000001C801C80001000001C901C90001000001CA01CA0001019F0001000001CB01CB000101A00001000001CC01CC000101A20001000001CD01CD000101A30001000001CE01CE000101B10001000001CF01CF000101220001000001D201D20001000001D301D3000101AB0001000001D401D40001000001D501D50001000001D601D60001000001D701D70001000001D801D80001000001D901D90001000001DA01DA0001000001DB01DB0001000001DC01DC0001000001DD01DD0001000001DE01DE0001000001DF01DF0001000001E001E00001000001E101E10001000001E201E20001000001E301E30001016B0001000001E401E40001000001E501E50001000001E601E60001000001EA01EA0001000001EB01EB0001000001EC01EC0001000001ED01ED0001000001EE01EE0001000001EF01EF0001000001F001F00001000001F201F20001000001F301F30001000001F401F40001000001F501F50001000001F601F60001000001FD01FD0001000001FE01FE0001000002010201000100000202020200010000020402040001000002050205000100000206020600010000020702070001000002080208000100000209020900010000020A020A00010000020B020B00010000020C020C00010000020D020D00010000020E020E00010000020F020F000100000210021000010000021102110001000002120212000100000213021300010000021402140001000002150215000100000216021600010000021702170001000002180218000100000219021900010000021A021A00010000021B021B00010000021C021C00010000021D021D00010000021E021E00010000021F021F000100000220022000010000022102210001000002220222000100000223022300010000022402240001000002250225000100000226022600010000022702270001000002280228000100000229022900010000022A022A00010000022B022B00010000022C022C00010000022D022D00010000022E022E00010000022F022F000100000230023000010000023102310001000002320232000100000233023300010000023402340001000002350235000100000236023600010000023702370001000002380238000100000239023900010000023A023A00010000023B023B00010000023C023C00010000023D023D00010000023E023E00010000023F023F00010000024002400001000002410241000100000242024200010000024302430001000002440244000100000245024500010000024602460001000002470247000100000248024800010000024902490001000000030002000A000000040002000A0000000500010001000000060002000A000000070002000A00000009000100010000000D0000000E0000000F00170001000000100000001100000012000000130000001400000015000000160000002700780001015D0001012600010000003A003A0001000000440002000A00000045000000460000004A006D00010000004C0000005B0002000A0000005E000100010000005F001700010000006000600001000000610060000100000064006400010000006500650001000000660066000100000068000000690000006A006A00010000006C006D00010000006D006D00010000006E006F00010000006F006F000100000070007000010000007100710001000000720072000100000073007300010000007400660001000000760000007700000079007900010000007A007A00010000007B007B00010000008800000092009200010000009300930001000000980002000A000000990002000A0000009A0002000A0000009B000100010000009C000C000A000000AC0002000A000000B200B20001000000B300B30001000000B400B40001000000B500B50001000000B600B60001000000B700B70001000000B8000C000A000000B900B20001000000BA00B30001000000BB00B40001000000BC00B50001000000BD00B60001000000BE00B70001000000BF000000C0000000C300700001000000C400710001000000C500720001000000D000D00001000000D1000000E700E70001000000E800E70001000000E900E90001000000F1006D0001000002030203000100000000".tns_unhexify
        else
          raise Exceptions::UnsupportedArchitecture.new( architecture )
        end
        
        return request
      end

      def character_set=(charset)
        self.charset1 = charset
        self.charset2 = charset
      end
    end
  end
end<commit_msg>Use pre-existing structure for new content<commit_after>module Net
  module TTI
    class DataTypeNegotiationRequest < Message
      # BinData fields

      # Not sure why this is duplicated, but clients always send the same
      # character set in both fields.
      # Character sets:
      #  0x00b2 (178) - US-ASCII
      #  0x0369 (873) - UTF-8
      uint16le  :charset1
      uint16le  :charset2
      uint8     :unknown1
      uint8     :unknown2_length, :value => lambda { unknown2.length }
      string    :unknown2
      uint8     :unknown3_length, :value => lambda { unknown3.length }
      string    :unknown3
      string    :unknown4

      UNKNOWN4_LINUX = "800000003C3C3C800000000000000BD007000100010001000000020002000A00000008000800010000000C000C000A000000170017000100000018001800010000001900190018001900010000001A001A0019001A00010000001B001B000A001B00010000001C001C0016001C00010000001D001D0017001D00010000001E001E0017001E00010000001F001F0019001F0001000000200020000A00200001000000210021000A002100010000000A000A00010000000B000B0001000000280028000100000029002900010000007500750001000000780078000100000122012200010000012301230001012300010000012401240001000001250125000100000126012600010000012A012A00010000012B012B00010000012C012C00010000012D012D00010000012E012E00010000012F012F000100000130013000010000013101310001000001320132000100000133013300010000013401340001000001350135000100000136013600010000013701370001000001380138000100000139013900010000013B013B00010000013C013C00010000013D013D00010000013E013E00010000013F013F000100000140014000010000014101410001000001420142000100000143014300010000014701470001000001480148000100000149014900010000014B014B00010000014D014D00010000014E014E00010000014F014F00010000015001500001000001510151000100000152015200010000015301530001000001540154000100000155015500010000015601560001000001570157000101570001000001580158000100000159015900010000015A015A00010000015C015C00010000015D015D00010000016201620001000001630163000100000167016700010000016B016B00010000017C017C0001014200010000017D017D00010000017E017E00010000017F017F00010000018001800001000001810181000100000182018200010000018301830001000001840184000100000185018500010000018601860001000001870187000100000189018900010000018A018A00010000018B018B00010000018C018C00010000018D018D00010000018E018E00010000018F018F0001000001900190000100000191019100010000019401940001012500010000019501950001000001960196000100000197019700010000019D019D00010000019E019E00010000019F019F0001000001A001A00001000001A101A10001000001A201A20001000001A301A30001000001A401A40001000001A501A50001000001A601A60001000001A701A70001000001A801A80001000001A901A90001000001AA01AA0001000001AB01AB0001000001AD01AD0001000001AE01AE0001000001AF01AF0001000001B001B00001000001B101B10001000001C101C10001000001C201C2000101250001000001C601C60001000001C701C70001000001C801C80001000001C901C90001000001CA01CA0001019F0001000001CB01CB000101A00001000001CC01CC000101A20001000001CD01CD000101A30001000001CE01CE000101B10001000001CF01CF000101220001000001D201D20001000001D301D3000101AB0001000001D401D40001000001D501D50001000001D601D60001000001D701D70001000001D801D80001000001D901D90001000001DA01DA0001000001DB01DB0001000001DC01DC0001000001DD01DD0001000001DE01DE0001000001DF01DF0001000001E001E00001000001E101E10001000001E201E20001000001E301E30001016B0001000001E401E40001000001E501E50001000001E601E60001000001EA01EA0001000001EB01EB0001000001EC01EC0001000001ED01ED0001000001EE01EE0001000001EF01EF0001000001F001F00001000001F201F20001000001F301F30001000001F401F40001000001F501F50001000001F601F60001000001FD01FD0001000001FE01FE0001000002010201000100000202020200010000020402040001000002050205000100000206020600010000020702070001000002080208000100000209020900010000020A020A00010000020B020B00010000020C020C00010000020D020D00010000020E020E00010000020F020F000100000210021000010000021102110001000002120212000100000213021300010000021402140001000002150215000100000216021600010000021702170001000002180218000100000219021900010000021A021A00010000021B021B00010000021C021C00010000021D021D00010000021E021E00010000021F021F000100000220022000010000022102210001000002220222000100000223022300010000022402240001000002250225000100000226022600010000022702270001000002280228000100000229022900010000022A022A00010000022B022B00010000022C022C00010000022D022D00010000022E022E00010000022F022F000100000230023000010000023102310001000002320232000100000233023300010000023402340001000002350235000100000236023600010000023702370001000002380238000100000239023900010000023A023A00010000023B023B00010000023C023C00010000023D023D00010000023E023E00010000023F023F00010000024002400001000002410241000100000242024200010000024302430001000002440244000100000245024500010000024602460001000002470247000100000248024800010000024902490001000000030002000A000000040002000A0000000500010001000000060002000A000000070002000A00000009000100010000000D0000000E0000000F00170001000000100000001100000012000000130000001400000015000000160000002700780001015D0001012600010000003A003A0001000000440002000A00000045000000460000004A006D00010000004C0000005B0002000A0000005E000100010000005F001700010000006000600001000000610060000100000064006400010000006500650001000000660066000100000068000000690000006A006A00010000006C006D00010000006D006D00010000006E006F00010000006F006F000100000070007000010000007100710001000000720072000100000073007300010000007400660001000000760000007700000079007900010000007A007A00010000007B007B00010000008800000092009200010000009300930001000000980002000A000000990002000A0000009A0002000A0000009B000100010000009C000C000A000000AC0002000A000000B200B20001000000B300B30001000000B400B40001000000B500B50001000000B600B60001000000B700B70001000000B8000C000A000000B900B20001000000BA00B30001000000BB00B40001000000BC00B50001000000BD00B60001000000BE00B70001000000BF000000C0000000C300700001000000C400710001000000C500720001000000D000D00001000000D1000000E700E70001000000E800E70001000000E900E90001000000F1006D0001000002030203000100000000".tns_unhexify

      def _ttc_code()
        TTC_CODE_DATA_TYPE_NEGOTIATION
      end
      private :_ttc_code

      def self.create_request(platform, architecture)
        request = self.new

        case architecture
        when :x86
          request.character_set = 0x00b2
          request.unknown1 = 0x42
          request.unknown2 = "060101010F010106010101010101017FFF030A030701017F017FFF01090101BF01050600010704".tns_unhexify
          request.unknown3 = "02010000180003".tns_unhexify
          request.unknown4 = "800000003C3C3C800000000000000ED007".tns_unhexify
        when :x64
          request.character_set = 0x0369
          request.unknown1 = 0x02
          request.unknown2 = "060101010D010106010101010101017FFF030A030301007F017FFF010501013F01030600010301".tns_unhexify
          request.unknown3 = "02010000180003".tns_unhexify
          request.unknown4 = UNKNOWN4_LINUX
        else
          raise Exceptions::UnsupportedArchitecture.new( architecture )
        end

        return request
      end

      def character_set=(charset)
        self.charset1 = charset
        self.charset2 = charset
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.012309279870273457, 'fraction_numerical': 0.7415788309869537, 'mean_word_length': 13.434042553191489, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 42, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6023641', 'n_tokens_mistral': 11603, 'n_tokens_neox': 4463, 'n_words': 200}