2 * dmsd - digital media soft decrypt
4 * author: hackbard@hackdaworld.dyndns.org
12 #include <sys/types.h>
13 #include <sys/socket.h>
14 #include <netinet/in.h>
15 #include <arpa/inet.h>
19 int main(int argc,char *argv[]) {
21 /* file descriptors */
26 struct sockaddr_in dbox_addr;
28 int status,recvd_bytes;
31 printf("usage: %s <video pid> <audio pid> <dbox ip address>\n",argv[1]);
35 //sscanf(argv[1],"%x",vpid);
37 //sscanf(argv[2],"%x",apid);
40 printf("using video pid %x & audio pid %x ...\n",vpid,apid);
42 if((v_fd=socket(AF_INET,SOCK_STREAM,0)) == -1) {
43 printf("can't open socket for video.\n");
46 if((a_fd=socket(AF_INET,SOCK_STREAM,0)) == -1) {
47 printf("can't open socket for audio.\n");
51 memset(&dbox_addr,0,sizeof(dbox_addr));
52 dbox_addr.sin_family=AF_INET;
53 dbox_addr.sin_port=htons(DBOX2_TS_PORT);
54 dbox_addr.sin_addr.s_addr=inet_addr(argv[3]);
56 if(connect(v_fd,(struct sockaddr *)&dbox_addr,sizeof(dbox_addr))==-1) {
57 printf("unable to connect. (video pid)\n");
62 dprintf(v_fd,"GET /%x HTTP/1.0\r\n\r\n",vpid);
66 unsigned char buf[BUFFER_LENGTH];
68 status=recv(v_fd,buf,sizeof(buf),0);