Module: D:\SOURCE\WORK\DLCMAKE\dlcmake.cpp Group: 'DGROUP' CONST,CONST2,_DATA,_BSS Segment: dlcmake_TEXT PARA 000006af bytes #include #include #include #include #include #include "dlcmake.hpp" #include "findallr.hpp" #include "findref.hpp" #include "incdir.hpp" #include "qualify.hpp" BOOL CALLBACK __export __loadds FindAllDLCDependencies(const char *basename, const char *includeDirs, char *dep, int maxdep) { 0000 FINDALLDLCDEPENDENCIES: 0000 1e push ds 0001 58 pop ax 0002 90 nop 0003 45 inc bp 0004 55 push bp 0005 89 e5 mov bp,sp 0007 1e push ds 0008 8e d8 mov ds,ax 000a 1e push ds 000b b8 00 00 mov ax,seg L49 000e 8e d8 mov ds,ax 0010 56 push si 0011 57 push di 0012 81 ec ce 00 sub sp,00ceH if(IsBadReadPtr(basename,2)) return FALSE; 0016 8b 56 10 mov dx,+10H[bp] 0019 8b 46 12 mov ax,+12H[bp] 001c 50 push ax 001d 52 push dx 001e 6a 02 push 0002H 0020 9a 00 00 00 00 call far ISBADREADPTR 0025 85 c0 test ax,ax 0027 74 08 je L1 0029 c7 46 f2 00 00 mov word ptr -0eH[bp],0000H 002e e9 0e 01 jmp L9 if(IsBadReadPtr(includeDirs,1)) return FALSE; 0031 8b 56 0c L1 mov dx,+0cH[bp] 0034 8b 46 0e mov ax,+0eH[bp] 0037 50 push ax 0038 52 push dx 0039 6a 01 push 0001H 003b 9a 00 00 00 00 call far ISBADREADPTR 0040 85 c0 test ax,ax 0042 74 08 je L2 0044 c7 46 f2 00 00 mov word ptr -0eH[bp],0000H 0049 e9 f3 00 jmp L9 if(IsBadWritePtr(dep,maxdep)) return FALSE; //setup include directories 004c 8b 56 08 L2 mov dx,+8H[bp] 004f 8b 46 0a mov ax,+0aH[bp] 0052 50 push ax 0053 52 push dx 0054 8b 46 06 mov ax,+6H[bp] 0057 50 push ax 0058 9a 00 00 00 00 call far ISBADWRITEPTR 005d 85 c0 test ax,ax 005f 74 08 je L3 0061 c7 46 f2 00 00 mov word ptr -0eH[bp],0000H 0066 e9 d6 00 jmp L9 clearIncludeDirectories(); 0069 9a 00 00 00 00 L3 call far void far clearIncludeDirectories() addIncludeDirectories(includeDirs); char *ref[50]; int refs; 006e 8b 4e 0c mov cx,+0cH[bp] 0071 8b 56 0e mov dx,+0eH[bp] 0074 89 c8 mov ax,cx 0076 9a 00 00 00 00 call far int far addIncludeDirectories( char const far * ) findAllReferences(basename,ref,50,&refs); 007b 8c d0 mov ax,ss 007d 8d 56 f4 lea dx,-0cH[bp] 0080 50 push ax 0081 52 push dx 0082 6a 32 push 0032H 0084 8c d1 mov cx,ss 0086 8d 96 2a ff lea dx,-0d6H[bp] 008a 89 d0 mov ax,dx 008c 8b 76 10 mov si,+10H[bp] 008f 8b 56 12 mov dx,+12H[bp] 0092 89 c3 mov bx,ax 0094 89 f0 mov ax,si 0096 9a 00 00 00 00 call far void far findAllReferences( char const far *, char far * far *, int, int far * ) *dep='\0'; 009b c4 76 08 les si,dword ptr +8H[bp] 009e 26 c6 04 00 mov byte ptr es:[si],00H for(int r=0; r>9)&0x7f) + 1980; 03de 8b 46 e2 mov ax,-1eH[bp] 03e1 c1 e8 09 shr ax,09H 03e4 25 7f 00 and ax,007fH 03e7 c4 5e 1a les bx,dword ptr +1aH[bp] 03ea 05 bc 07 add ax,07bcH 03ed 26 89 07 mov es:[bx],ax *month = (ff.wr_date>>5)&0x0f; 03f0 8b 46 e2 mov ax,-1eH[bp] 03f3 c1 e8 05 shr ax,05H 03f6 c4 5e 16 les bx,dword ptr +16H[bp] 03f9 25 0f 00 and ax,000fH 03fc 26 89 07 mov es:[bx],ax *day = (ff.wr_date>>0)&0x1f; 03ff 8b 46 e2 mov ax,-1eH[bp] 0402 25 1f 00 and ax,001fH 0405 c4 5e 12 les bx,dword ptr +12H[bp] 0408 26 89 07 mov es:[bx],ax *hour = (ff.wr_time>>11)&0x1f; 040b 8b 46 e0 mov ax,-20H[bp] 040e c1 e8 0b shr ax,0bH 0411 c4 5e 0e les bx,dword ptr +0eH[bp] 0414 25 1f 00 and ax,001fH 0417 26 89 07 mov es:[bx],ax *minute = (ff.wr_time>>5)&0x3f; 041a 8b 46 e0 mov ax,-20H[bp] 041d c1 e8 05 shr ax,05H 0420 c4 5e 0a les bx,dword ptr +0aH[bp] 0423 25 3f 00 and ax,003fH 0426 26 89 07 mov es:[bx],ax *second = ((ff.wr_time>>0)&0x1f) * 2; 0429 8b 46 e0 mov ax,-20H[bp] 042c 25 1f 00 and ax,001fH 042f c4 5e 06 les bx,dword ptr +6H[bp] 0432 01 c0 add ax,ax 0434 26 89 07 mov es:[bx],ax return TRUE; } else 0437 c7 46 f6 01 00 mov word ptr -0aH[bp],0001H 043c eb 05 jmp L29 return FALSE; 043e c7 46 f6 00 00 L28 mov word ptr -0aH[bp],0000H } 0443 8b 46 f6 L29 mov ax,-0aH[bp] 0446 8d 66 f8 lea sp,-8H[bp] 0449 5f pop di 044a 5e pop si 044b 1f pop ds 044c 1f pop ds 044d 5d pop bp 044e 4d dec bp 044f ca 1c 00 retf 001cH 0452 89 c0 mov ax,ax void CALLBACK __export __loadds QualifyFilename(const char *basename, const char *refFrom, const char *includeDirs, char *fullname) { if(IsBadReadPtr(basename,1) || IsBadReadPtr(refFrom,1) || 0454 1e QUALIFYFILENAME push ds 0455 58 pop ax 0456 90 nop 0457 45 inc bp 0458 55 push bp 0459 89 e5 mov bp,sp 045b 1e push ds 045c 8e d8 mov ds,ax 045e 1e push ds 045f b8 00 00 mov ax,seg L49 0462 8e d8 mov ds,ax 0464 56 push si 0465 57 push di 0466 81 ec 00 00 sub sp,0000H IsBadReadPtr(includeDirs,1) || IsBadWritePtr(fullname,128)) { 046a 8b 56 12 mov dx,+12H[bp] 046d 8b 46 14 mov ax,+14H[bp] 0470 50 push ax 0471 52 push dx 0472 6a 01 push 0001H 0474 9a 00 00 00 00 call far ISBADREADPTR 0479 85 c0 test ax,ax 047b 75 13 jne L30 047d 8b 56 0e mov dx,+0eH[bp] 0480 8b 46 10 mov ax,+10H[bp] 0483 50 push ax 0484 52 push dx 0485 6a 01 push 0001H 0487 9a 00 00 00 00 call far ISBADREADPTR 048c 85 c0 test ax,ax 048e 74 02 je L31 0490 eb 13 L30 jmp L32 0492 8b 56 0a L31 mov dx,+0aH[bp] 0495 8b 46 0c mov ax,+0cH[bp] 0498 50 push ax 0499 52 push dx 049a 6a 01 push 0001H 049c 9a 00 00 00 00 call far ISBADREADPTR 04a1 85 c0 test ax,ax 04a3 74 02 je L33 04a5 eb 14 L32 jmp L34 04a7 8b 56 06 L33 mov dx,+6H[bp] 04aa 8b 46 08 mov ax,+8H[bp] 04ad 50 push ax 04ae 52 push dx 04af 68 80 00 push 0080H 04b2 9a 00 00 00 00 call far ISBADWRITEPTR 04b7 85 c0 test ax,ax 04b9 74 09 je L35 fullname[0]='\0'; 04bb c4 5e 06 L34 les bx,dword ptr +6H[bp] 04be 26 c6 07 00 mov byte ptr es:[bx],00H return; } //setup include directories 04c2 eb 2f jmp L36 clearIncludeDirectories(); 04c4 9a 00 00 00 00 L35 call far void far clearIncludeDirectories() addIncludeDirectories(includeDirs); 04c9 8b 5e 0a mov bx,+0aH[bp] 04cc 8b 56 0c mov dx,+0cH[bp] 04cf 89 d8 mov ax,bx 04d1 9a 00 00 00 00 call far int far addIncludeDirectories( char const far * ) qualifyIncludeReference(refFrom,basename,fullname); 04d6 8b 56 06 mov dx,+6H[bp] 04d9 8b 46 08 mov ax,+8H[bp] 04dc 50 push ax 04dd 52 push dx 04de 8b 46 12 mov ax,+12H[bp] 04e1 8b 4e 14 mov cx,+14H[bp] 04e4 8b 76 0e mov si,+0eH[bp] 04e7 8b 56 10 mov dx,+10H[bp] 04ea 89 c3 mov bx,ax 04ec 89 f0 mov ax,si 04ee 9a 00 00 00 00 call far void far qualifyIncludeReference( char const far *, char const far *, char far * ) } 04f3 8d 66 f8 L36 lea sp,-8H[bp] 04f6 5f pop di 04f7 5e pop si 04f8 1f pop ds 04f9 1f pop ds 04fa 5d pop bp 04fb 4d dec bp 04fc ca 10 00 retf 0010H 04ff fc cld void CALLBACK __export __loadds UnqualifyFilename(const char *fullname, const char *refFrom, const char *includeDirs, char *basename) { if(IsBadReadPtr(fullname,1) || IsBadReadPtr(refFrom,1) || 0500 UNQUALIFYFILENAME: 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 1e push ds 050b b8 00 00 mov ax,seg L49 050e 8e d8 mov ds,ax 0510 56 push si 0511 57 push di 0512 81 ec 00 00 sub sp,0000H IsBadReadPtr(includeDirs,1) || IsBadWritePtr(basename,128)) { 0516 8b 56 12 mov dx,+12H[bp] 0519 8b 46 14 mov ax,+14H[bp] 051c 50 push ax 051d 52 push dx 051e 6a 01 push 0001H 0520 9a 00 00 00 00 call far ISBADREADPTR 0525 85 c0 test ax,ax 0527 75 13 jne L37 0529 8b 56 0e mov dx,+0eH[bp] 052c 8b 46 10 mov ax,+10H[bp] 052f 50 push ax 0530 52 push dx 0531 6a 01 push 0001H 0533 9a 00 00 00 00 call far ISBADREADPTR 0538 85 c0 test ax,ax 053a 74 02 je L38 053c eb 13 L37 jmp L39 053e 8b 56 0a L38 mov dx,+0aH[bp] 0541 8b 46 0c mov ax,+0cH[bp] 0544 50 push ax 0545 52 push dx 0546 6a 01 push 0001H 0548 9a 00 00 00 00 call far ISBADREADPTR 054d 85 c0 test ax,ax 054f 74 02 je L40 0551 eb 14 L39 jmp L41 0553 8b 56 06 L40 mov dx,+6H[bp] 0556 8b 46 08 mov ax,+8H[bp] 0559 50 push ax 055a 52 push dx 055b 68 80 00 push 0080H 055e 9a 00 00 00 00 call far ISBADWRITEPTR 0563 85 c0 test ax,ax 0565 74 09 je L42 basename[0]='\0'; 0567 c4 5e 06 L41 les bx,dword ptr +6H[bp] 056a 26 c6 07 00 mov byte ptr es:[bx],00H return; } //setup include directories 056e eb 2f jmp L43 clearIncludeDirectories(); 0570 9a 00 00 00 00 L42 call far void far clearIncludeDirectories() addIncludeDirectories(includeDirs); 0575 8b 5e 0a mov bx,+0aH[bp] 0578 8b 56 0c mov dx,+0cH[bp] 057b 89 d8 mov ax,bx 057d 9a 00 00 00 00 call far int far addIncludeDirectories( char const far * ) unqualifyIncludeReference(refFrom,fullname,basename); 0582 8b 56 06 mov dx,+6H[bp] 0585 8b 46 08 mov ax,+8H[bp] 0588 50 push ax 0589 52 push dx 058a 8b 46 12 mov ax,+12H[bp] 058d 8b 4e 14 mov cx,+14H[bp] 0590 8b 76 0e mov si,+0eH[bp] 0593 8b 56 10 mov dx,+10H[bp] 0596 89 c3 mov bx,ax 0598 89 f0 mov ax,si 059a 9a 00 00 00 00 call far void far unqualifyIncludeReference( char const far *, char const far *, char far * ) } 059f 8d 66 f8 L43 lea sp,-8H[bp] 05a2 5f pop di 05a3 5e pop si 05a4 1f pop ds 05a5 1f pop ds 05a6 5d pop bp 05a7 4d dec bp 05a8 ca 10 00 retf 0010H 05ab fc cld void CALLBACK __export __loadds QueryFilesInDirectory(const char *filespec, char *buf, int maxbuf) { 05ac QUERYFILESINDIRECTORY: 05ac 1e push ds 05ad 58 pop ax 05ae 90 nop 05af 45 inc bp 05b0 55 push bp 05b1 89 e5 mov bp,sp 05b3 1e push ds 05b4 8e d8 mov ds,ax 05b6 1e push ds 05b7 b8 00 00 mov ax,seg L49 05ba 8e d8 mov ds,ax 05bc 56 push si 05bd 57 push di 05be 81 ec 2e 00 sub sp,002eH if(IsBadReadPtr(filespec,3) || IsBadWritePtr(buf,maxbuf)) { 05c2 8b 56 0c mov dx,+0cH[bp] 05c5 8b 46 0e mov ax,+0eH[bp] 05c8 50 push ax 05c9 52 push dx 05ca 6a 03 push 0003H 05cc 9a 00 00 00 00 call far ISBADREADPTR 05d1 85 c0 test ax,ax 05d3 75 15 jne L44 05d5 8b 56 08 mov dx,+8H[bp] 05d8 8b 46 0a mov ax,+0aH[bp] 05db 50 push ax 05dc 52 push dx 05dd 8b 46 06 mov ax,+6H[bp] 05e0 50 push ax 05e1 9a 00 00 00 00 call far ISBADWRITEPTR 05e6 85 c0 test ax,ax 05e8 74 0a je L45 *buf='\0'; 05ea c4 5e 08 L44 les bx,dword ptr +8H[bp] 05ed 26 c6 07 00 mov byte ptr es:[bx],00H return; } find_t ff; 05f1 e9 8b 00 jmp L48 *buf='\0'; 05f4 c4 5e 08 L45 les bx,dword ptr +8H[bp] 05f7 26 c6 07 00 mov byte ptr es:[bx],00H unsigned r=_dos_findfirst(filespec,_A_NORMAL,&ff); 05fb 8c d2 mov dx,ss 05fd 8d 4e ca lea cx,-36H[bp] 0600 52 push dx 0601 51 push cx 0602 31 db xor bx,bx 0604 8b 4e 0c mov cx,+0cH[bp] 0607 8b 56 0e mov dx,+0eH[bp] 060a 89 c8 mov ax,cx 060c 9a 00 00 00 00 call far _dos_findfirst_ 0611 89 46 f6 mov -0aH[bp],ax while(r==0) { 0614 83 7e f6 00 L46 cmp word ptr -0aH[bp],0000H 0618 75 65 jne L48 if(strlen(buf)+1+strlen(ff.name)