Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. void build_packet(unsigned char *buf, unsigned short len)
  2. {
  3.     unsigned int i;
  4.     unsigned int sum;
  5.     unsigned char tmp;
  6.     unsigned char tmp1;
  7.     unsigned char tmp2;
  8.     unsigned char tmp3;
  9.     unsigned char tmp4;
  10.     unsigned char tmp5;
  11.     unsigned char tmp6;
  12.     unsigned char packet[64];
  13.  
  14.     sum = 0x0;
  15.     i = 0x6;
  16.  
  17.     /* 38 is 32 + 6 we count 32 starting from 6 */
  18.     while (i <= 38) {
  19.         sum += buf[i];
  20.  
  21.         i += 1;
  22.     }
  23.  
  24.     buf[0] = 0x12;
  25.     buf[1] = 0xc5;
  26.  
  27.     buf[5] = 0x20;
  28.  
  29.     return;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement