芯片解密|单片机解密|IC解密|芯片破解|芯片复制| PCB抄板|软件开发

飞芯科技-芯片解密|单片机解密|IC解密|芯片破解|芯片复制| PCB抄板|软件开发

STM32+W5100S以太网芯片程序芯片解密

芯片解密单片机源程序如下:

  1. 芯片解密#include "socket.h"


  2. static uint16 local_port;

  3. extern uint16 sent_ptr;


  4.        
  5. #define __MACRAW__
  6. /**
  7. @brief   This Socket function initialize the channel in perticular mode, and set the port and wait for W5200 done it.
  8. @return  1 for sucess else 0.
  9. */

  10. void setkeepalive(SOCKET s);
  11. uint8 socket(SOCKET s, uint8 protocol, uint16 port, uint8 flag)    // 2017-07-17
  12. {
  13.    uint8 ret;
  14.    if (
  15.         ((protocol&0x0F) == Sn_MR_TCP)    ||
  16.         ((protocol&0x0F) == Sn_MR_UDP)    ||
  17.         ((protocol&0x0F) == Sn_MR_IPRAW)  ||
  18.         ((protocol&0x0F) == Sn_MR_MACRAW)
  19.       
  20.       )
  21.    {
  22.       close(s);
  23.                  
  24.                   if((protocol&0x0F)==Sn_MR_TCP)
  25.                          {
  26.          setkeepalive(s);
  27.       }
  28.       IINCHIP_WRITE(W5100S_Sn_MR(s) ,protocol | flag);
  29.       if (port != 0) {
  30.          IINCHIP_WRITE( W5100S_Sn_PORT0(s) ,(uint8)((port & 0xff00) >> 8));
  31.          IINCHIP_WRITE( W5100S_Sn_PORT1(s) ,(uint8)(port & 0x00ff));
  32.       } else {
  33.          local_port++; // if don't set the source port, set local_port number.
  34.          IINCHIP_WRITE(W5100S_Sn_PORT0(s) ,(uint8)((local_port & 0xff00) >> 8));
  35.          IINCHIP_WRITE(W5100S_Sn_PORT1(s) ,(uint8)(local_port & 0x00ff));
  36.       }
  37.       IINCHIP_WRITE( W5100S_Sn_CR(s) ,Sn_CR_OPEN); // run sockinit Sn_CR

  38.       /* wait to process the command... */
  39.       while( IINCHIP_READ(W5100S_Sn_CR(s)) )
  40.          ;
  41.       /* ------- */
  42.       ret = 1;
  43.    }
  44.    else
  45.    {
  46.       ret = 0;
  47.    }
  48.    return ret;
  49. }



联系方式

地址:石家庄市新华区民族路77号华强广场D座2009
电话:0311-88816616/87087811
手机:13315190088
传真:0311-67901001
联系人:张工
网址:www.feixindz.com
邮箱:feixindz@163.com
微信:xinpianjiemi
QQ:527263666/568069805

在线客服
热线电话

企业微信