<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2303242</guid>
        <pubDate>Thu, 02 Jul 2009 11:23:26 +0000</pubDate>
        <title>Орущий снифер</title>
        <link>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2303242</link>
        <description><![CDATA[D.S: <strong class='tag-b'>vtg</strong> А чем тебе std::string не угодил?<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=275610&view=findpost&p=2302068'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>vtg &#064; <time class="tag-quote__quoted-time" datetime="2009-07-01T02:52:25+04:00">30.06.09, 22:52</time></span><div class='quote '>LPTSTR lpszBuffer, LPCTSTR lpBuffer</div></div> или в конце концов char или wchar_t зачем Win переопределения юзаеш?]]></description>
        <author>D.S</author>
        <category>C/C++: Сетевое программирование</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2302121</guid>
        <pubDate>Wed, 01 Jul 2009 05:28:02 +0000</pubDate>
        <title>Орущий снифер</title>
        <link>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2302121</link>
        <description><![CDATA[trainer: Нет, все-таки это непреложная истина - программировать надо начинать с прочтения хороших умных книг.<br><br>1) ты уж определись, TCHAR тебе нужен или wchar_t;<br>2) wsprintf здесь абсолютно не нужен;<br>3) преобразовывать TCHAR в TCHAR* - естественно работать не будет.]]></description>
        <author>trainer</author>
        <category>C/C++: Сетевое программирование</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2302068</guid>
        <pubDate>Tue, 30 Jun 2009 22:52:25 +0000</pubDate>
        <title>Орущий снифер</title>
        <link>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2302068</link>
        <description><![CDATA[vtg: Следующия функция должна форматировать данные буфера в текст, пропуская &quot;бипы&quot;, но прога вылетает.<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">void DataToText(LPTSTR lpszBuffer, LPCTSTR lpBuffer, int iSizeBuffer)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;for (int i = 0; i &#60; iSizeBuffer; i++)</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (lpBuffer[i] != 0x07) //0x07 is beep</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wsprintf((LPTSTR)lpszBuffer[i], _T(&quot;%c&quot;), lpBuffer[i]);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">}</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br>
Что не так?]]></description>
        <author>vtg</author>
        <category>C/C++: Сетевое программирование</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2300688</guid>
        <pubDate>Mon, 29 Jun 2009 06:50:10 +0000</pubDate>
        <title>Орущий снифер</title>
        <link>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2300688</link>
        <description><![CDATA[trainer: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=275610&view=findpost&p=2299907'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>vtg &#064; <time class="tag-quote__quoted-time" datetime="2009-06-27T20:16:06+00:00">27.06.09, 20:16</time></span><div class='quote '>Почему?</div></div>Знаковое расширение char в int. <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2009-06-29T06:51:22+00:00">29.06.09, 06:51</time></span></span><br>
лучше всего - изменить декларацию на<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">unsigned char InData[SIZE];</div></ol></div></div></div></div> <br>
<br>
<span class="tag-color tag-color-named" data-value="gray" style="color: gray"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2009-06-29T06:54:38+00:00">29.06.09, 06:54</time></span></span><br>
P.S. Спецсимволы надо как-то выделять, иначе ты не отличишь группу печатных символов от одного непечатного.]]></description>
        <author>trainer</author>
        <category>C/C++: Сетевое программирование</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2299907</guid>
        <pubDate>Sat, 27 Jun 2009 20:16:06 +0000</pubDate>
        <title>Орущий снифер</title>
        <link>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2299907</link>
        <description><![CDATA[vtg: Зачем в printf(&quot;%x&#092;&quot;, InData[i]); символ &quot;&#092;&quot;? У меня в MSVS 2008 он отменяет кавычку и получается синтаксическая ошибка.<br>
<br>
При работе printf(&quot;%x&quot;, Buffer[i]); у меня иногда проскакивают восьмизначные числа. Почему?]]></description>
        <author>vtg</author>
        <category>C/C++: Сетевое программирование</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2297722</guid>
        <pubDate>Wed, 24 Jun 2009 19:35:50 +0000</pubDate>
        <title>Орущий снифер</title>
        <link>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2297722</link>
        <description><![CDATA[Waltz: Наипростейший вариант:<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">char InData[SIZE]; &nbsp; &nbsp; &nbsp; &nbsp;// Данные</div><div class="code_line">&nbsp;</div><div class="code_line">...</div><div class="code_line">&nbsp;</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;for (int i = 0; i &#60; SIZE; i++)</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (InData[i] &#62; 0x20)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Можно выводить данный символ, так как он петачаемый</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;else</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Символы в диапазоне от 0x00 до 0x20 - невидимые</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Печатаем hex-значение</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;printf(&quot;%x\&quot;, InData[i]);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">}</div></ol></div></div></div></div><br>
<br>
Примерно так.]]></description>
        <author>Waltz</author>
        <category>C/C++: Сетевое программирование</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2297697</guid>
        <pubDate>Wed, 24 Jun 2009 18:24:38 +0000</pubDate>
        <title>Орущий снифер</title>
        <link>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2297697</link>
        <description><![CDATA[vtg: <div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '>Может быть нет смысла отображать непечатаемые символы? Делать дополнительную проверку, если символ в нужном диапазоне - выводить в виде текста. Иначе в Hex. По-моему, делается с помощью %x.</div></div><br>
Можно пример?]]></description>
        <author>vtg</author>
        <category>C/C++: Сетевое программирование</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2296076</guid>
        <pubDate>Mon, 22 Jun 2009 18:29:20 +0000</pubDate>
        <title>Орущий снифер</title>
        <link>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2296076</link>
        <description><![CDATA[Waltz: Может быть нет смысла отображать непечатаемые символы? Делать дополнительную проверку, если символ в нужном диапазоне - выводить в виде текста. Иначе в Hex. По-моему, делается с помощью %x.]]></description>
        <author>Waltz</author>
        <category>C/C++: Сетевое программирование</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2296045</guid>
        <pubDate>Mon, 22 Jun 2009 18:08:39 +0000</pubDate>
        <title>Орущий снифер</title>
        <link>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2296045</link>
        <description><![CDATA[vtg: Как тогда лучше вывести содержимое пакета на консоль без звука (в HEX и текстовом виде)?<br>Полагаю, что через printf(wsprintf). Но у меня что-то не получается (толком не умею обращаться с этими функциями). Можно пример?]]></description>
        <author>vtg</author>
        <category>C/C++: Сетевое программирование</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2295904</guid>
        <pubDate>Mon, 22 Jun 2009 15:06:25 +0000</pubDate>
        <title>Орущий снифер</title>
        <link>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2295904</link>
        <description><![CDATA[impik777: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=275610&view=findpost&p=2295897'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>vtg &#064; <time class="tag-quote__quoted-time" datetime="2009-06-22T15:01:51+00:00">22.06.09, 15:01</time></span><div class='quote '>И как точно должен выглядеть этот символ? </div></div><br>
он никогда не отображается]]></description>
        <author>impik777</author>
        <category>C/C++: Сетевое программирование</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2295897</guid>
        <pubDate>Mon, 22 Jun 2009 15:01:51 +0000</pubDate>
        <title>Орущий снифер</title>
        <link>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2295897</link>
        <description><![CDATA[vtg: <div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '>Ты в файл запиши байты и посмотри, сколько из них &quot;бипов&quot; :)</div></div><br>
А в консоли посмотреть нельзя? Или они там не отображаются?<br>
И как точно должен выглядеть этот символ?]]></description>
        <author>vtg</author>
        <category>C/C++: Сетевое программирование</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2295306</guid>
        <pubDate>Mon, 22 Jun 2009 05:33:56 +0000</pubDate>
        <title>Орущий снифер</title>
        <link>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2295306</link>
        <description><![CDATA[Core: Ты в файл запиши байты и посмотри, сколько из них &quot;бипов&quot; :)]]></description>
        <author>Core</author>
        <category>C/C++: Сетевое программирование</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2295061</guid>
        <pubDate>Sun, 21 Jun 2009 17:35:08 +0000</pubDate>
        <title>Орущий снифер</title>
        <link>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2295061</link>
        <description><![CDATA[vtg: Интересно, не знал. Но странно, что звуковой сигнал выдаётся на каждом пакете. Неужели &#39;&#092;b&#39; или что-то в этом роде встречается в каждом?]]></description>
        <author>vtg</author>
        <category>C/C++: Сетевое программирование</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2295059</guid>
        <pubDate>Sun, 21 Jun 2009 17:24:34 +0000</pubDate>
        <title>Орущий снифер</title>
        <link>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2295059</link>
        <description><![CDATA[impik777: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=275610&view=findpost&p=2295055'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>vtg &#064; <time class="tag-quote__quoted-time" datetime="2009-06-21T17:09:02+00:00">21.06.09, 17:09</time></span><div class='quote '>Если не использовать WriteFile то такого эффекта нет. </div></div><br>
<br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=275610&view=findpost&p=2295055'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>vtg &#064; <time class="tag-quote__quoted-time" datetime="2009-06-21T17:09:02+00:00">21.06.09, 17:09</time></span><div class='quote '>WriteFile(hStdout, (LPCVOID)Buffer, iCount, &amp;dwBytesWritten, 0);</div></div><br>
здесь на консоль выдается последовательность символов, <br>
среди них встречается символ beep (&#39;&#092;b&#39; - кажется)<br>
при выводе данного символа на консоль в динамики выдается звуковой сигнал.<br>
Видимо среди байтов пакетов встречаются байты со значением равным значению символа beep]]></description>
        <author>impik777</author>
        <category>C/C++: Сетевое программирование</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2295055</guid>
        <pubDate>Sun, 21 Jun 2009 17:09:02 +0000</pubDate>
        <title>Орущий снифер</title>
        <link>https://forum.sources.ru/index.php?showtopic=275610&amp;view=findpost&amp;p=2295055</link>
        <description><![CDATA[vtg: Почему при работе следующего кода, когда идут пакеты, начинает &quot;орать&quot; динамик в системнике?<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">void ShowNetwork(HANDLE hStdout) // hStdout - Хэндл командной строки</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp; &nbsp;char Buffer[MAX_PACKET_SIZE]; // Буфер для приёма данных, 64 Kb</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;WSADATA lpWSAData; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Инициализация WinSock</div><div class="code_line">&nbsp;&nbsp; &nbsp;SOCKET s; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Cлущающий сокет</div><div class="code_line">&nbsp;&nbsp; &nbsp;CHAR szHostName[MAX_PATH]; &nbsp; &nbsp;// Имя хоста (компьютера)</div><div class="code_line">&nbsp;&nbsp; &nbsp;HOSTENT* pHost; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Информация о хосте</div><div class="code_line">&nbsp;&nbsp; &nbsp;SOCKADDR_IN sa; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Адрес хоста</div><div class="code_line">&nbsp;&nbsp; &nbsp;IN_ADDR sa1; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//</div><div class="code_line">&nbsp;&nbsp; &nbsp;unsigned long flag = 1; &nbsp; &nbsp; &nbsp; // Флаг PROMISC Вкл/выкл</div><div class="code_line">&nbsp;&nbsp; &nbsp;DWORD dwBytesWritten;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;// инициализация</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (WSAStartup(MAKEWORD(2, 2), &amp;lpWSAData)==0)</div><div class="code_line">&nbsp;&nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;s = socket(AF_INET, SOCK_RAW, IPPROTO_IP);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;gethostname(szHostName, sizeof(szHostName));</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;pHost = gethostbyname(szHostName);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ZeroMemory(&amp;sa, sizeof(sa));</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;sa.sin_family = AF_INET;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;sa.sin_addr.s_addr = ((struct in_addr *)pHost-&#62;h_addr_list[0])-&#62;s_addr;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;bind(s, (SOCKADDR *)&amp;sa, sizeof(SOCKADDR));</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;// Включение promiscuous mode</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ioctlsocket(s, SIO_RCVALL, &amp;flag);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;// Бесконечный цикл приёма IP-пакетов</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;while (1 &#62; 0)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int iCount = recv(s,Buffer,65536,0);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WriteFile(hStdout, (LPCVOID)Buffer, iCount, &amp;dwBytesWritten, 0);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;printf(&quot;\n&quot;); // next line</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;//Off</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;flag = 0;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ioctlsocket(s, SIO_RCVALL, &amp;flag);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;closesocket(s);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;WSACleanup();</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div></ol></div></div></div></div><br>
Если не использовать WriteFile то такого эффекта нет.]]></description>
        <author>vtg</author>
        <category>C/C++: Сетевое программирование</category>
      </item>
	
      </channel>
      </rss>
	