<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; JScript Шестнадцатеричное представление файла]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=8501&amp;type=atom" />
	<updated>2023-03-06T08:09:43Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=8501</id>
		<entry>
			<title type="html"><![CDATA[Re: JScript Шестнадцатеричное представление файла]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=157027#p157027" />
			<content type="html"><![CDATA[<p><strong>DnsIs</strong>, приветствую ! ).<br /></p><div class="quotebox"><cite>DnsIs пишет:</cite><blockquote><p>Скрипт делает дамп файла в HEX представлении. Но работает преочень долго. Можно как-нибудь ускорить?</p></blockquote></div><p>.</p><p>Как вариант, можно использовать <span class="bbu">встроенную в <strong>Windows</strong></span> утилиту <strong>certutil</strong>.</p><p>Позволяет конвертить в hex / base64.</p><p>Ссылки по теме:<br />1) <a href="https://www.dostips.com/forum/viewtopic.php?t=8521">https://www.dostips.com/forum/viewtopic.php?t=8521</a> (инфа по ограничениям и примеры)<br />2) <a href="https://learn.microsoft.com/ru-ru/windows-server/administration/windows-commands/certutil">https://learn.microsoft.com/ru-ru/windo … s/certutil</a><br />3) <a href="https://learn.microsoft.com/ru-ru/windows/win32/api/wincrypt/nf-wincrypt-cryptbinarytostringa?redirectedfrom=MSDN">https://learn.microsoft.com/ru-ru/windo … dfrom=MSDN</a></p><p>Пример вызова:<br /></p><div class="codebox"><pre><code>
certutil -encodehex &quot;file.txt&quot; &quot;file.hex&quot; 12
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Xameleon]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=8836</uri>
			</author>
			<updated>2023-03-06T08:09:43Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=157027#p157027</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: JScript Шестнадцатеричное представление файла]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=157012#p157012" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>yandibaev пишет:</cite><blockquote><p>Можно и ускорить<br /><a href="https://rsdn.org/forum/web/671507.all">HexToFile</a></p></blockquote></div><p>Уже лучше, ссылка оформлена правильно, но точка так и не появилась. Кроме того, в <a href="https://forum.script-coding.com/viewtopic.php?pid=142185#p142185">другом</a> вашем посте неплохо бы добавить оформление кода.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-03-03T22:57:56Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=157012#p157012</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: JScript Шестнадцатеричное представление файла]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=157008#p157008" />
			<content type="html"><![CDATA[<p>Удалить профиль могу без проблем (хотя нам будет очень вас не хватать, вы принесли столько полезного контента). Но никаких ссылок я пока что не удалял.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-03-03T22:36:57Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=157008#p157008</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: JScript Шестнадцатеричное представление файла]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=157007#p157007" />
			<content type="html"><![CDATA[<p>Удалите мой профиль. Не хочу с вами больше иметь дел.<br />Хотел ссылку на потоковую функцию Hex to File дать. Вы удалили.</p>]]></content>
			<author>
				<name><![CDATA[yandibaev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=41092</uri>
			</author>
			<updated>2023-03-03T22:33:07Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=157007#p157007</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: JScript Шестнадцатеричное представление файла]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=157006#p157006" />
			<content type="html"><![CDATA[<p><strong>yandibaev</strong>, ознакомьтесь, пожалуйста, с <a href="https://forum.script-coding.com/misc.php?action=rules">Правилами</a>, отредактируйте свои посты. Обратите внимание на оформление <a href="https://forum.script-coding.com/misc.php?action=rules#code-formatting">кода</a> и <a href="https://forum.script-coding.com/misc.php?action=rules#links-formatting">ссылок</a>, и на <a href="https://forum.script-coding.com/misc.php?action=rules#literacy">точки</a> в конце предложений.<br />Кроме того, поднимать посты многолетней давности — не лучшая идея. Хотите поделиться кодом — создайте новую тему.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2023-03-03T22:25:03Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=157006#p157006</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: JScript Шестнадцатеричное представление файла]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=157005#p157005" />
			<content type="html"><![CDATA[<p>Можно и ускорить<br /><a href="https://rsdn.org/forum/web/671507.all">HexToFile</a></p>]]></content>
			<author>
				<name><![CDATA[yandibaev]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=41092</uri>
			</author>
			<updated>2023-03-03T22:22:07Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=157005#p157005</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: JScript Шестнадцатеричное представление файла]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=75498#p75498" />
			<content type="html"><![CDATA[<p>list.exe из набора Debugging Tools умеет выводить содержимое файла в hex&#039;е. Какбы, есть hiew - там и функционал побогаче, с функционалом победнее - biew. На худой конец можно дампить PoSh&#039;ем (<a href="http://poshcode.org/4074">см. здесь</a>).<br />od это конечно круто, но лично мне никогда не нравились порты. Да и вообще кесарю - кесарево, ОСи - ОСевое и дыр и пыр.</p>]]></content>
			<author>
				<name><![CDATA[greg zakharov]]></name>
			</author>
			<updated>2013-09-22T16:19:35Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=75498#p75498</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: JScript Шестнадцатеричное представление файла]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=74863#p74863" />
			<content type="html"><![CDATA[<p><a href="http://www.opennet.ru/man.shtml?topic=od&amp;category=1&amp;russian=0">od</a></p><p>Есть во всех unix-портах под винду.</p>]]></content>
			<author>
				<name><![CDATA[Rumata]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24846</uri>
			</author>
			<updated>2013-08-22T09:35:40Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=74863#p74863</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: JScript Шестнадцатеричное представление файла]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=74862#p74862" />
			<content type="html"><![CDATA[<p>Наверняка у кого-нибудь есть консольная утилита с аналогичным функционалом, поделитесь пжлст.</p>]]></content>
			<author>
				<name><![CDATA[DnsIs]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26282</uri>
			</author>
			<updated>2013-08-22T08:56:32Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=74862#p74862</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: JScript Шестнадцатеричное представление файла]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=74861#p74861" />
			<content type="html"><![CDATA[<p>Сидел сегодня на работе, вспомнил про тему, накидал:<br /></p><div class="codebox"><pre><code>echo = function(t) {
    WScript.Echo(t)
}

quit = function() {
    WScript.Quit()
}

openFile = function () {
    var fop = new ActiveXObject( &quot;UserAccounts.CommonDialog&quot; );
    var OFN_NON                 =    0;
        OFN_READONLY            =    1;
        OFN_HIDEREADONLY        =    4;
        OFN_ALLOWMULTISELECT    =  512;
        OFN_FILEMUSTEXIST       = 4096;
    fop.InitialDir = &quot;C:\\&quot;;
    fop.Filter = &quot;Все файлы|*.*&quot;;
    fop.FilterIndex = 2;
    fop.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
    var rtn = fop.ShowOpen();
    return (fop.FileName || false)
}

help = function () {
    str = &quot;DUMP.JS v0.1\n\n&quot;
    str += &quot;        Usage :: DUMP.JS source [destination]\n\n&quot;;
    str += &quot;        source :: Source file (drive:\\path\\name or name)\n&quot;;
    str += &quot; destination :: Destination file (drive:\\path\\name or name)\n&quot;;
    str += &quot;                        If not specified, will be stored in\n&quot;;
    str += &quot;                        a directory for the source file\n&quot;;
    str += &quot;                        with the prefix &#039;.hex&#039;\n&quot;;
    echo (str);
    quit();
}

String.prototype.times = function(count){
  for(i = 0, result = &quot;&quot; ; i &lt; count; i++) result += this;
  return result;
}

var stream = new ActiveXObject(&quot;ADODB.stream&quot;),
    fso = new ActiveXObject(&quot;Scripting.FileSystemObject&quot;),
    DIR = WScript.ScriptFullName.replace(/(.*)\\.*/, &quot;$1&quot;) + &quot;\\&quot;,
    arg = WScript.Arguments,
    LEN = arg.length,
    ARGUMENTS = &quot;&quot;;
    BYTES = 1024 * 1024 * 1;
    INDEX = POSITION = 0,
    S = [],
    R = [],
    RAW = &quot;&quot;;
    SYMBOLS = &quot;.&quot;.times(32) + 
        &quot; !\&quot;#$%&amp;&#039;()*+,-./0123456789:;&lt;=&gt;?&quot; +
        &quot;@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_&quot; +
        &quot;`abcdefghijklmnopqrstuvwxyz{|}~.&quot; +
        &quot;ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—.™љ›њќћџ&quot; +
        &quot; ЎўЈ¤Ґ¦§Ё©Є«¬®Ї°±Ііґµ¶·ё№є»јЅѕї&quot; +
        &quot;АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ&quot; +
        &quot;абвгдежзийклмнопрстуфхцчшщъыьэюя&quot;;

if (LEN) {
    arg.Item(0).match(/[\/-]\?|h|help/) ? help() : false;
    FILE_TO_READ = arg.Item(0);
    if (LEN == 2) {
        FILE_TO_SAVE = arg.Item(1);
    } else {
        FILE_TO_SAVE = FILE_TO_READ + &quot;.hex&quot; ;
    }
} else {
    FILE_TO_READ = openFile();
    if (FILE_TO_READ) {
        FILE_TO_SAVE = FILE_TO_READ + &quot;.hex&quot; ;
    } else {
        quit()
    }
}

if (FILE_TO_READ.match(/^\S:\\/)) {
    DIR = FILE_TO_READ.replace(/(.*\\).*$/,&quot;$1&quot;)
} else {
    FILE_TO_READ = DIR + FILE_TO_READ
}

if (!FILE_TO_SAVE.match(/^\S:\\/)) {
    FILE_TO_SAVE = DIR + FILE_TO_SAVE
}

if (!fso.fileExists(FILE_TO_READ)) {
    echo (&quot;The file &quot; + FILE_TO_READ + &quot; not found.\n&quot;);
    quit();
}

SIZE = fso.GetFile(FILE_TO_READ).size;

if (fso.fileExists(FILE_TO_SAVE)) {
    echo (&quot;The file &quot; + FILE_TO_SAVE + &quot; already exists.\nWill not be recorded.\n&quot;);
    quit();
} else {
    try {
        file = fso.CreateTextFile(FILE_TO_SAVE);
    } catch(e) {
        echo (&quot;Can not create file &quot; + FILE_TO_SAVE, 1);
        quit();
    }
}


str = &quot;Offset (h) 00 01 02 03 04 05 06 07   08 09 0A 0B 0C 0D 0E 0F&quot;;
file.WriteLine(str)

for (b = 0; b &lt; SIZE; b += BYTES) {
    stream = new ActiveXObject(&quot;ADODB.stream&quot;);
    stream.Type = 2;
    stream.Charset = &#039;ISO-8859-1&#039;;
    stream.Open();
    stream.LoadFromFile(FILE_TO_READ);
    stream.Position = 0;
    stream.Charset = &#039;ascii&#039;;
    stream.Position = POSITION + BYTES * b;
    s1 = stream.ReadText(BYTES);
    stream.Position = 0;
    stream.Charset = &#039;iso-8859-1&#039;;
    stream.Position = POSITION + BYTES * b;
    s2 = stream.ReadText(BYTES);
    stream.Close();
    str = &quot;&quot;; s = r = &quot;&quot;;
    len = s1.length;
    for (i = 0; i &lt; len; i++) {
        SYM = (s1.charCodeAt(i) | (s2.charCodeAt(i) &lt; 0x80 ? 0 : 0x80));
        S[i] = SYM.toString(16).slice(-2).toUpperCase();
        R[i] = SYMBOLS.charAt(SYM.toString(10));
    }

    while (S.length != 0) {
        str += (&quot;0000000&quot; + (INDEX).toString(16)).slice(-8).toUpperCase() + &quot;:  &quot;;
        INDEX += 16;
        for (i = 0; (i &lt; 16) &amp;&amp; (S.length != 0); i++) {
            SYM = (&quot;0&quot; + S.shift()).slice(-2)
            str += ((i == 8) ? &quot;  &quot; + SYM : SYM) + &quot; &quot;;
            RAW += R.shift();
        }
        str += &quot; &quot;.times(51 - RAW.length * 3) + RAW + &quot;\n&quot;;
        RAW = &quot;&quot;;
    }
    R = []; S = [];
    file.WriteLine(str)
}
echo(&quot;Ok&quot;);
quit()</code></pre></div><p>Скрипт делает дамп файла в HEX представлении. Но работает преочень долго. Можно как-нибудь ускорить?</p>]]></content>
			<author>
				<name><![CDATA[DnsIs]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26282</uri>
			</author>
			<updated>2013-08-22T08:55:26Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=74861#p74861</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: JScript Шестнадцатеричное представление файла]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=74005#p74005" />
			<content type="html"><![CDATA[<p>Судя по всему, при чтении файла указание кодировки определяет только, будет ли в начало буфера поставлен BOM. С самим файлом ничего не делается. Перекодирование происходит, когда вы читаете из Stream в строку или пишете из строки в Stream. Строки в JScript кодируются в UTF-16. Если кодировка Stream указана иная, то при чтении и записи будет перекодирование.</p><p>Кодировка &quot;ascii&quot; семибитная, т.е. из каждого байта берутся младшие 7 битов. Строка s2, считанная как iso-8859-1, используется для того, чтобы определить, в какие из этих байтов нужно добавить 8-й бит. Это те, которые по iso-8859-1 сконвертировались в Юникод с кодом больше 127. Если бы это была настоящая iso-8859-1, то такие ухищрения были бы не нужны, т.к. у неё коды символов совпадают с первыми 256 кодами Юникода. Так что её конвертация в Юникод — это просто добавка нулевого байта, а числовое значение кода остаётся тем же. Но фактически при указании iso-8859-1 используется windows-1252, а у неё часть кодов из верхней половины таблицы конвертируется в Юникод за пределами первых 256. Так что значение кода символа в строке уже не всегда совпадает со значением байта в файле. Поэтому и нужен трюк с ascii.</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2013-07-23T14:18:50Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=74005#p74005</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: JScript Шестнадцатеричное представление файла]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=74002#p74002" />
			<content type="html"><![CDATA[<p>Странно, мне казалось, что кодировка задается непосредственно перед чтением:<br /></p><div class="codebox"><pre><code>
stream.Charset = &#039;ascii&#039;;
s1 = stream.ReadText();
...
stream.Charset = &#039;iso-8859-1&#039;;
s2 = stream.ReadText();</code></pre></div><p>Разве нет?</p>]]></content>
			<author>
				<name><![CDATA[DnsIs]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26282</uri>
			</author>
			<updated>2013-07-23T13:44:20Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=74002#p74002</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: JScript Шестнадцатеричное представление файла]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=74001#p74001" />
			<content type="html"><![CDATA[<p>По умолчанию кодировка Stream — Unicode, поэтому в начало добавляются байты FF FE. Других различий я не заметил.</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2013-07-23T11:37:18Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=74001#p74001</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: JScript Шестнадцатеричное представление файла]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=74000#p74000" />
			<content type="html"><![CDATA[<p>* Не выводилась последняя строка, исправил<br />+ Добавил вывод исходных данных<br /></p><div class="codebox"><pre><code>if (WScript.FullName.toLowerCase().indexOf(&quot;cscript.exe&quot;) &lt; 0) {
    var wsh = WScript.CreateObject(&quot;WScript.Shell&quot;);
    wsh.Run (&quot;CScript.exe &quot; + &quot;\&quot;&quot; + WScript.ScriptFullName + &quot;\&quot;&quot;);
    WScript.Quit();
}
eh = function (t) {WScript.Echo(t)}
stream = new ActiveXObject(&quot;ADODB.stream&quot;);

String.prototype.times = function(count){
    for(var i=0,result=&#039;&#039;; i&lt;count; i++) result += this;
    return result;
}

FILE_TO_READ = &#039;bin.dat&#039;;

//========== Скопипастил от сих
stream.Type = 2;
stream.Charset = &#039;ISO-8859-1&#039;; // Если эту строку удалить, то будет неправильный результат. Почему?
stream.Open();
stream.LoadFromFile(FILE_TO_READ);
stream.Position = 0;
stream.Charset = &#039;ascii&#039;;
s1 = stream.ReadText();
stream.Position = 0;
stream.Charset = &#039;iso-8859-1&#039;;
s2 = stream.ReadText();
stream.Close();
//========== До сих
cap = &quot;Offset (h) &quot;;
for (i = 0; i &lt; 16; i++) {
    cap += (&quot;0&quot; + i.toString(16)).slice(-2).toUpperCase() + &quot; &quot;;
    if (i == 7) cap += &quot;  &quot;;
}
eh (cap)
str = raw = &quot;&quot;;
for(var i = 0; i &lt; s1.length; i++){
    if ((i == 0) || !(i % 16)) {
        eh (str + raw);
        str = (&quot;0000000&quot; + (i).toString(16)).slice(-8).toUpperCase()+ &quot;:  &quot;;
        raw = &quot;&quot;
    }
    raw += s2.charAt(i).toString();
    str += (&#039;0&#039;+(s1.charCodeAt(i)|(s2.charCodeAt(i)&lt;0x80?0:0x80)).toString(16)).slice(-2).toUpperCase() + &quot; &quot;;
    if ((i != 0) &amp;&amp; !((i+1) % 8)) {str += &quot;  &quot;}
}
eh (str + &quot; &quot;.times(63 - str.length) + raw)
WScript.StdIn.Read(1);
WScript.Quit()</code></pre></div>]]></content>
			<author>
				<name><![CDATA[DnsIs]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26282</uri>
			</author>
			<updated>2013-07-23T11:09:53Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=74000#p74000</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[JScript Шестнадцатеричное представление файла]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=73999#p73999" />
			<content type="html"><![CDATA[<p>Как продолжение <a href="http://forum.script-coding.com/viewtopic.php?id=8491">темы</a></p><div class="codebox"><pre><code>if (WScript.FullName.toLowerCase().indexOf(&quot;cscript.exe&quot;) &lt; 0) {
    var wsh = WScript.CreateObject(&quot;WScript.Shell&quot;);
    wsh.Run (&quot;CScript.exe &quot; + &quot;\&quot;&quot; + WScript.ScriptFullName + &quot;\&quot;&quot;);
    WScript.Quit();
}
eh = function (t) {WScript.Echo(t)}
stream = new ActiveXObject(&quot;ADODB.stream&quot;);

FILE_TO_READ = &#039;bin.dat&#039;;

//=========================== Копипаст от сих

stream.Type = 2;
stream.Charset = &#039;ISO-8859-1&#039;; // Если эту строку удалить, то будет неправильный результат. Почему?
stream.Open();
stream.LoadFromFile(FILE_TO_READ);
stream.Position = 0;
stream.Charset = &#039;ascii&#039;;
stream.Position = this.position;
s1 = stream.ReadText();
stream.Position = 0;
stream.Charset = &#039;iso-8859-1&#039;;
stream.Position = this.position;
s2 = stream.ReadText();
stream.Close();
//=========================== До сих
cap = &quot;Offset (h)\t&quot;;
for (i = 0; i &lt; 16; i++) {
    cap += (&quot;0&quot; + i.toString(16)).slice(-2).toUpperCase() + &quot; &quot;;
    if (i == 7) cap += &quot;  &quot;;
}
eh (cap)
str = &quot;&quot;
for(var i = 0; i &lt; s1.length; i++){
    if ((i == 0) || !(i % 16)) {
        eh (str);
        str = &quot; &quot; + (&quot;0000000&quot; + (i).toString(16)).slice(-8).toUpperCase()+ &quot;:\t&quot;
    }
    str += (&#039;0&#039;+(s1.charCodeAt(i)|(s2.charCodeAt(i)&lt;0x80?0:0x80)).toString(16)).slice(-2).toUpperCase() + &quot; &quot;;
    if ((i != 0) &amp;&amp; !((i+1) % 8)) {str += &quot;  &quot;}
}
WScript.StdIn.Read(1);
WScript.Quit()</code></pre></div><p>Выводит файл из переменной <strong>FILE_TO_READ</strong> в шестнадцатеричном виде в консоль.</p><p>Прошу раскритиковать в пух и прах.<br />Кусок кода, который нашел в просторах интернета (помечен в комментариях скрипта), мне не до конца понятен.<br />Тому кто сможет вкратце рассказать, почему он делает то, что делает заранее большущее спасибо.<br />Например строка <strong>&quot;stream.Charset = &#039;ISO-8859-1&#039;&quot;</strong> вообще непонятно для чего нужна.</p>]]></content>
			<author>
				<name><![CDATA[DnsIs]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=26282</uri>
			</author>
			<updated>2013-07-23T10:08:27Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=73999#p73999</id>
		</entry>
</feed>
