Module: E:\source\work\pcpd16\pcpd.cpp GROUP: 'DGROUP' CONST,CONST2,_DATA,_BSS Segment: pcpd_TEXT BYTE USE16 0000093B bytes #define STRICT #include #include "winsock.h" #include #include #include #define LISTEN_PORT 2522 int cons=0; int seq=0; //sequencer struct Connection { SOCKET s; int seq; int conidx; char destination[256]; long filesize; char tmpdatafilename[256]; HFILE hf; long databytes; enum { recv_dest, recv_filesize, recv_data } state; Connection(SOCKET ss) : s(ss), seq((::seq+=2)-2), filesize(0), hf(HFILE_ERROR), databytes(0), state(recv_dest) { destination[0]='\0'; tmpdatafilename[0]='\0'; } }; Connection *con[128]; //connections HWND hwnd=NULL; //handle of main window SOCKET ss=INVALID_SOCKET; //server socket static void socketMessageBox(HWND hwnd, const char *m, const char *title, UINT style) { 0000 void far socketMessageBox( HWND__ const near *, char const far *, char const far *, int unsigned ): 0000 55 push bp 0001 89 E5 mov bp,sp 0003 52 push dx 0004 56 push si 0005 57 push di 0006 81 EC 02 01 sub sp,0x0102 000A 89 C7 mov di,ax 000C 89 DE mov si,bx 000E 89 4E F8 mov -0x8[bp],cx char msg[256]; int e=WSAGetLastError(); 0011 9A 00 00 00 00 call WSAGETLASTERROR wsprintf(msg,"%s\nLast socket error code=%d",m,e); 0016 50 push ax 0017 FF 76 F8 push word ptr -0x8[bp] 001A 56 push si 001B 68 00 00 push seg L$66 001E 68 00 00 push offset L$66 0021 1E push ds 0022 8D B6 F8 FE lea si,-0x108[bp] 0026 56 push si 0027 9A 00 00 00 00 call _wsprintf 002C 83 C4 0E add sp,0x000e MessageBox(hwnd,msg,title,style); 002F 57 push di 0030 1E push ds 0031 8D B6 F8 FE lea si,-0x108[bp] 0035 56 push si 0036 FF 76 06 push word ptr 0x6[bp] 0039 FF 76 04 push word ptr 0x4[bp] 003C FF 76 08 push word ptr 0x8[bp] 003F 9A 00 00 00 00 call MESSAGEBOX } 0044 8D 66 FA lea sp,-0x6[bp] 0047 5F pop di 0048 5E pop si 0049 5A pop dx 004A 5D pop bp 004B C2 06 00 ret 0x00000006 static void dereg(Connection *c) { 004E void far dereg( Connection far * ): 004E 53 push bx 004F 56 push si 0050 89 C3 mov bx,ax 0052 8E C2 mov es,dx for(int i=c->conidx; iconidx=i; 0076 8B B7 00 00 mov si,Connection far * far con[][bx] 007A 8E C2 mov es,dx 007C 26 89 44 04 mov es:0x4[si],ax } 0080 FF 06 00 00 inc word ptr int far cons 0084 EB D7 jmp L$1 cons--; 0086 L$2: 0086 89 36 00 00 mov int far cons,si } 008A 5E pop si 008B 5B pop bx 008C C3 ret void handleConnection(Connection *c, WORD event, WORD /*error*/) { Routine Size: 141 bytes, Routine Base: pcpd_TEXT + 0000 008D void far handleConnection( Connection far *, short unsigned, short unsigned ): 008D 45 inc bp 008E 55 push bp 008F 89 E5 mov bp,sp 0091 56 push si 0092 57 push di 0093 81 EC 14 03 sub sp,0x0314 0097 89 C6 mov si,ax 0099 89 56 F8 mov -0x8[bp],dx 009C 05 06 00 add ax,0x0006 009F 8D BC 0A 01 lea di,0x10a[si] 00A3 89 46 F2 mov -0xe[bp],ax if(event==FD_READ) { 00A6 83 FB 01 cmp bx,0x0001 00A9 0F 84 2E 02 je L$16 readagain: switch(c->state) { case Connection::recv_dest: { char buf[2]; int bytes=recv(c->s,buf,1,0); if(bytes<0) { if(WSAGetLastError()==WSAEWOULDBLOCK) return; } else if(bytes==0) { } else { if(buf[0]=='\r') { //ignore } else if(buf[0]=='\n') { c->state=Connection::recv_filesize; } else if(lstrlen(c->destination)<128) { buf[1]='\0'; lstrcat(c->destination,buf); } } break; } case Connection::recv_filesize: { char buf[1]; int bytes=recv(c->s,buf,1,0); if(bytes<0) { if(WSAGetLastError()==WSAEWOULDBLOCK) return; } else if(bytes==0) { } else { if(buf[0]=='\r') { //ignore } else if(buf[0]=='\n') { c->state=Connection::recv_data; } else c->filesize = c->filesize*10 + (buf[0]-'0'); } break; } case Connection::recv_data: { if(c->tmpdatafilename[0]=='\0') { wsprintf(c->tmpdatafilename,"\\spool\\nlpd\\tmp%04d",c->seq); c->hf = _lcreat(c->tmpdatafilename,0); if(c->hf==HFILE_ERROR) { closesocket(c->s); dereg(c); char msg[256]; wsprintf(msg,"Could not create temporary file '%s'",c->tmpdatafilename); MessageBox(hwnd,msg,"pcpd error",MB_OK|MB_ICONSTOP); delete c; return; } } static char buf[4096]; int bytes; bytes = recv(c->s,buf,4096,0); if(bytes<0) { if(WSAGetLastError()==WSAEWOULDBLOCK) return; } else if(bytes==0) { } else { c->databytes += bytes; UINT b=_lwrite(c->hf,buf,bytes); if(bhf); remove(c->tmpdatafilename); closesocket(c->s); dereg(c); MessageBox(hwnd,"Could not write to temporary file\nMaybe the disk is full?","pcpd error",MB_OK|MB_ICONSTOP); delete c; return; } } break; } } //on some occations me may receive a close-notify before the last read-notify //Try to avoid it by peeking and looping unsigned long nread=0; int rc=ioctlsocket(c->s,FIONREAD,&nread); if(rc==0 && nread>0) { goto readagain; } } else if(event==FD_CLOSE) { 00AD 83 FB 20 cmp bx,0x0020 00B0 0F 84 43 02 je L$18 00B4 E9 E0 01 jmp L$14 00B7 L$3: 00B7 26 FF 34 push word ptr es:[si] 00BA 1E push ds 00BB 8D 56 EC lea dx,-0x14[bp] 00BE 52 push dx 00BF 6A 01 push 0x00000001 00C1 6A 00 push 0x00000000 00C3 9A 00 00 00 00 call RECV 00C8 85 C0 test ax,ax 00CA 7C 63 jl L$6 00CC 74 15 je L$4 00CE 80 7E EC 0D cmp byte ptr -0x14[bp],0x0d 00D2 74 0F je L$4 00D4 80 7E EC 0A cmp byte ptr -0x14[bp],0x0a 00D8 75 63 jne L$7 00DA 8E 46 F8 mov es,-0x8[bp] 00DD 26 C6 84 10 02 01 mov byte ptr es:0x210[si],0x01 00E3 L$4: 00E3 C7 46 E8 00 00 mov word ptr -0x18[bp],0x0000 00E8 8E 46 F8 mov es,-0x8[bp] 00EB C7 46 EA 00 00 mov word ptr -0x16[bp],0x0000 00F0 26 FF 34 push word ptr es:[si] 00F3 68 04 40 push 0x00004004 00F6 68 7F 66 push 0x0000667f 00F9 1E push ds 00FA 8D 56 E8 lea dx,-0x18[bp] 00FD 52 push dx 00FE 9A 00 00 00 00 call IOCTLSOCKET 0103 85 C0 test ax,ax 0105 0F 85 8E 01 jne L$14 0109 83 7E EA 00 cmp word ptr -0x16[bp],0x0000 010D 77 0C ja L$5 010F 0F 85 84 01 jne L$14 0113 83 7E E8 00 cmp word ptr -0x18[bp],0x0000 0117 0F 86 7C 01 jbe L$14 011B L$5: 011B 8E 46 F8 mov es,-0x8[bp] 011E 26 8A 84 10 02 mov al,es:0x210[si] 0123 3C 01 cmp al,0x01 0125 0F 83 C1 01 jae L$17 0129 84 C0 test al,al 012B 74 8A je L$3 012D EB B4 jmp L$4 012F L$6: 012F 9A 00 00 00 00 call WSAGETLASTERROR 0134 3D 33 27 cmp ax,0x2733 0137 0F 84 5C 01 je L$14 013B EB A6 jmp L$4 013D L$7: 013D FF 76 F6 push word ptr -0xa[bp] 0140 FF 76 F4 push word ptr -0xc[bp] 0143 9A 00 00 00 00 call LSTRLEN 0148 3D 80 00 cmp ax,0x0080 014B 7D 96 jge L$4 014D FF 76 F6 push word ptr -0xa[bp] 0150 FF 76 F4 push word ptr -0xc[bp] 0153 1E push ds 0154 8D 56 EC lea dx,-0x14[bp] 0157 52 push dx 0158 C6 46 ED 00 mov byte ptr -0x13[bp],0x00 015C 9A 00 00 00 00 call LSTRCAT 0161 EB 80 jmp L$4 0163 L$8: 0163 26 FF 34 push word ptr es:[si] 0166 1E push ds 0167 8D 56 FA lea dx,-0x6[bp] 016A 52 push dx 016B 6A 01 push 0x00000001 016D 6A 00 push 0x00000000 016F 9A 00 00 00 00 call RECV 0174 85 C0 test ax,ax 0176 7C B7 jl L$6 0178 0F 84 67 FF je L$4 017C 80 7E FA 0D cmp byte ptr -0x6[bp],0x0d 0180 0F 84 5F FF je L$4 0184 80 7E FA 0A cmp byte ptr -0x6[bp],0x0a 0188 75 0C jne L$9 018A 8E 46 F8 mov es,-0x8[bp] 018D 26 C6 84 10 02 02 mov byte ptr es:0x210[si],0x02 0193 E9 4D FF jmp L$4 0196 L$9: 0196 8E 46 F8 mov es,-0x8[bp] 0199 BB 0A 00 mov bx,0x000a 019C 31 C9 xor cx,cx 019E 26 8B 84 06 01 mov ax,es:0x106[si] 01A3 26 8B 94 08 01 mov dx,es:0x108[si] 01A8 9A 00 00 00 00 call __I4M 01AD 89 C3 mov bx,ax 01AF 8A 46 FA mov al,-0x6[bp] 01B2 30 E4 xor ah,ah 01B4 2D 30 00 sub ax,0x0030 01B7 89 D7 mov di,dx 01B9 99 cwd 01BA 01 C3 add bx,ax 01BC 11 D7 adc di,dx 01BE 26 89 9C 06 01 mov es:0x106[si],bx 01C3 26 89 BC 08 01 mov es:0x108[si],di 01C8 E9 18 FF jmp L$4 01CB L$10: 01CB 26 80 BC 0A 01 00 cmp byte ptr es:0x10a[si],0x00 01D1 75 34 jne L$11 01D3 26 FF 74 02 push word ptr es:0x2[si] 01D7 68 00 00 push seg L$66 01DA 68 1D 00 push offset L$67 01DD FF 76 F0 push word ptr -0x10[bp] 01E0 FF 76 EE push word ptr -0x12[bp] 01E3 9A 00 00 00 00 call _wsprintf 01E8 83 C4 0A add sp,0x000a 01EB FF 76 F0 push word ptr -0x10[bp] 01EE FF 76 EE push word ptr -0x12[bp] 01F1 6A 00 push 0x00000000 01F3 9A 00 00 00 00 call _LCREAT 01F8 8E 46 F8 mov es,-0x8[bp] 01FB 26 89 84 0A 02 mov es:0x20a[si],ax 0200 3D FF FF cmp ax,0xffff 0203 0F 84 98 00 je L$15 0207 L$11: 0207 8E 46 F8 mov es,-0x8[bp] 020A 26 FF 34 push word ptr es:[si] 020D 1E push ds 020E 68 00 00 push offset char far void far handleConnection( Connection far *, short unsigned, short unsigned )::.16::buf[] 0211 68 00 10 push 0x00001000 0214 6A 00 push 0x00000000 0216 9A 00 00 00 00 call RECV 021B 89 C7 mov di,ax 021D 85 C0 test ax,ax 021F 0F 8C 0C FF jl L$6 0223 0F 84 BC FE je L$4 0227 8E 46 F8 mov es,-0x8[bp] 022A 26 FF B4 0A 02 push word ptr es:0x20a[si] 022F 1E push ds 0230 68 00 00 push offset char far void far handleConnection( Connection far *, short unsigned, short unsigned )::.16::buf[] 0233 99 cwd 0234 57 push di 0235 26 01 84 0C 02 add es:0x20c[si],ax 023A 26 11 94 0E 02 adc es:0x20e[si],dx 023F 9A 00 00 00 00 call _LWRITE 0244 39 F8 cmp ax,di 0246 0F 83 99 FE jae L$4 024A 8E 46 F8 mov es,-0x8[bp] 024D 26 FF B4 0A 02 push word ptr es:0x20a[si] 0252 9A 00 00 00 00 call _LCLOSE 0257 8B 56 F8 mov dx,-0x8[bp] 025A 8D 84 0A 01 lea ax,0x10a[si] 025E 9A 00 00 00 00 call remove_ 0263 8E 46 F8 mov es,-0x8[bp] 0266 26 FF 34 push word ptr es:[si] 0269 9A 00 00 00 00 call CLOSESOCKET 026E 8B 56 F8 mov dx,-0x8[bp] 0271 89 F0 mov ax,si 0273 E8 00 00 call void far dereg( Connection far * ) 0276 FF 36 00 00 push word ptr HWND__ const near * far hwnd 027A 68 00 00 push seg L$66 027D 68 6C 00 push offset L$71 0280 68 00 00 push seg L$66 0283 68 61 00 push offset L$70 0286 L$12: 0286 6A 10 push 0x00000010 0288 9A 00 00 00 00 call MESSAGEBOX 028D L$13: 028D 8B 56 F8 mov dx,-0x8[bp] 0290 89 F0 mov ax,si 0292 9A 00 00 00 00 call void far operator delete( void far * ) 0297 L$14: 0297 8D 66 FC lea sp,-0x4[bp] 029A 5F pop di 029B 5E pop si 029C 5D pop bp 029D 4D dec bp 029E CB retf 029F L$15: 029F 26 FF 34 push word ptr es:[si] 02A2 9A 00 00 00 00 call CLOSESOCKET 02A7 8B 56 F8 mov dx,-0x8[bp] 02AA 89 F0 mov ax,si 02AC E8 00 00 call void far dereg( Connection far * ) 02AF FF 76 F0 push word ptr -0x10[bp] 02B2 FF 76 EE push word ptr -0x12[bp] 02B5 68 00 00 push seg L$66 02B8 68 31 00 push offset L$68 02BB 1E push ds 02BC 8D 96 E8 FE lea dx,-0x118[bp] 02C0 52 push dx 02C1 9A 00 00 00 00 call _wsprintf 02C6 83 C4 0C add sp,0x000c 02C9 FF 36 00 00 push word ptr HWND__ const near * far hwnd 02CD 1E push ds 02CE 8D 96 E8 FE lea dx,-0x118[bp] 02D2 52 push dx 02D3 68 00 00 push seg L$66 02D6 68 56 00 push offset L$69 02D9 EB AB jmp L$12 02DB L$16: 02DB 89 46 F4 mov -0xc[bp],ax 02DE 89 56 F6 mov -0xa[bp],dx 02E1 89 7E EE mov -0x12[bp],di 02E4 89 56 F0 mov -0x10[bp],dx 02E7 E9 31 FE jmp L$5 02EA L$17: 02EA 0F 86 75 FE jbe L$8 02EE 3C 02 cmp al,0x02 02F0 0F 84 D7 FE je L$10 02F4 E9 EC FD jmp L$4 closesocket(c->s); 02F7 L$18: 02F7 8E C2 mov es,dx 02F9 26 FF 34 push word ptr es:[si] 02FC 9A 00 00 00 00 call CLOSESOCKET c->s=INVALID_SOCKET; 0301 8E 46 F8 mov es,-0x8[bp] dereg(c); 0304 89 F0 mov ax,si 0306 8C C2 mov dx,es 0308 26 C7 04 FF FF mov word ptr es:[si],0xffff 030D E8 00 00 call void far dereg( Connection far * ) if(c->state==Connection::recv_data) { 0310 8E 46 F8 mov es,-0x8[bp] 0313 26 80 BC 10 02 02 cmp byte ptr es:0x210[si],0x02 0319 0F 85 70 FF jne L$13 _lclose(c->hf); 031D 26 FF B4 0A 02 push word ptr es:0x20a[si] 0322 9A 00 00 00 00 call _LCLOSE c->hf=HFILE_ERROR; 0327 8E 46 F8 mov es,-0x8[bp] 032A 26 C7 84 0A 02 FF FF mov word ptr es:0x20a[si],0xffff 0331 26 8B 84 0E 02 mov ax,es:0x20e[si] if(c->databytesfilesize) { 0336 26 8B 94 0C 02 mov dx,es:0x20c[si] 033B 26 3B 84 08 01 cmp ax,es:0x108[si] 0340 7C 09 jl L$19 0342 75 13 jne L$20 0344 26 3B 94 06 01 cmp dx,es:0x106[si] 0349 73 0C jae L$20 remove(c->tmpdatafilename); 034B L$19: 034B 89 F8 mov ax,di 034D 8C C2 mov dx,es 034F 9A 00 00 00 00 call remove_ } else { char datafilename[256]; char controlfilename[256]; wsprintf(datafilename,"\\spool\\nlpd\\dfa%04d",c->seq); wsprintf(controlfilename,"\\spool\\nlpd\\cfa%04d",c->seq+1); rename(c->tmpdatafilename,datafilename); //create control file HFILE hf=_lcreat(controlfilename,0); _lwrite(hf,"Ndest/",6); _lwrite(hf,c->destination,lstrlen(c->destination)); _lwrite(hf,"\n",1); _lclose(hf); } } delete c; } 0354 E9 36 FF jmp L$13 0357 L$20: 0357 26 FF 74 02 push word ptr es:0x2[si] 035B 68 00 00 push seg L$66 035E 68 A6 00 push offset L$72 0361 1E push ds 0362 8D 96 E8 FD lea dx,-0x218[bp] 0366 52 push dx 0367 9A 00 00 00 00 call _wsprintf 036C 8E 46 F8 mov es,-0x8[bp] 036F 26 8B 44 02 mov ax,es:0x2[si] 0373 83 C4 0A add sp,0x000a 0376 40 inc ax 0377 50 push ax 0378 68 00 00 push seg L$66 037B 68 BA 00 push offset L$73 037E 1E push ds 037F 8D 96 E8 FC lea dx,-0x318[bp] 0383 52 push dx 0384 9A 00 00 00 00 call _wsprintf 0389 8D 9E E8 FD lea bx,-0x218[bp] 038D 8B 56 F8 mov dx,-0x8[bp] 0390 83 C4 0A add sp,0x000a 0393 8C D9 mov cx,ds 0395 89 F8 mov ax,di 0397 9A 00 00 00 00 call rename_ 039C 1E push ds 039D 8D 96 E8 FC lea dx,-0x318[bp] 03A1 52 push dx 03A2 6A 00 push 0x00000000 03A4 9A 00 00 00 00 call _LCREAT 03A9 50 push ax 03AA 68 00 00 push seg L$66 03AD 68 CE 00 push offset L$74 03B0 6A 06 push 0x00000006 03B2 89 C7 mov di,ax 03B4 9A 00 00 00 00 call _LWRITE 03B9 57 push di 03BA FF 76 F8 push word ptr -0x8[bp] 03BD FF 76 F2 push word ptr -0xe[bp] 03C0 FF 76 F8 push word ptr -0x8[bp] 03C3 FF 76 F2 push word ptr -0xe[bp] 03C6 9A 00 00 00 00 call LSTRLEN 03CB 50 push ax 03CC 9A 00 00 00 00 call _LWRITE 03D1 57 push di 03D2 68 00 00 push seg L$66 03D5 68 D5 00 push offset L$75 03D8 6A 01 push 0x00000001 03DA 9A 00 00 00 00 call _LWRITE 03DF 57 push di 03E0 9A 00 00 00 00 call _LCLOSE 03E5 E9 A5 FE jmp L$13 } #define WM_SERVER (WM_USER+1) #define WM_CONNECTION (WM_USER+2) void handleServer(SOCKET ss, WORD event, WORD /*error*/) { Routine Size: 859 bytes, Routine Base: pcpd_TEXT + 008D 03E8 void far handleServer( int unsigned, short unsigned, short unsigned ): 03E8 45 inc bp 03E9 55 push bp 03EA 89 E5 mov bp,sp 03EC 51 push cx 03ED 56 push si 03EE 83 EC 14 sub sp,0x0014 if(event==FD_ACCEPT) { 03F1 83 FA 08 cmp dx,0x0008 03F4 0F 85 EE 00 jne L$26 //new connection sockaddr client; int namelen=sizeof(client); SOCKET s_client; if((s_client=accept(ss,&client,&namelen))==INVALID_SOCKET) { 03F8 50 push ax 03F9 1E push ds 03FA 8D 56 E8 lea dx,-0x18[bp] 03FD 52 push dx 03FE 1E push ds 03FF 8D 56 F8 lea dx,-0x8[bp] 0402 52 push dx 0403 C7 46 F8 10 00 mov word ptr -0x8[bp],0x0010 0408 9A 00 00 00 00 call ACCEPT 040D 89 C6 mov si,ax 040F 89 46 FA mov -0x6[bp],ax 0412 3D FF FF cmp ax,0xffff 0415 0F 84 CD 00 je L$26 //nothing return; } if(cons==128) { 0419 81 3E 00 00 80 00 cmp word ptr int far cons,0x0080 041F 0F 84 A6 00 je L$24 closesocket(s_client); MessageBox(hwnd,"Too many simultaneous connections","pcpd error",MB_OK|MB_ICONSTOP); return; } Connection *c=new Connection(s_client); 0423 B8 12 02 mov ax,0x0212 0426 9A 00 00 00 00 call void far * far operator new( int unsigned ) 042B 89 C3 mov bx,ax 042D 85 D2 test dx,dx 042F 75 04 jne L$21 0431 85 C0 test ax,ax 0433 74 45 je L$22 0435 L$21: 0435 8E C2 mov es,dx 0437 26 89 37 mov es:[bx],si 043A A1 00 00 mov ax,int far seq 043D 26 89 47 02 mov es:0x2[bx],ax 0441 83 06 00 00 02 add word ptr int far seq,0x0002 0446 26 C7 87 06 01 00 00 mov word ptr es:0x106[bx],0x0000 044D 26 C7 87 08 01 00 00 mov word ptr es:0x108[bx],0x0000 0454 26 C7 87 0A 02 FF FF mov word ptr es:0x20a[bx],0xffff 045B 26 C7 87 0C 02 00 00 mov word ptr es:0x20c[bx],0x0000 0462 26 C7 87 0E 02 00 00 mov word ptr es:0x20e[bx],0x0000 0469 26 C6 87 10 02 00 mov byte ptr es:0x210[bx],0x00 046F 26 C6 47 06 00 mov byte ptr es:0x6[bx],0x00 0474 26 C6 87 0A 01 00 mov byte ptr es:0x10a[bx],0x00 if(!c) { 047A L$22: 047A 85 D2 test dx,dx 047C 75 04 jne L$23 047E 85 DB test bx,bx 0480 74 6C je L$27 MessageBox(hwnd,"Not enough memory to register new connection","pcpd error",MB_OK|MB_ICONSTOP); return; } c->conidx=cons; con[cons++]=c; if(WSAAsyncSelect(s_client,hwnd,WM_CONNECTION,FD_READ|FD_CLOSE)) { 0482 L$23: 0482 FF 76 FA push word ptr -0x6[bp] 0485 A1 00 00 mov ax,int far cons 0488 8E C2 mov es,dx 048A 89 C6 mov si,ax 048C 26 89 47 04 mov es:0x4[bx],ax 0490 C1 E6 02 shl si,0x0002 0493 FF 36 00 00 push word ptr HWND__ const near * far hwnd 0497 40 inc ax 0498 68 02 04 push 0x00000402 049B 89 9C 00 00 mov Connection far * far con[][si],bx 049F 6A 00 push 0x00000000 04A1 89 94 02 00 mov Connection far * far con[]+0x2[si],dx 04A5 6A 21 push 0x00000021 04A7 A3 00 00 mov int far cons,ax 04AA 9A 00 00 00 00 call WSAASYNCSELECT 04AF 85 C0 test ax,ax 04B1 74 33 je L$26 socketMessageBox(hwnd,"Could not set event notification mask on socket","pcpd error",MB_OK|MB_ICONSTOP); 04B3 6A 10 push 0x00000010 04B5 BB 47 01 mov bx,offset L$81 04B8 68 00 00 push seg L$66 04BB B9 00 00 mov cx,seg L$66 04BE 68 3C 01 push offset L$80 04C1 A1 00 00 mov ax,HWND__ const near * far hwnd 04C4 E8 00 00 call void far socketMessageBox( HWND__ const near *, char const far *, char const far *, int unsigned ) } 04C7 EB 1D jmp L$26 04C9 L$24: 04C9 50 push ax 04CA 9A 00 00 00 00 call CLOSESOCKET 04CF FF 36 00 00 push word ptr HWND__ const near * far hwnd 04D3 68 00 00 push seg L$66 04D6 68 E2 00 push offset L$77 04D9 68 00 00 push seg L$66 04DC 68 D7 00 push offset L$76 04DF L$25: 04DF 6A 10 push 0x00000010 04E1 9A 00 00 00 00 call MESSAGEBOX 04E6 L$26: 04E6 8D 66 FC lea sp,-0x4[bp] 04E9 5E pop si 04EA 59 pop cx 04EB 5D pop bp 04EC 4D dec bp 04ED CB retf 04EE L$27: 04EE FF 36 00 00 push word ptr HWND__ const near * far hwnd 04F2 68 00 00 push seg L$66 04F5 68 0F 01 push offset L$79 04F8 68 00 00 push seg L$66 04FB 68 04 01 push offset L$78 04FE EB DF jmp L$25 } return; } LRESULT CALLBACK __export pcpdWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { Routine Size: 280 bytes, Routine Base: pcpd_TEXT + 03E8 0500 long far pcpdWndProc( HWND__ const near *, int unsigned, int unsigned, long ): 0500 1E push ds 0501 58 pop ax 0502 90 nop 0503 45 inc bp 0504 55 push bp 0505 89 E5 mov bp,sp 0507 1E push ds 0508 8E D8 mov ds,ax 050A 56 push si 050B 81 EC 00 01 sub sp,0x0100 050F 8B 4E 08 mov cx,0x8[bp] 0512 8B 46 0C mov ax,0xc[bp] switch(msg) { 0515 3D 13 00 cmp ax,0x0013 0518 0F 83 A1 00 jae L$36 051C 3D 01 00 cmp ax,0x0001 051F 0F 82 A8 00 jb L$37 0523 76 0E jbe L$28 0525 3D 10 00 cmp ax,0x0010 0528 0F 85 9F 00 jne L$37 case WM_CREATE: return 0; case WM_QUERYOPEN: { char msg[256]; wsprintf(msg,"pcpd (16-bit) version 1.0\n" "Files received: %d\n" "Currently receiving %d files\n", seq/2-cons, cons ); MessageBox(hwnd, msg, "pcpd status",MB_OK); return FALSE; } case WM_CLOSE: { PostQuitMessage(0); 052C 6A 00 push 0x00000000 052E 9A 00 00 00 00 call POSTQUITMESSAGE return 0; 0533 L$28: 0533 31 C0 xor ax,ax 0535 31 D2 xor dx,dx } case WM_SERVER: if(ss==wParam) handleServer(ss, WSAGETSELECTEVENT(lParam),WSAGETSELECTERROR(lParam)); return 0; case WM_CONNECTION: { SOCKET s=(SOCKET)wParam; for(int i=0; is==s) { handleConnection(con[i],WSAGETSELECTEVENT(lParam),WSAGETSELECTERROR(lParam)); return 0; } } return 0; } default: return DefWindowProc(hwnd,msg,wParam,lParam); } } 0537 L$29: 0537 8D 66 FC lea sp,-0x4[bp] 053A 5E pop si 053B L$30: 053B 1F pop ds 053C 5D pop bp 053D 4D dec bp 053E CA 0A 00 retf 0x0000000a 0541 L$31: 0541 A1 00 00 mov ax,int far seq 0544 99 cwd 0545 2B C2 sub ax,dx 0547 D1 F8 sar ax,0x0001 0549 FF 36 00 00 push word ptr int far cons 054D 2B 06 00 00 sub ax,int far cons 0551 50 push ax 0552 68 00 00 push seg L$66 0555 68 77 01 push offset L$82 0558 1E push ds 0559 8D 96 FC FE lea dx,-0x104[bp] 055D 52 push dx 055E 9A 00 00 00 00 call _wsprintf 0563 83 C4 0C add sp,0x000c 0566 FF 76 0E push word ptr 0xe[bp] 0569 1E push ds 056A 8D 96 FC FE lea dx,-0x104[bp] 056E 52 push dx 056F 68 00 00 push seg L$66 0572 68 C2 01 push offset L$83 0575 6A 00 push 0x00000000 0577 9A 00 00 00 00 call MESSAGEBOX 057C EB B5 jmp L$28 057E L$32: 057E A1 00 00 mov ax,int unsigned far ss 0581 3B 46 0A cmp ax,0xa[bp] 0584 75 AD jne L$28 0586 8B 56 06 mov dx,0x6[bp] 0589 89 CB mov bx,cx 058B 0E push cs 058C E8 00 00 call void far handleServer( int unsigned, short unsigned, short unsigned ) 058F EB A2 jmp L$28 0591 L$33: 0591 8B 46 0A mov ax,0xa[bp] 0594 8B 16 00 00 mov dx,int far cons 0598 31 DB xor bx,bx 059A C1 E2 02 shl dx,0x0002 059D L$34: 059D 39 D3 cmp bx,dx 059F 7D 92 jge L$28 05A1 C4 B7 00 00 les si,Connection far * far con[][bx] 05A5 26 3B 04 cmp ax,es:[si] 05A8 74 05 je L$35 05AA 83 C3 04 add bx,0x0004 05AD EB EE jmp L$34 05AF L$35: 05AF 8B 5E 06 mov bx,0x6[bp] 05B2 89 F0 mov ax,si 05B4 8C C2 mov dx,es 05B6 0E push cs 05B7 E8 00 00 call void far handleConnection( Connection far *, short unsigned, short unsigned ) 05BA E9 76 FF jmp L$28 05BD L$36: 05BD 76 82 jbe L$31 05BF 3D 01 04 cmp ax,0x0401 05C2 72 07 jb L$37 05C4 76 B8 jbe L$32 05C6 3D 02 04 cmp ax,0x0402 05C9 74 C6 je L$33 05CB L$37: 05CB FF 76 0E push word ptr 0xe[bp] 05CE 50 push ax 05CF FF 76 0A push word ptr 0xa[bp] 05D2 51 push cx 05D3 FF 76 06 push word ptr 0x6[bp] 05D6 9A 00 00 00 00 call DEFWINDOWPROC 05DB E9 59 FF jmp L$29 static int startServer() { 05DE int far startServer(): 05DE 55 push bp 05DF 89 E5 mov bp,sp 05E1 53 push bx 05E2 51 push cx 05E3 52 push dx 05E4 57 push di 05E5 83 EC 10 sub sp,0x0010 ss = socket(PF_INET, SOCK_STREAM, 0); 05E8 6A 02 push 0x00000002 05EA 6A 01 push 0x00000001 05EC 6A 00 push 0x00000000 05EE 9A 00 00 00 00 call SOCKET 05F3 A3 00 00 mov int unsigned far ss,ax if(ss==INVALID_SOCKET) { 05F6 3D FF FF cmp ax,0xffff 05F9 74 66 je L$38 socketMessageBox(hwnd, "pcpd: Could not create socket","pcpd error",MB_OK|MB_ICONSTOP); PostMessage(hwnd, WM_QUIT,0,0); return -1; } sockaddr_in myname; memset(&myname,0,sizeof(myname)); 05FB B9 10 00 mov cx,0x0010 05FE 8D 7E E8 lea di,-0x18[bp] 0601 8C DA mov dx,ds 0603 30 C0 xor al,al 0605 8E C2 mov es,dx 0607 57 push di 0608 8A E0 mov ah,al 060A D1 E9 shr cx,0x0001 060C F3 AB repe stosw 060E 13 C9 adc cx,cx 0610 F3 AA repe stosb 0612 5F pop di myname.sin_family = AF_INET; myname.sin_port = htons(LISTEN_PORT); 0613 68 DA 09 push 0x000009da 0616 C7 46 E8 02 00 mov word ptr -0x18[bp],0x0002 061B 9A 00 00 00 00 call HTONS if(bind(ss,(sockaddr*)&myname,sizeof(myname))) { 0620 FF 36 00 00 push word ptr int unsigned far ss 0624 1E push ds 0625 8D 56 E8 lea dx,-0x18[bp] 0628 52 push dx 0629 6A 10 push 0x00000010 062B 89 46 EA mov -0x16[bp],ax 062E 9A 00 00 00 00 call BIND 0633 85 C0 test ax,ax 0635 75 5B jne L$44 socketMessageBox(hwnd, "pcpd: Could bind socket","pcpd error",MB_OK|MB_ICONSTOP); closesocket(ss); PostMessage(hwnd, WM_QUIT,0,0); return -1; } if(listen(ss,10)) { 0637 FF 36 00 00 push word ptr int unsigned far ss 063B 6A 0A push 0x0000000a 063D 9A 00 00 00 00 call LISTEN 0642 85 C0 test ax,ax 0644 75 6B jne L$45 socketMessageBox(hwnd, "pcpd: Could not start listening","pcpd error",MB_OK|MB_ICONSTOP); closesocket(ss); PostMessage(hwnd, WM_QUIT,0,0); return 0; } int rc; rc = WSAAsyncSelect(ss, hwnd, WM_SERVER, FD_ACCEPT); 0646 FF 36 00 00 push word ptr int unsigned far ss 064A FF 36 00 00 push word ptr HWND__ const near * far hwnd 064E 68 01 04 push 0x00000401 0651 50 push ax 0652 6A 08 push 0x00000008 0654 9A 00 00 00 00 call WSAASYNCSELECT if(rc!=0) { 0659 85 C0 test ax,ax 065B 0F 85 84 00 jne L$46 065F EB 28 jmp L$41 0661 L$38: 0661 6A 10 push 0x00000010 0663 BB D9 01 mov bx,offset L$85 0666 68 00 00 push seg L$66 0669 B9 00 00 mov cx,seg L$66 066C 68 CE 01 push offset L$84 066F A1 00 00 mov ax,HWND__ const near * far hwnd 0672 E8 00 00 call void far socketMessageBox( HWND__ const near *, char const far *, char const far *, int unsigned ) 0675 L$39: 0675 FF 36 00 00 push word ptr HWND__ const near * far hwnd 0679 6A 12 push 0x00000012 067B 6A 00 push 0x00000000 067D 6A 00 push 0x00000000 067F 6A 00 push 0x00000000 0681 9A 00 00 00 00 call POSTMESSAGE 0686 L$40: 0686 B8 FF FF mov ax,0xffff 0689 L$41: 0689 8D 66 F8 lea sp,-0x8[bp] 068C 5F pop di 068D L$42: 068D 5A pop dx 068E L$43: 068E 59 pop cx 068F 5B pop bx 0690 5D pop bp 0691 C3 ret 0692 L$44: 0692 6A 10 push 0x00000010 0694 BB 02 02 mov bx,offset L$87 0697 68 00 00 push seg L$66 069A B9 00 00 mov cx,seg L$66 069D 68 F7 01 push offset L$86 06A0 A1 00 00 mov ax,HWND__ const near * far hwnd 06A3 E8 00 00 call void far socketMessageBox( HWND__ const near *, char const far *, char const far *, int unsigned ) 06A6 FF 36 00 00 push word ptr int unsigned far ss 06AA 9A 00 00 00 00 call CLOSESOCKET 06AF EB C4 jmp L$39 06B1 L$45: 06B1 6A 10 push 0x00000010 06B3 BB 25 02 mov bx,offset L$89 06B6 68 00 00 push seg L$66 06B9 B9 00 00 mov cx,seg L$66 06BC 68 1A 02 push offset L$88 06BF A1 00 00 mov ax,HWND__ const near * far hwnd 06C2 E8 00 00 call void far socketMessageBox( HWND__ const near *, char const far *, char const far *, int unsigned ) 06C5 FF 36 00 00 push word ptr int unsigned far ss 06C9 9A 00 00 00 00 call CLOSESOCKET 06CE FF 36 00 00 push word ptr HWND__ const near * far hwnd 06D2 6A 12 push 0x00000012 06D4 6A 00 push 0x00000000 06D6 6A 00 push 0x00000000 06D8 6A 00 push 0x00000000 06DA 9A 00 00 00 00 call POSTMESSAGE 06DF 31 C0 xor ax,ax 06E1 EB A6 jmp L$41 socketMessageBox(hwnd, "Could not set event notification mask", "pcpd error", MB_OK|MB_ICONSTOP); 06E3 L$46: 06E3 6A 10 push 0x00000010 06E5 BB 50 02 mov bx,offset L$91 06E8 68 00 00 push seg L$66 06EB B9 00 00 mov cx,seg L$66 06EE 68 45 02 push offset L$90 06F1 A1 00 00 mov ax,HWND__ const near * far hwnd 06F4 E8 00 00 call void far socketMessageBox( HWND__ const near *, char const far *, char const far *, int unsigned ) closesocket(ss); 06F7 FF 36 00 00 push word ptr int unsigned far ss 06FB 9A 00 00 00 00 call CLOSESOCKET return -1; 0700 EB 84 jmp L$40 } return 0; } static void stopServer() { 0702 void far stopServer(): 0702 53 push bx 0703 51 push cx 0704 52 push dx closesocket(ss); 0705 FF 36 00 00 push word ptr int unsigned far ss 0709 9A 00 00 00 00 call CLOSESOCKET ss=INVALID_SOCKET; 070E C7 06 00 00 FF FF mov word ptr int unsigned far ss,0xffff } 0714 L$47: 0714 5A pop dx 0715 59 pop cx 0716 5B pop bx 0717 C3 ret static int createWindow(HINSTANCE hinst, HINSTANCE hinstPrev) { 0718 int far createWindow( HINSTANCE__ const near *, HINSTANCE__ const near * ): 0718 55 push bp 0719 89 E5 mov bp,sp 071B 53 push bx 071C 51 push cx 071D 56 push si 071E 57 push di 071F 83 EC 1A sub sp,0x001a 0722 89 C6 mov si,ax if(!hinstPrev) { 0724 85 D2 test dx,dx 0726 74 43 je L$49 WNDCLASS wndclass; memset(&wndclass,0,sizeof(wndclass)); wndclass.style = 0; wndclass.lpfnWndProc = pcpdWndProc; wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 0; wndclass.hInstance = hinst; wndclass.hIcon = LoadIcon(hinst,MAKEINTRESOURCE(100)); wndclass.hCursor = NULL; wndclass.hbrBackground = NULL; wndclass.lpszMenuName = 0; wndclass.lpszClassName = "pcpd"; if(!RegisterClass(&wndclass)) { MessageBox(NULL,"Could not register window class","pcpd error",MB_OK|MB_ICONSTOP); return -1; } } hwnd = CreateWindow("pcpd", 0728 L$48: 0728 68 00 00 push seg L$66 072B 68 AB 02 push offset L$96 072E 68 00 00 push seg L$66 0731 68 A6 02 push offset L$95 0734 68 C8 20 push 0x000020c8 0737 6A 00 push 0x00000000 0739 68 00 80 push 0xffff8000 073C 6A 00 push 0x00000000 073E 68 00 80 push 0xffff8000 0741 6A 00 push 0x00000000 0743 9A 00 00 00 00 call GETDESKTOPWINDOW 0748 50 push ax 0749 6A 00 push 0x00000000 074B 56 push si 074C 6A 00 push 0x00000000 074E 6A 00 push 0x00000000 0750 9A 00 00 00 00 call CREATEWINDOW 0755 A3 00 00 mov HWND__ const near * far hwnd,ax "pcpd", WS_BORDER|WS_CAPTION|WS_OVERLAPPED|WS_SYSMENU|WS_MINIMIZE, CW_USEDEFAULT,0, CW_USEDEFAULT,0, GetDesktopWindow(), NULL, hinst, 0 ); if(!hwnd) { 0758 85 C0 test ax,ax 075A 0F 84 9B 00 je L$52 MessageBox(NULL, "Could not create window", "pcpd error", MB_OK|MB_ICONSTOP); return -1; } ShowWindow(hwnd,SW_SHOWMINIMIZED|SW_SHOW); 075E 50 push ax 075F 6A 07 push 0x00000007 0761 9A 00 00 00 00 call SHOWWINDOW return 0; 0766 31 C0 xor ax,ax 0768 E9 86 00 jmp L$51 076B L$49: 076B B9 1A 00 mov cx,0x001a 076E 8D 7E DE lea di,-0x22[bp] 0771 8C DA mov dx,ds 0773 30 C0 xor al,al 0775 8E C2 mov es,dx 0777 57 push di 0778 8A E0 mov ah,al 077A D1 E9 shr cx,0x0001 077C F3 AB repe stosw 077E 13 C9 adc cx,cx 0780 F3 AA repe stosb 0782 5F pop di 0783 C7 46 DE 00 00 mov word ptr -0x22[bp],0x0000 0788 C7 46 E0 00 00 mov word ptr -0x20[bp],offset long far pcpdWndProc( HWND__ const near *, int unsigned, int unsigned, long ) 078D C7 46 E2 00 00 mov word ptr -0x1e[bp],seg long far pcpdWndProc( HWND__ const near *, int unsigned, int unsigned, long ) 0792 56 push si 0793 C7 46 E4 00 00 mov word ptr -0x1c[bp],0x0000 0798 6A 00 push 0x00000000 079A C7 46 E6 00 00 mov word ptr -0x1a[bp],0x0000 079F 6A 64 push 0x00000064 07A1 89 76 E8 mov -0x18[bp],si 07A4 9A 00 00 00 00 call LOADICON 07A9 C7 46 EC 00 00 mov word ptr -0x14[bp],0x0000 07AE C7 46 EE 00 00 mov word ptr -0x12[bp],0x0000 07B3 C7 46 F0 00 00 mov word ptr -0x10[bp],0x0000 07B8 C7 46 F2 00 00 mov word ptr -0xe[bp],0x0000 07BD C7 46 F4 76 02 mov word ptr -0xc[bp],offset L$92 07C2 8D 56 DE lea dx,-0x22[bp] 07C5 1E push ds 07C6 C7 46 F6 00 00 mov word ptr -0xa[bp],seg L$66 07CB 52 push dx 07CC 89 46 EA mov -0x16[bp],ax 07CF 9A 00 00 00 00 call REGISTERCLASS 07D4 85 C0 test ax,ax 07D6 0F 85 4E FF jne L$48 07DA 50 push ax 07DB 68 00 00 push seg L$66 07DE 68 86 02 push offset L$94 07E1 68 00 00 push seg L$66 07E4 68 7B 02 push offset L$93 07E7 L$50: 07E7 6A 10 push 0x00000010 07E9 9A 00 00 00 00 call MESSAGEBOX 07EE B8 FF FF mov ax,0xffff 07F1 L$51: 07F1 8D 66 F8 lea sp,-0x8[bp] 07F4 5F pop di 07F5 5E pop si 07F6 E9 95 FE jmp L$43 07F9 L$52: 07F9 50 push ax 07FA 68 00 00 push seg L$66 07FD 68 BB 02 push offset L$98 0800 68 00 00 push seg L$66 0803 68 B0 02 push offset L$97 0806 EB DF jmp L$50 } static void messageLoop() { 0808 void far messageLoop(): 0808 55 push bp 0809 89 E5 mov bp,sp 080B 53 push bx 080C 51 push cx 080D 52 push dx 080E 83 EC 12 sub sp,0x0012 MSG msg; while(GetMessage(&msg,NULL,0,0)) { 0811 L$53: 0811 1E push ds 0812 8D 56 E8 lea dx,-0x18[bp] 0815 52 push dx 0816 6A 00 push 0x00000000 0818 6A 00 push 0x00000000 081A 6A 00 push 0x00000000 081C 9A 00 00 00 00 call GETMESSAGE 0821 85 C0 test ax,ax 0823 75 06 jne L$54 TranslateMessage(&msg); DispatchMessage(&msg); } } 0825 8D 66 FA lea sp,-0x6[bp] 0828 E9 62 FE jmp L$42 082B L$54: 082B 1E push ds 082C 8D 56 E8 lea dx,-0x18[bp] 082F 52 push dx 0830 9A 00 00 00 00 call TRANSLATEMESSAGE 0835 1E push ds 0836 8D 56 E8 lea dx,-0x18[bp] 0839 52 push dx 083A 9A 00 00 00 00 call DISPATCHMESSAGE 083F EB D0 jmp L$53 static void destroyWindow() { 0841 void far destroyWindow(): 0841 53 push bx 0842 51 push cx 0843 52 push dx DestroyWindow(hwnd); 0844 FF 36 00 00 push word ptr HWND__ const near * far hwnd 0848 9A 00 00 00 00 call DESTROYWINDOW 084D E9 C4 FE jmp L$47 } static void shutdownConnections() { 0850 void far shutdownConnections(): 0850 55 push bp 0851 89 E5 mov bp,sp 0853 53 push bx 0854 51 push cx 0855 52 push dx 0856 56 push si 0857 57 push di 0858 83 EC 12 sub sp,0x0012 int i; for(i=0; is); } //empty msg queue MSG msg; while(PeekMessage(&msg,NULL,0,0,PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } } 087B 8D 66 F6 lea sp,-0xa[bp] 087E 5F pop di 087F 5E pop si 0880 E9 0A FE jmp L$42 0883 L$57: 0883 C4 9C 00 00 les bx,Connection far * far con[][si] 0887 83 C6 04 add si,0x0004 088A 26 FF 37 push word ptr es:[bx] 088D 47 inc di 088E 9A 00 00 00 00 call CLOSESOCKET 0893 EB CA jmp L$55 0895 L$58: 0895 1E push ds 0896 8D 46 E4 lea ax,-0x1c[bp] 0899 50 push ax 089A 9A 00 00 00 00 call TRANSLATEMESSAGE 089F 1E push ds 08A0 8D 5E E4 lea bx,-0x1c[bp] 08A3 53 push bx 08A4 9A 00 00 00 00 call DISPATCHMESSAGE 08A9 EB BA jmp L$56 static void createMessageQueue() { 08AB void far createMessageQueue(): 08AB 53 push bx 08AC 51 push cx 08AD 52 push dx 08AE 56 push si //enlarge message queue size to avoid overflows of socket notifications for(int cMsg=100; cMsg>0; cMsg--) { 08AF BE 64 00 mov si,0x0064 if(SetMessageQueue(cMsg)) 08B2 L$59: 08B2 56 push si 08B3 9A 00 00 00 00 call SETMESSAGEQUEUE 08B8 85 C0 test ax,ax 08BA 75 05 jne L$60 08BC 4E dec si 08BD 85 F6 test si,si 08BF 7F F1 jg L$59 return; } } 08C1 L$60: 08C1 5E pop si 08C2 E9 4F FE jmp L$47 int FAR PASCAL WinMain(HINSTANCE hinst, HINSTANCE hinstPrev, LPSTR, int) { Routine Size: 965 bytes, Routine Base: pcpd_TEXT + 0500 08C5 WINMAIN: 08C5 1E push ds 08C6 58 pop ax 08C7 90 nop 08C8 45 inc bp 08C9 55 push bp 08CA 89 E5 mov bp,sp 08CC 1E push ds 08CD 8E D8 mov ds,ax 08CF 81 EC 8E 01 sub sp,0x018e createMessageQueue(); 08D3 E8 00 00 call void far createMessageQueue() WSADATA wsadata; if(WSAStartup(0x0101,&wsadata)) { 08D6 68 01 01 push 0x00000101 08D9 1E push ds 08DA 8D 96 70 FE lea dx,-0x190[bp] 08DE 52 push dx 08DF 9A 00 00 00 00 call WSASTARTUP 08E4 85 C0 test ax,ax 08E6 75 1E jne L$61 MessageBox(NULL, "Could not initialize socket library","pcpd error", MB_OK|MB_ICONSTOP); return -1; } if(createWindow(hinst,hinstPrev)) { 08E8 8B 56 0C mov dx,0xc[bp] 08EB 8B 46 0E mov ax,0xe[bp] 08EE E8 00 00 call int far createWindow( HINSTANCE__ const near *, HINSTANCE__ const near * ) 08F1 85 C0 test ax,ax 08F3 75 2B jne L$62 WSACleanup(); return 0; } if(startServer()) { 08F5 E8 00 00 call int far startServer() 08F8 85 C0 test ax,ax 08FA 74 31 je L$65 WSACleanup(); 08FC 9A 00 00 00 00 call WSACLEANUP destroyWindow(); 0901 E8 00 00 call void far destroyWindow() 0904 EB 1F jmp L$63 0906 L$61: 0906 6A 00 push 0x00000000 0908 68 00 00 push seg L$66 090B 68 DE 02 push offset L$100 090E 68 00 00 push seg L$66 0911 68 D3 02 push offset L$99 0914 6A 10 push 0x00000010 0916 9A 00 00 00 00 call MESSAGEBOX 091B B8 FF FF mov ax,0xffff 091E EB 07 jmp L$64 0920 L$62: 0920 9A 00 00 00 00 call WSACLEANUP 0925 L$63: 0925 31 C0 xor ax,ax 0927 L$64: 0927 8D 66 FE lea sp,-0x2[bp] 092A E9 0E FC jmp L$30 return 0; } messageLoop(); 092D L$65: 092D E8 00 00 call void far messageLoop() stopServer(); 0930 E8 00 00 call void far stopServer() shutdownConnections(); 0933 E8 00 00 call void far shutdownConnections() destroyWindow(); 0936 E8 00 00 call void far destroyWindow() 0939 EB E5 jmp L$62 Routine Size: 118 bytes, Routine Base: pcpd_TEXT + 08C5 No disassembly errors Segment: _DATA WORD USE16 00000002 bytes 0000 int unsigned far ss: 0000 FF FF .. Segment: _BSS PARA USE16 00001206 bytes 0000 char far void far handleConnection( Connection far *, short unsigned, short unsigned )::.16::buf[]: 1000 int far cons: 1002 int far seq: 1004 Connection far * far con[]: 1204 HWND__ const near * far hwnd: BSS Size: 4614 bytes File contains no line numbers. Segment: pcpd_TEXT BYTE USE16 00000302 bytes 0000 L$66: 0000 25 73 0A 4C 61 73 74 20 73 6F 63 6B 65 74 20 65 %s.Last socket e 0010 72 72 6F 72 20 63 6F 64 65 3D 25 64 00 rror code=%d. 001D L$67: 001D 5C 73 70 6F 6F 6C 5C 6E 6C 70 64 5C 74 6D 70 25 \spool\nlpd\tmp% 002D 30 34 64 00 04d. 0031 L$68: 0031 43 6F 75 6C 64 20 6E 6F 74 20 63 72 65 61 74 65 Could not create 0041 20 74 65 6D 70 6F 72 61 72 79 20 66 69 6C 65 20 temporary file 0051 27 25 73 27 00 '%s'. 0056 L$69: 0056 70 63 70 64 20 65 72 72 6F 72 00 pcpd error. 0061 L$70: 0061 70 63 70 64 20 65 72 72 6F 72 00 pcpd error. 006C L$71: 006C 43 6F 75 6C 64 20 6E 6F 74 20 77 72 69 74 65 20 Could not write 007C 74 6F 20 74 65 6D 70 6F 72 61 72 79 20 66 69 6C to temporary fil 008C 65 0A 4D 61 79 62 65 20 74 68 65 20 64 69 73 6B e.Maybe the disk 009C 20 69 73 20 66 75 6C 6C 3F 00 is full?. 00A6 L$72: 00A6 5C 73 70 6F 6F 6C 5C 6E 6C 70 64 5C 64 66 61 25 \spool\nlpd\dfa% 00B6 30 34 64 00 04d. 00BA L$73: 00BA 5C 73 70 6F 6F 6C 5C 6E 6C 70 64 5C 63 66 61 25 \spool\nlpd\cfa% 00CA 30 34 64 00 04d. 00CE L$74: 00CE 4E 64 65 73 74 2F 00 Ndest/. 00D5 L$75: 00D5 0A 00 .. 00D7 L$76: 00D7 70 63 70 64 20 65 72 72 6F 72 00 pcpd error. 00E2 L$77: 00E2 54 6F 6F 20 6D 61 6E 79 20 73 69 6D 75 6C 74 61 Too many simulta 00F2 6E 65 6F 75 73 20 63 6F 6E 6E 65 63 74 69 6F 6E neous connection 0102 73 00 s. 0104 L$78: 0104 70 63 70 64 20 65 72 72 6F 72 00 pcpd error. 010F L$79: 010F 4E 6F 74 20 65 6E 6F 75 67 68 20 6D 65 6D 6F 72 Not enough memor 011F 79 20 74 6F 20 72 65 67 69 73 74 65 72 20 6E 65 y to register ne 012F 77 20 63 6F 6E 6E 65 63 74 69 6F 6E 00 w connection. 013C L$80: 013C 70 63 70 64 20 65 72 72 6F 72 00 pcpd error. 0147 L$81: 0147 43 6F 75 6C 64 20 6E 6F 74 20 73 65 74 20 65 76 Could not set ev 0157 65 6E 74 20 6E 6F 74 69 66 69 63 61 74 69 6F 6E ent notification 0167 20 6D 61 73 6B 20 6F 6E 20 73 6F 63 6B 65 74 00 mask on socket. 0177 L$82: 0177 70 63 70 64 20 28 31 36 2D 62 69 74 29 20 76 65 pcpd (16-bit) ve 0187 72 73 69 6F 6E 20 31 2E 30 0A 46 69 6C 65 73 20 rsion 1.0.Files 0197 72 65 63 65 69 76 65 64 3A 20 25 64 0A 43 75 72 received: %d.Cur 01A7 72 65 6E 74 6C 79 20 72 65 63 65 69 76 69 6E 67 rently receiving 01B7 20 25 64 20 66 69 6C 65 73 0A 00 %d files.. 01C2 L$83: 01C2 70 63 70 64 20 73 74 61 74 75 73 00 pcpd status. 01CE L$84: 01CE 70 63 70 64 20 65 72 72 6F 72 00 pcpd error. 01D9 L$85: 01D9 70 63 70 64 3A 20 43 6F 75 6C 64 20 6E 6F 74 20 pcpd: Could not 01E9 63 72 65 61 74 65 20 73 6F 63 6B 65 74 00 create socket. 01F7 L$86: 01F7 70 63 70 64 20 65 72 72 6F 72 00 pcpd error. 0202 L$87: 0202 70 63 70 64 3A 20 43 6F 75 6C 64 20 62 69 6E 64 pcpd: Could bind 0212 20 73 6F 63 6B 65 74 00 socket. 021A L$88: 021A 70 63 70 64 20 65 72 72 6F 72 00 pcpd error. 0225 L$89: 0225 70 63 70 64 3A 20 43 6F 75 6C 64 20 6E 6F 74 20 pcpd: Could not 0235 73 74 61 72 74 20 6C 69 73 74 65 6E 69 6E 67 00 start listening. 0245 L$90: 0245 70 63 70 64 20 65 72 72 6F 72 00 pcpd error. 0250 L$91: 0250 43 6F 75 6C 64 20 6E 6F 74 20 73 65 74 20 65 76 Could not set ev 0260 65 6E 74 20 6E 6F 74 69 66 69 63 61 74 69 6F 6E ent notification 0270 20 6D 61 73 6B 00 mask. 0276 L$92: 0276 70 63 70 64 00 pcpd. 027B L$93: 027B 70 63 70 64 20 65 72 72 6F 72 00 pcpd error. 0286 L$94: 0286 43 6F 75 6C 64 20 6E 6F 74 20 72 65 67 69 73 74 Could not regist 0296 65 72 20 77 69 6E 64 6F 77 20 63 6C 61 73 73 00 er window class. 02A6 L$95: 02A6 70 63 70 64 00 pcpd. 02AB L$96: 02AB 70 63 70 64 00 pcpd. 02B0 L$97: 02B0 70 63 70 64 20 65 72 72 6F 72 00 pcpd error. 02BB L$98: 02BB 43 6F 75 6C 64 20 6E 6F 74 20 63 72 65 61 74 65 Could not create 02CB 20 77 69 6E 64 6F 77 00 window. 02D3 L$99: 02D3 70 63 70 64 20 65 72 72 6F 72 00 pcpd error. 02DE L$100: 02DE 43 6F 75 6C 64 20 6E 6F 74 20 69 6E 69 74 69 61 Could not initia 02EE 6C 69 7A 65 20 73 6F 63 6B 65 74 20 6C 69 62 72 lize socket libr 02FE 61 72 79 00 ary. Routine Size: 770 bytes, Routine Base: pcpd_TEXT + 0000 No disassembly errors