diff --git a/libs/BorlandC/srchstr.asm b/libs/BorlandC/srchstr.asm new file mode 100644 index 00000000..32879e59 --- /dev/null +++ b/libs/BorlandC/srchstr.asm @@ -0,0 +1,158 @@ +; void __cdecl _searchstr(const char *file, const char *ipath, char *pathname) + public __searchstr +__searchstr proc DIST +@@temp = dword ptr -4 +@@file = dword ptr 6 +@@ipath = dword ptr 0Ah +@@pathname = dword ptr 0Eh + + push bp + mov bp, sp + sub sp, 4 + push si + push di + mov ax, 80 + push ax + push word ptr [bp+@@pathname+2] + push word ptr [bp+@@pathname] + xor ax, ax + push ax + nopcall __getdcwd + add sp, 8 + or ax, dx + jnz short @@loc_10045 + xor dx, dx + jmp short @@loc_10054 + +@@loc_10045: + push word ptr [bp+@@pathname+2] + push word ptr [bp+@@pathname] + nopcall _strlen + pop cx + pop cx + mov dx, ax + +@@loc_10054: + les bx, [bp+@@pathname] + add bx, dx + mov byte ptr es:[bx], 0 + or dx, dx + jz short @@loc_100A9 + mov bx, dx + add bx, word ptr [bp+@@pathname] + mov bl, es:[bx-1] + mov al, bl + cmp al, '\' + jz short @@loc_1007A + cmp bl, '/' + jz short @@loc_1007A + cmp bl, ':' + jnz short @@loc_10096 + +@@loc_1007A: + mov ax, word ptr [bp+@@pathname] + add ax, dx + dec ax + push word ptr [bp+@@pathname+2] + push ax + push word ptr [bp+@@pathname+2] + push word ptr [bp+@@pathname] + nopcall ___path_issbcs + add sp, 8 + or ax, ax + jnz short @@loc_100A9 + +@@loc_10096: + push ds + mov ax, offset srchstr_backslash + push ax + push word ptr [bp+@@pathname+2] + push word ptr [bp+@@pathname] + nopcall _strcat + add sp, 8 + +@@loc_100A9: + push word ptr [bp+@@file+2] + push word ptr [bp+@@file] + push word ptr [bp+@@pathname+2] + push word ptr [bp+@@pathname] + nopcall _strcat + add sp, 8 + xor ax, ax + push ax + push word ptr [bp+@@pathname+2] + push word ptr [bp+@@pathname] + nopcall __access + add sp, 6 + or ax, ax + jz short @@loc_1011D + les bx, [bp+@@ipath] + cmp byte ptr es:[bx], 0 + jnz short @@loc_100E4 + les bx, [bp+@@pathname] + mov byte ptr es:[bx], 0 + jmp short @@loc_1015C + +@@loc_100E4: + xor dx, dx + jmp short @@loc_100FC + +@@loc_100E8: + les bx, [bp+@@pathname] + add bx, dx + push es + les si, [bp+@@ipath] + mov al, es:[si] + pop es + mov es:[bx], al + inc word ptr [bp+@@ipath] + inc dx + +@@loc_100FC: + les bx, [bp+@@ipath] + cmp byte ptr es:[bx], ';' + jz short @@loc_1010B + cmp byte ptr es:[bx], 0 + jnz short @@loc_100E8 + +@@loc_1010B: + les bx, [bp+@@ipath] + cmp byte ptr es:[bx], 0 + jnz short @@loc_10117 + jmp @@loc_10054 + +@@loc_10117: + inc word ptr [bp+@@ipath] + jmp @@loc_10054 + +@@loc_1011D: + mov ax, 80 + push ax + push word ptr [bp+@@pathname+2] + push word ptr [bp+@@pathname] + xor ax, ax + push ax + push ax + nopcall __fullpath + add sp, 0Ah + mov word ptr [bp+@@temp+2], dx + mov word ptr [bp+@@temp], ax + or ax, dx + jz short @@loc_1015C + push word ptr [bp+@@temp+2] + push word ptr [bp+@@temp] + push word ptr [bp+@@pathname+2] + push word ptr [bp+@@pathname] + nopcall _strcpy + push word ptr [bp+@@temp+2] + push word ptr [bp+@@temp] + nopcall _free + add sp, 0Ch + +@@loc_1015C: + pop di + pop si + mov sp, bp + pop bp + ret +__searchstr endp diff --git a/libs/BorlandC/srchstr[data].asm b/libs/BorlandC/srchstr[data].asm new file mode 100644 index 00000000..71a1a066 --- /dev/null +++ b/libs/BorlandC/srchstr[data].asm @@ -0,0 +1 @@ +srchstr_backslash db '\',0 diff --git a/th01_fuuin.asm b/th01_fuuin.asm index e2836148..8b2000a9 100644 --- a/th01_fuuin.asm +++ b/th01_fuuin.asm @@ -6643,9 +6643,7 @@ loc_5169: push word ptr [bp+var_4] ; __int32 push word ptr [bp+_src+2] push word ptr [bp+_src] ; src - nop - push cs - call near ptr sub_5189 + nopcall __searchstr add sp, 0Ch pop di pop si @@ -6654,186 +6652,7 @@ loc_5169: retf __searchenv endp - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -; int __cdecl __far sub_5189(char *src, __int32, char *pathname) -sub_5189 proc far - -var_4 = word ptr -4 -var_2 = word ptr -2 -_src = dword ptr 6 -arg_4 = dword ptr 0Ah -pathname = dword ptr 0Eh - - push bp - mov bp, sp - sub sp, 4 - push si - push di - mov ax, 50h ; 'P' - push ax ; len - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; buf - xor ax, ax - push ax ; drive - nopcall __getdcwd - add sp, 8 - or ax, dx - jnz short loc_51AE - xor dx, dx - jmp short loc_51BD -; --------------------------------------------------------------------------- - -loc_51AE: - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - mov dx, ax - -loc_51BD: - les bx, [bp+pathname] - add bx, dx - mov byte ptr es:[bx], 0 - or dx, dx - jz short loc_5212 - mov bx, dx - add bx, word ptr [bp+pathname] - mov bl, es:[bx-1] - mov al, bl - cmp al, 5Ch ; '\' - jz short loc_51E3 - cmp bl, 2Fh ; '/' - jz short loc_51E3 - cmp bl, 3Ah ; ':' - jnz short loc_51FF - -loc_51E3: - mov ax, word ptr [bp+pathname] - add ax, dx - dec ax - push word ptr [bp+pathname+2] - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - nopcall ___path_issbcs - add sp, 8 - or ax, ax - jnz short loc_5212 - -loc_51FF: - push ds - mov ax, 11F6h - push ax ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - -loc_5212: - push word ptr [bp+_src+2] - push word ptr [bp+_src] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - xor ax, ax - push ax ; char - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; pathname - nopcall __access - add sp, 6 - or ax, ax - jz short loc_5286 - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_524D - les bx, [bp+pathname] - mov byte ptr es:[bx], 0 - jmp short loc_52C5 -; --------------------------------------------------------------------------- - -loc_524D: - xor dx, dx - jmp short loc_5265 -; --------------------------------------------------------------------------- - -loc_5251: - les bx, [bp+pathname] - add bx, dx - push es - les si, [bp+arg_4] - mov al, es:[si] - pop es - mov es:[bx], al - inc word ptr [bp+arg_4] - inc dx - -loc_5265: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 3Bh ; ';' - jz short loc_5274 - cmp byte ptr es:[bx], 0 - jnz short loc_5251 - -loc_5274: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_5280 - jmp loc_51BD -; --------------------------------------------------------------------------- - -loc_5280: - inc word ptr [bp+arg_4] - jmp loc_51BD -; --------------------------------------------------------------------------- - -loc_5286: - mov ax, 50h ; 'P' - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - xor ax, ax - push ax - push ax - nopcall __fullpath - add sp, 0Ah - mov [bp+var_2], dx - mov [bp+var_4], ax - or ax, dx - jz short loc_52C5 - push [bp+var_2] - push [bp+var_4] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcpy - push [bp+var_2] - push [bp+var_4] - nop - push cs - call near ptr _farfree - add sp, 0Ch - -loc_52C5: - pop di - pop si - mov sp, bp - pop bp - retf -sub_5189 endp - +include libs/BorlandC/srchstr.asm include libs/BorlandC/setvbuf.asm ; =============== S U B R O U T I N E ======================================= @@ -27606,8 +27425,7 @@ include libs/BorlandC/putc[data].asm db 0 db 0 db 0 - db 5Ch ; \ - db 0 +include libs/BorlandC/srchstr[data].asm include libs/BorlandC/setvbuf[data].asm include libs/BorlandC/sysnerr[data].asm include libs/BorlandC/xx[data].asm diff --git a/th01_op.asm b/th01_op.asm index 498f223d..b24bda67 100644 --- a/th01_op.asm +++ b/th01_op.asm @@ -6563,9 +6563,7 @@ loc_53E7: push word ptr [bp+var_4] ; __int32 push word ptr [bp+src+2] push word ptr [bp+src] ; src - nop - push cs - call near ptr sub_5407 + nopcall __searchstr add sp, 0Ch pop di pop si @@ -6574,187 +6572,7 @@ loc_53E7: retf __searchenv endp - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -; int __cdecl __far sub_5407(char *src, __int32, char *pathname) -sub_5407 proc far - -var_4 = word ptr -4 -var_2 = word ptr -2 -src = dword ptr 6 -arg_4 = dword ptr 0Ah -pathname = dword ptr 0Eh - - push bp - mov bp, sp - sub sp, 4 - push si - push di - mov ax, 50h ; 'P' - push ax ; len - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; buf - xor ax, ax - push ax ; drive - nopcall __getdcwd - add sp, 8 - or ax, dx - jnz short loc_542C - xor dx, dx - jmp short loc_543B -; --------------------------------------------------------------------------- - -loc_542C: - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - mov dx, ax - -loc_543B: - les bx, [bp+pathname] - add bx, dx - mov byte ptr es:[bx], 0 - or dx, dx - jz short loc_5490 - mov bx, dx - add bx, word ptr [bp+pathname] - mov bl, es:[bx-1] - mov al, bl - cmp al, 5Ch ; '\' - jz short loc_5461 - cmp bl, 2Fh ; '/' - jz short loc_5461 - cmp bl, 3Ah ; ':' - jnz short loc_547D - -loc_5461: - mov ax, word ptr [bp+pathname] - add ax, dx - dec ax - push word ptr [bp+pathname+2] - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - nopcall ___path_issbcs - add sp, 8 - or ax, ax - jnz short loc_5490 - -loc_547D: - push ds - mov ax, 0F46h - push ax ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - -loc_5490: - push word ptr [bp+src+2] - push word ptr [bp+src] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - xor ax, ax - push ax ; char - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; pathname - nopcall __access - add sp, 6 - or ax, ax - jz short loc_5504 - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_54CB - les bx, [bp+pathname] - mov byte ptr es:[bx], 0 - jmp short loc_5543 -; --------------------------------------------------------------------------- - -loc_54CB: - xor dx, dx - jmp short loc_54E3 -; --------------------------------------------------------------------------- - -loc_54CF: - les bx, [bp+pathname] - add bx, dx - push es - les si, [bp+arg_4] - mov al, es:[si] - pop es - mov es:[bx], al - inc word ptr [bp+arg_4] - inc dx - -loc_54E3: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 3Bh ; ';' - jz short loc_54F2 - cmp byte ptr es:[bx], 0 - jnz short loc_54CF - -loc_54F2: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_54FE - jmp loc_543B -; --------------------------------------------------------------------------- - -loc_54FE: - inc word ptr [bp+arg_4] - jmp loc_543B -; --------------------------------------------------------------------------- - -loc_5504: - mov ax, 50h ; 'P' - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - xor ax, ax - push ax - push ax - nopcall __fullpath - add sp, 0Ah - mov [bp+var_2], dx - mov [bp+var_4], ax - or ax, dx - jz short loc_5543 - push [bp+var_2] - push [bp+var_4] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcpy - push [bp+var_2] - push [bp+var_4] - nop - push cs - call near ptr _farfree - add sp, 0Ch - -loc_5543: - ; sub_5407+11Bj - pop di - pop si - mov sp, bp - pop bp - retf -sub_5407 endp - +include libs/BorlandC/srchstr.asm include libs/BorlandC/setvbuf.asm ; --------------------------------------------------------------------------- @@ -25186,8 +25004,7 @@ include libs/BorlandC/putc[data].asm db 0 db 0 db 0 - db 5Ch ; \ - db 0 +include libs/BorlandC/srchstr[data].asm include libs/BorlandC/setvbuf[data].asm include libs/BorlandC/sysnerr[data].asm include libs/BorlandC/xx[data].asm diff --git a/th01_reiiden.asm b/th01_reiiden.asm index a976b37c..1ef1aa1d 100644 --- a/th01_reiiden.asm +++ b/th01_reiiden.asm @@ -10003,9 +10003,7 @@ loc_67E5: push word ptr [bp+var_4] ; __int32 push word ptr [bp+_src+2] push word ptr [bp+_src] ; src - nop - push cs - call near ptr sub_6805 + nopcall __searchstr add sp, 0Ch pop di pop si @@ -10014,186 +10012,7 @@ loc_67E5: retf __searchenv endp - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -; int __cdecl __far sub_6805(char *src, __int32, char *pathname) -sub_6805 proc far - -var_4 = word ptr -4 -var_2 = word ptr -2 -_src = dword ptr 6 -arg_4 = dword ptr 0Ah -pathname = dword ptr 0Eh - - push bp - mov bp, sp - sub sp, 4 - push si - push di - mov ax, 50h ; 'P' - push ax ; len - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; buf - xor ax, ax - push ax ; drive - nopcall __getdcwd - add sp, 8 - or ax, dx - jnz short loc_682A - xor dx, dx - jmp short loc_6839 -; --------------------------------------------------------------------------- - -loc_682A: - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - mov dx, ax - -loc_6839: - les bx, [bp+pathname] - add bx, dx - mov byte ptr es:[bx], 0 - or dx, dx - jz short loc_688E - mov bx, dx - add bx, word ptr [bp+pathname] - mov bl, es:[bx-1] - mov al, bl - cmp al, 5Ch ; '\' - jz short loc_685F - cmp bl, 2Fh ; '/' - jz short loc_685F - cmp bl, 3Ah ; ':' - jnz short loc_687B - -loc_685F: - mov ax, word ptr [bp+pathname] - add ax, dx - dec ax - push word ptr [bp+pathname+2] - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - nopcall ___path_issbcs - add sp, 8 - or ax, ax - jnz short loc_688E - -loc_687B: - push ds - mov ax, 2022h - push ax ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - -loc_688E: - push word ptr [bp+_src+2] - push word ptr [bp+_src] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - xor ax, ax - push ax ; char - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; pathname - nopcall __access - add sp, 6 - or ax, ax - jz short loc_6902 - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_68C9 - les bx, [bp+pathname] - mov byte ptr es:[bx], 0 - jmp short loc_6941 -; --------------------------------------------------------------------------- - -loc_68C9: - xor dx, dx - jmp short loc_68E1 -; --------------------------------------------------------------------------- - -loc_68CD: - les bx, [bp+pathname] - add bx, dx - push es - les si, [bp+arg_4] - mov al, es:[si] - pop es - mov es:[bx], al - inc word ptr [bp+arg_4] - inc dx - -loc_68E1: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 3Bh ; ';' - jz short loc_68F0 - cmp byte ptr es:[bx], 0 - jnz short loc_68CD - -loc_68F0: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_68FC - jmp loc_6839 -; --------------------------------------------------------------------------- - -loc_68FC: - inc word ptr [bp+arg_4] - jmp loc_6839 -; --------------------------------------------------------------------------- - -loc_6902: - mov ax, 50h ; 'P' - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - xor ax, ax - push ax - push ax - nopcall __fullpath - add sp, 0Ah - mov [bp+var_2], dx - mov [bp+var_4], ax - or ax, dx - jz short loc_6941 - push [bp+var_2] - push [bp+var_4] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcpy - push [bp+var_2] - push [bp+var_4] - nop - push cs - call near ptr _farfree - add sp, 0Ch - -loc_6941: - pop di - pop si - mov sp, bp - pop bp - retf -sub_6805 endp - +include libs/BorlandC/srchstr.asm include libs/BorlandC/setvbuf.asm ; =============== S U B R O U T I N E ======================================= @@ -45776,8 +45595,7 @@ include libs/BorlandC/putc[data].asm db 0 db 0 db 0 - db 5Ch ; \ - db 0 +include libs/BorlandC/srchstr[data].asm include libs/BorlandC/setvbuf[data].asm include libs/BorlandC/sysnerr[data].asm include libs/BorlandC/xx[data].asm diff --git a/th02_main.asm b/th02_main.asm index 42b49cad..f97dae0d 100644 --- a/th02_main.asm +++ b/th02_main.asm @@ -3132,9 +3132,7 @@ loc_6837: push word ptr [bp+var_4] ; __int32 push word ptr [bp+src+2] push word ptr [bp+src] ; src - nop - push cs - call near ptr sub_6857 + nopcall __searchstr add sp, 0Ch pop di pop si @@ -3143,187 +3141,7 @@ loc_6837: retf __searchenv endp - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -; int __cdecl __far sub_6857(char *src, __int32, char *pathname) -sub_6857 proc far - -var_4 = word ptr -4 -var_2 = word ptr -2 -src = dword ptr 6 -arg_4 = dword ptr 0Ah -pathname = dword ptr 0Eh - - push bp - mov bp, sp - sub sp, 4 - push si - push di - mov ax, 50h ; 'P' - push ax ; len - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; buf - xor ax, ax - push ax ; drive - nopcall __getdcwd - add sp, 8 - or ax, dx - jnz short loc_687C - xor dx, dx - jmp short loc_688B -; --------------------------------------------------------------------------- - -loc_687C: - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - mov dx, ax - -loc_688B: - les bx, [bp+pathname] - add bx, dx - mov byte ptr es:[bx], 0 - or dx, dx - jz short loc_68E0 - mov bx, dx - add bx, word ptr [bp+pathname] - mov bl, es:[bx-1] - mov al, bl - cmp al, 5Ch ; '\' - jz short loc_68B1 - cmp bl, 2Fh ; '/' - jz short loc_68B1 - cmp bl, 3Ah ; ':' - jnz short loc_68CD - -loc_68B1: - mov ax, word ptr [bp+pathname] - add ax, dx - dec ax - push word ptr [bp+pathname+2] - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - nopcall ___path_issbcs - add sp, 8 - or ax, ax - jnz short loc_68E0 - -loc_68CD: - push ds - mov ax, 1926h - push ax ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - -loc_68E0: - push word ptr [bp+src+2] - push word ptr [bp+src] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - xor ax, ax - push ax ; char - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; pathname - nopcall __access - add sp, 6 - or ax, ax - jz short loc_6954 - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_691B - les bx, [bp+pathname] - mov byte ptr es:[bx], 0 - jmp short loc_6993 -; --------------------------------------------------------------------------- - -loc_691B: - xor dx, dx - jmp short loc_6933 -; --------------------------------------------------------------------------- - -loc_691F: - les bx, [bp+pathname] - add bx, dx - push es - les si, [bp+arg_4] - mov al, es:[si] - pop es - mov es:[bx], al - inc word ptr [bp+arg_4] - inc dx - -loc_6933: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 3Bh ; ';' - jz short loc_6942 - cmp byte ptr es:[bx], 0 - jnz short loc_691F - -loc_6942: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_694E - jmp loc_688B -; --------------------------------------------------------------------------- - -loc_694E: - inc word ptr [bp+arg_4] - jmp loc_688B -; --------------------------------------------------------------------------- - -loc_6954: - mov ax, 50h ; 'P' - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - xor ax, ax - push ax - push ax - nopcall __fullpath - add sp, 0Ah - mov [bp+var_2], dx - mov [bp+var_4], ax - or ax, dx - jz short loc_6993 - push [bp+var_2] - push [bp+var_4] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcpy - push [bp+var_2] - push [bp+var_4] - nop - push cs - call near ptr _farfree - add sp, 0Ch - -loc_6993: - ; sub_6857+11Bj - pop di - pop si - mov sp, bp - pop bp - retf -sub_6857 endp - +include libs/BorlandC/srchstr.asm include libs/BorlandC/setvbuf.asm include libs/BorlandC/_strcat.asm include libs/BorlandC/_strcmp.asm @@ -41277,8 +41095,7 @@ include libs/BorlandC/signal[data].asm include libs/BorlandC/pathops[data].asm db 0 db 0 - db 5Ch ; \ - db 0 +include libs/BorlandC/srchstr[data].asm include libs/BorlandC/setvbuf[data].asm include libs/BorlandC/sysnerr[data].asm include libs/BorlandC/xx[data].asm diff --git a/th02_maine.asm b/th02_maine.asm index 41d119db..5001d2c8 100644 --- a/th02_maine.asm +++ b/th02_maine.asm @@ -1182,9 +1182,7 @@ loc_4C37: push word ptr [bp+var_4] ; __int32 push word ptr [bp+src+2] push word ptr [bp+src] ; src - nop - push cs - call near ptr sub_4C57 + nopcall __searchstr add sp, 0Ch pop di pop si @@ -1193,187 +1191,7 @@ loc_4C37: retf __searchenv endp - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -; int __cdecl __far sub_4C57(char *src, __int32, char *pathname) -sub_4C57 proc far - -var_4 = word ptr -4 -var_2 = word ptr -2 -src = dword ptr 6 -arg_4 = dword ptr 0Ah -pathname = dword ptr 0Eh - - push bp - mov bp, sp - sub sp, 4 - push si - push di - mov ax, 50h ; 'P' - push ax ; len - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; buf - xor ax, ax - push ax ; drive - nopcall __getdcwd - add sp, 8 - or ax, dx - jnz short loc_4C7C - xor dx, dx - jmp short loc_4C8B -; --------------------------------------------------------------------------- - -loc_4C7C: - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - mov dx, ax - -loc_4C8B: - les bx, [bp+pathname] - add bx, dx - mov byte ptr es:[bx], 0 - or dx, dx - jz short loc_4CE0 - mov bx, dx - add bx, word ptr [bp+pathname] - mov bl, es:[bx-1] - mov al, bl - cmp al, 5Ch ; '\' - jz short loc_4CB1 - cmp bl, 2Fh ; '/' - jz short loc_4CB1 - cmp bl, 3Ah ; ':' - jnz short loc_4CCD - -loc_4CB1: - mov ax, word ptr [bp+pathname] - add ax, dx - dec ax - push word ptr [bp+pathname+2] - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - nopcall ___path_issbcs - add sp, 8 - or ax, ax - jnz short loc_4CE0 - -loc_4CCD: - push ds - mov ax, 0CE0h - push ax ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - -loc_4CE0: - push word ptr [bp+src+2] - push word ptr [bp+src] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - xor ax, ax - push ax ; char - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; pathname - nopcall __access - add sp, 6 - or ax, ax - jz short loc_4D54 - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_4D1B - les bx, [bp+pathname] - mov byte ptr es:[bx], 0 - jmp short loc_4D93 -; --------------------------------------------------------------------------- - -loc_4D1B: - xor dx, dx - jmp short loc_4D33 -; --------------------------------------------------------------------------- - -loc_4D1F: - les bx, [bp+pathname] - add bx, dx - push es - les si, [bp+arg_4] - mov al, es:[si] - pop es - mov es:[bx], al - inc word ptr [bp+arg_4] - inc dx - -loc_4D33: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 3Bh ; ';' - jz short loc_4D42 - cmp byte ptr es:[bx], 0 - jnz short loc_4D1F - -loc_4D42: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_4D4E - jmp loc_4C8B -; --------------------------------------------------------------------------- - -loc_4D4E: - inc word ptr [bp+arg_4] - jmp loc_4C8B -; --------------------------------------------------------------------------- - -loc_4D54: - mov ax, 50h ; 'P' - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - xor ax, ax - push ax - push ax - nopcall __fullpath - add sp, 0Ah - mov [bp+var_2], dx - mov [bp+var_4], ax - or ax, dx - jz short loc_4D93 - push [bp+var_2] - push [bp+var_4] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcpy - push [bp+var_2] - push [bp+var_4] - nop - push cs - call near ptr _farfree - add sp, 0Ch - -loc_4D93: - ; sub_4C57+11Bj - pop di - pop si - mov sp, bp - pop bp - retf -sub_4C57 endp - +include libs/BorlandC/srchstr.asm include libs/BorlandC/setvbuf.asm include libs/BorlandC/_strcat.asm include libs/BorlandC/_strcmp.asm @@ -7799,8 +7617,7 @@ include libs/BorlandC/fbrk[data].asm include libs/BorlandC/signal[data].asm include libs/BorlandC/pathops[data].asm dw 0 - db 5Ch ; \ - db 0 +include libs/BorlandC/srchstr[data].asm include libs/BorlandC/setvbuf[data].asm include libs/BorlandC/sysnerr[data].asm include libs/BorlandC/xx[data].asm diff --git a/th02_op.asm b/th02_op.asm index 4fc21cca..e2a68c31 100644 --- a/th02_op.asm +++ b/th02_op.asm @@ -792,9 +792,7 @@ loc_5284: push word ptr [bp+var_4] ; __int32 push word ptr [bp+src+2] push word ptr [bp+src] ; src - nop - push cs - call near ptr sub_52A4 + nopcall __searchstr add sp, 0Ch pop di pop si @@ -803,187 +801,7 @@ loc_5284: retf __searchenv endp - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -; int __cdecl __far sub_52A4(char *src, __int32, char *pathname) -sub_52A4 proc far - -var_4 = word ptr -4 -var_2 = word ptr -2 -src = dword ptr 6 -arg_4 = dword ptr 0Ah -pathname = dword ptr 0Eh - - push bp - mov bp, sp - sub sp, 4 - push si - push di - mov ax, 50h ; 'P' - push ax ; len - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; buf - xor ax, ax - push ax ; drive - nopcall __getdcwd - add sp, 8 - or ax, dx - jnz short loc_52C9 - xor dx, dx - jmp short loc_52D8 -; --------------------------------------------------------------------------- - -loc_52C9: - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - mov dx, ax - -loc_52D8: - les bx, [bp+pathname] - add bx, dx - mov byte ptr es:[bx], 0 - or dx, dx - jz short loc_532D - mov bx, dx - add bx, word ptr [bp+pathname] - mov bl, es:[bx-1] - mov al, bl - cmp al, 5Ch ; '\' - jz short loc_52FE - cmp bl, 2Fh ; '/' - jz short loc_52FE - cmp bl, 3Ah ; ':' - jnz short loc_531A - -loc_52FE: - mov ax, word ptr [bp+pathname] - add ax, dx - dec ax - push word ptr [bp+pathname+2] - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - nopcall ___path_issbcs - add sp, 8 - or ax, ax - jnz short loc_532D - -loc_531A: - push ds - mov ax, 10F6h - push ax ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - -loc_532D: - push word ptr [bp+src+2] - push word ptr [bp+src] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - xor ax, ax - push ax ; char - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; pathname - nopcall __access - add sp, 6 - or ax, ax - jz short loc_53A1 - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_5368 - les bx, [bp+pathname] - mov byte ptr es:[bx], 0 - jmp short loc_53E0 -; --------------------------------------------------------------------------- - -loc_5368: - xor dx, dx - jmp short loc_5380 -; --------------------------------------------------------------------------- - -loc_536C: - les bx, [bp+pathname] - add bx, dx - push es - les si, [bp+arg_4] - mov al, es:[si] - pop es - mov es:[bx], al - inc word ptr [bp+arg_4] - inc dx - -loc_5380: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 3Bh ; ';' - jz short loc_538F - cmp byte ptr es:[bx], 0 - jnz short loc_536C - -loc_538F: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_539B - jmp loc_52D8 -; --------------------------------------------------------------------------- - -loc_539B: - inc word ptr [bp+arg_4] - jmp loc_52D8 -; --------------------------------------------------------------------------- - -loc_53A1: - mov ax, 50h ; 'P' - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - xor ax, ax - push ax - push ax - nopcall __fullpath - add sp, 0Ah - mov [bp+var_2], dx - mov [bp+var_4], ax - or ax, dx - jz short loc_53E0 - push [bp+var_2] - push [bp+var_4] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcpy - push [bp+var_2] - push [bp+var_4] - nop - push cs - call near ptr _farfree - add sp, 0Ch - -loc_53E0: - ; sub_52A4+11Bj - pop di - pop si - mov sp, bp - pop bp - retf -sub_52A4 endp - +include libs/BorlandC/srchstr.asm include libs/BorlandC/setvbuf.asm include libs/BorlandC/_strcat.asm include libs/BorlandC/_strcmp.asm @@ -8054,8 +7872,7 @@ include libs/BorlandC/signal[data].asm include libs/BorlandC/pathops[data].asm db 0 db 0 - db 5Ch ; \ - db 0 +include libs/BorlandC/srchstr[data].asm include libs/BorlandC/setvbuf[data].asm include libs/BorlandC/sysnerr[data].asm include libs/BorlandC/xx[data].asm diff --git a/th03_main.asm b/th03_main.asm index ab5468d4..3dfad83d 100644 --- a/th03_main.asm +++ b/th03_main.asm @@ -711,9 +711,7 @@ loc_4DB9: push word ptr [bp+var_4] ; __int32 push word ptr [bp+src+2] push word ptr [bp+src] ; src - nop - push cs - call near ptr sub_4DD9 + nopcall __searchstr add sp, 0Ch pop di pop si @@ -722,187 +720,7 @@ loc_4DB9: retf __searchenv endp ; sp-analysis failed - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -; int __cdecl __far sub_4DD9(char *src, __int32, char *pathname) -sub_4DD9 proc far - -var_4 = word ptr -4 -var_2 = word ptr -2 -src = dword ptr 6 -arg_4 = dword ptr 0Ah -pathname = dword ptr 0Eh - - push bp - mov bp, sp - sub sp, 4 - push si - push di - mov ax, 50h ; 'P' - push ax ; len - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; buf - xor ax, ax - push ax ; drive - nopcall __getdcwd - add sp, 8 - or ax, dx - jnz short loc_4DFE - xor dx, dx - jmp short loc_4E0D -; --------------------------------------------------------------------------- - -loc_4DFE: - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - mov dx, ax - -loc_4E0D: - les bx, [bp+pathname] - add bx, dx - mov byte ptr es:[bx], 0 - or dx, dx - jz short loc_4E62 - mov bx, dx - add bx, word ptr [bp+pathname] - mov bl, es:[bx-1] - mov al, bl - cmp al, 5Ch ; '\' - jz short loc_4E33 - cmp bl, 2Fh ; '/' - jz short loc_4E33 - cmp bl, 3Ah ; ':' - jnz short loc_4E4F - -loc_4E33: - mov ax, word ptr [bp+pathname] - add ax, dx - dec ax - push word ptr [bp+pathname+2] - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - nopcall ___path_issbcs - add sp, 8 - or ax, ax - jnz short loc_4E62 - -loc_4E4F: - push ds - mov ax, 10B2h - push ax ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - -loc_4E62: - push word ptr [bp+src+2] - push word ptr [bp+src] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - xor ax, ax - push ax ; char - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; pathname - nopcall __access - add sp, 6 - or ax, ax - jz short loc_4ED6 - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_4E9D - les bx, [bp+pathname] - mov byte ptr es:[bx], 0 - jmp short loc_4F15 -; --------------------------------------------------------------------------- - -loc_4E9D: - xor dx, dx - jmp short loc_4EB5 -; --------------------------------------------------------------------------- - -loc_4EA1: - les bx, [bp+pathname] - add bx, dx - push es - les si, [bp+arg_4] - mov al, es:[si] - pop es - mov es:[bx], al - inc word ptr [bp+arg_4] - inc dx - -loc_4EB5: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 3Bh ; ';' - jz short loc_4EC4 - cmp byte ptr es:[bx], 0 - jnz short loc_4EA1 - -loc_4EC4: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_4ED0 - jmp loc_4E0D -; --------------------------------------------------------------------------- - -loc_4ED0: - inc word ptr [bp+arg_4] - jmp loc_4E0D -; --------------------------------------------------------------------------- - -loc_4ED6: - mov ax, 50h ; 'P' - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - xor ax, ax - push ax - push ax - nopcall __fullpath - add sp, 0Ah - mov [bp+var_2], dx - mov [bp+var_4], ax - or ax, dx - jz short loc_4F15 - push [bp+var_2] - push [bp+var_4] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcpy - push [bp+var_2] - push [bp+var_4] - nop - push cs - call near ptr _farfree - add sp, 0Ch - -loc_4F15: - ; sub_4DD9+11Bj - pop di - pop si - mov sp, bp - pop bp - retf -sub_4DD9 endp - +include libs/BorlandC/srchstr.asm include libs/BorlandC/setvbuf.asm include libs/BorlandC/_strcat.asm include libs/BorlandC/_strcmp.asm @@ -40992,8 +40810,7 @@ include libs/BorlandC/signal[data].asm include libs/BorlandC/pathops[data].asm db 0 db 0 - db 5Ch ; \ - db 0 +include libs/BorlandC/srchstr[data].asm include libs/BorlandC/setvbuf[data].asm include libs/BorlandC/sysnerr[data].asm include libs/BorlandC/xx[data].asm diff --git a/th03_mainl.asm b/th03_mainl.asm index 8e7c43e3..78a424ff 100644 --- a/th03_mainl.asm +++ b/th03_mainl.asm @@ -905,9 +905,7 @@ loc_4C87: push word ptr [bp+var_4] ; __int32 push word ptr [bp+src+2] push word ptr [bp+src] ; src - nop - push cs - call near ptr sub_4CA7 + nopcall __searchstr add sp, 0Ch pop di pop si @@ -916,187 +914,7 @@ loc_4C87: retf __searchenv endp - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -; int __cdecl __far sub_4CA7(char *src, __int32, char *pathname) -sub_4CA7 proc far - -var_4 = word ptr -4 -var_2 = word ptr -2 -src = dword ptr 6 -arg_4 = dword ptr 0Ah -pathname = dword ptr 0Eh - - push bp - mov bp, sp - sub sp, 4 - push si - push di - mov ax, 50h ; 'P' - push ax ; len - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; buf - xor ax, ax - push ax ; drive - nopcall __getdcwd - add sp, 8 - or ax, dx - jnz short loc_4CCC - xor dx, dx - jmp short loc_4CDB -; --------------------------------------------------------------------------- - -loc_4CCC: - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - mov dx, ax - -loc_4CDB: - les bx, [bp+pathname] - add bx, dx - mov byte ptr es:[bx], 0 - or dx, dx - jz short loc_4D30 - mov bx, dx - add bx, word ptr [bp+pathname] - mov bl, es:[bx-1] - mov al, bl - cmp al, 5Ch ; '\' - jz short loc_4D01 - cmp bl, 2Fh ; '/' - jz short loc_4D01 - cmp bl, 3Ah ; ':' - jnz short loc_4D1D - -loc_4D01: - mov ax, word ptr [bp+pathname] - add ax, dx - dec ax - push word ptr [bp+pathname+2] - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - nopcall ___path_issbcs - add sp, 8 - or ax, ax - jnz short loc_4D30 - -loc_4D1D: - push ds - mov ax, 116Ah - push ax ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - -loc_4D30: - push word ptr [bp+src+2] - push word ptr [bp+src] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - xor ax, ax - push ax ; char - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; pathname - nopcall __access - add sp, 6 - or ax, ax - jz short loc_4DA4 - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_4D6B - les bx, [bp+pathname] - mov byte ptr es:[bx], 0 - jmp short loc_4DE3 -; --------------------------------------------------------------------------- - -loc_4D6B: - xor dx, dx - jmp short loc_4D83 -; --------------------------------------------------------------------------- - -loc_4D6F: - les bx, [bp+pathname] - add bx, dx - push es - les si, [bp+arg_4] - mov al, es:[si] - pop es - mov es:[bx], al - inc word ptr [bp+arg_4] - inc dx - -loc_4D83: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 3Bh ; ';' - jz short loc_4D92 - cmp byte ptr es:[bx], 0 - jnz short loc_4D6F - -loc_4D92: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_4D9E - jmp loc_4CDB -; --------------------------------------------------------------------------- - -loc_4D9E: - inc word ptr [bp+arg_4] - jmp loc_4CDB -; --------------------------------------------------------------------------- - -loc_4DA4: - mov ax, 50h ; 'P' - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - xor ax, ax - push ax - push ax - nopcall __fullpath - add sp, 0Ah - mov [bp+var_2], dx - mov [bp+var_4], ax - or ax, dx - jz short loc_4DE3 - push [bp+var_2] - push [bp+var_4] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcpy - push [bp+var_2] - push [bp+var_4] - nop - push cs - call near ptr _farfree - add sp, 0Ch - -loc_4DE3: - ; sub_4CA7+11Bj - pop di - pop si - mov sp, bp - pop bp - retf -sub_4CA7 endp - +include libs/BorlandC/srchstr.asm include libs/BorlandC/setvbuf.asm include libs/BorlandC/_strcat.asm include libs/BorlandC/_strcmp.asm @@ -10500,8 +10318,7 @@ include libs/BorlandC/signal[data].asm include libs/BorlandC/pathops[data].asm db 0 db 0 - db 5Ch ; \ - db 0 +include libs/BorlandC/srchstr[data].asm include libs/BorlandC/setvbuf[data].asm include libs/BorlandC/sysnerr[data].asm include libs/BorlandC/xx[data].asm diff --git a/th03_op.asm b/th03_op.asm index d91554f5..0360eb81 100644 --- a/th03_op.asm +++ b/th03_op.asm @@ -985,9 +985,7 @@ loc_4F69: push word ptr [bp+var_4] ; __int32 push word ptr [bp+src+2] push word ptr [bp+src] ; src - nop - push cs - call near ptr sub_4F89 + nopcall __searchstr add sp, 0Ch pop di pop si @@ -996,187 +994,7 @@ loc_4F69: retf __searchenv endp - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -; int __cdecl __far sub_4F89(char *src, __int32, char *pathname) -sub_4F89 proc far - -var_4 = word ptr -4 -var_2 = word ptr -2 -src = dword ptr 6 -arg_4 = dword ptr 0Ah -pathname = dword ptr 0Eh - - push bp - mov bp, sp - sub sp, 4 - push si - push di - mov ax, 50h ; 'P' - push ax ; len - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; buf - xor ax, ax - push ax ; drive - nopcall __getdcwd - add sp, 8 - or ax, dx - jnz short loc_4FAE - xor dx, dx - jmp short loc_4FBD -; --------------------------------------------------------------------------- - -loc_4FAE: - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - mov dx, ax - -loc_4FBD: - les bx, [bp+pathname] - add bx, dx - mov byte ptr es:[bx], 0 - or dx, dx - jz short loc_5012 - mov bx, dx - add bx, word ptr [bp+pathname] - mov bl, es:[bx-1] - mov al, bl - cmp al, 5Ch ; '\' - jz short loc_4FE3 - cmp bl, 2Fh ; '/' - jz short loc_4FE3 - cmp bl, 3Ah ; ':' - jnz short loc_4FFF - -loc_4FE3: - mov ax, word ptr [bp+pathname] - add ax, dx - dec ax - push word ptr [bp+pathname+2] - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - nopcall ___path_issbcs - add sp, 8 - or ax, ax - jnz short loc_5012 - -loc_4FFF: - push ds - mov ax, 0FB6h - push ax ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - -loc_5012: - push word ptr [bp+src+2] - push word ptr [bp+src] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - xor ax, ax - push ax ; char - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; pathname - nopcall __access - add sp, 6 - or ax, ax - jz short loc_5086 - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_504D - les bx, [bp+pathname] - mov byte ptr es:[bx], 0 - jmp short loc_50C5 -; --------------------------------------------------------------------------- - -loc_504D: - xor dx, dx - jmp short loc_5065 -; --------------------------------------------------------------------------- - -loc_5051: - les bx, [bp+pathname] - add bx, dx - push es - les si, [bp+arg_4] - mov al, es:[si] - pop es - mov es:[bx], al - inc word ptr [bp+arg_4] - inc dx - -loc_5065: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 3Bh ; ';' - jz short loc_5074 - cmp byte ptr es:[bx], 0 - jnz short loc_5051 - -loc_5074: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_5080 - jmp loc_4FBD -; --------------------------------------------------------------------------- - -loc_5080: - inc word ptr [bp+arg_4] - jmp loc_4FBD -; --------------------------------------------------------------------------- - -loc_5086: - mov ax, 50h ; 'P' - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - xor ax, ax - push ax - push ax - nopcall __fullpath - add sp, 0Ah - mov [bp+var_2], dx - mov [bp+var_4], ax - or ax, dx - jz short loc_50C5 - push [bp+var_2] - push [bp+var_4] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcpy - push [bp+var_2] - push [bp+var_4] - nop - push cs - call near ptr _farfree - add sp, 0Ch - -loc_50C5: - ; sub_4F89+11Bj - pop di - pop si - mov sp, bp - pop bp - retf -sub_4F89 endp - +include libs/BorlandC/srchstr.asm include libs/BorlandC/setvbuf.asm include libs/BorlandC/_strcat.asm include libs/BorlandC/_strcmp.asm @@ -8574,8 +8392,7 @@ include libs/BorlandC/signal[data].asm include libs/BorlandC/pathops[data].asm db 0 db 0 - db 5Ch ; \ - db 0 +include libs/BorlandC/srchstr[data].asm include libs/BorlandC/setvbuf[data].asm include libs/BorlandC/sysnerr[data].asm include libs/BorlandC/xx[data].asm diff --git a/th04_main.asm b/th04_main.asm index 42675a81..44e9d4c8 100644 --- a/th04_main.asm +++ b/th04_main.asm @@ -1408,9 +1408,7 @@ loc_61C5: push word ptr [bp+var_4] ; __int32 push word ptr [bp+src+2] push word ptr [bp+src] ; src - nop - push cs - call near ptr sub_61E5 + nopcall __searchstr add sp, 0Ch pop di pop si @@ -1419,187 +1417,7 @@ loc_61C5: retf __searchenv endp - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -; int __cdecl __far sub_61E5(char *src, __int32, char *pathname) -sub_61E5 proc far - -var_4 = word ptr -4 -var_2 = word ptr -2 -src = dword ptr 6 -arg_4 = dword ptr 0Ah -pathname = dword ptr 0Eh - - push bp - mov bp, sp - sub sp, 4 - push si - push di - mov ax, 50h ; 'P' - push ax ; len - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; buf - xor ax, ax - push ax ; drive - nopcall __getdcwd - add sp, 8 - or ax, dx - jnz short loc_620A - xor dx, dx - jmp short loc_6219 -; --------------------------------------------------------------------------- - -loc_620A: - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - mov dx, ax - -loc_6219: - les bx, [bp+pathname] - add bx, dx - mov byte ptr es:[bx], 0 - or dx, dx - jz short loc_626E - mov bx, dx - add bx, word ptr [bp+pathname] - mov bl, es:[bx-1] - mov al, bl - cmp al, 5Ch ; '\' - jz short loc_623F - cmp bl, 2Fh ; '/' - jz short loc_623F - cmp bl, 3Ah ; ':' - jnz short loc_625B - -loc_623F: - mov ax, word ptr [bp+pathname] - add ax, dx - dec ax - push word ptr [bp+pathname+2] - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - nopcall ___path_issbcs - add sp, 8 - or ax, ax - jnz short loc_626E - -loc_625B: - push ds - mov ax, 297Eh - push ax ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - -loc_626E: - push word ptr [bp+src+2] - push word ptr [bp+src] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - xor ax, ax - push ax ; char - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; pathname - nopcall __access - add sp, 6 - or ax, ax - jz short loc_62E2 - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_62A9 - les bx, [bp+pathname] - mov byte ptr es:[bx], 0 - jmp short loc_6321 -; --------------------------------------------------------------------------- - -loc_62A9: - xor dx, dx - jmp short loc_62C1 -; --------------------------------------------------------------------------- - -loc_62AD: - les bx, [bp+pathname] - add bx, dx - push es - les si, [bp+arg_4] - mov al, es:[si] - pop es - mov es:[bx], al - inc word ptr [bp+arg_4] - inc dx - -loc_62C1: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 3Bh ; ';' - jz short loc_62D0 - cmp byte ptr es:[bx], 0 - jnz short loc_62AD - -loc_62D0: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_62DC - jmp loc_6219 -; --------------------------------------------------------------------------- - -loc_62DC: - inc word ptr [bp+arg_4] - jmp loc_6219 -; --------------------------------------------------------------------------- - -loc_62E2: - mov ax, 50h ; 'P' - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - xor ax, ax - push ax - push ax - nopcall __fullpath - add sp, 0Ah - mov [bp+var_2], dx - mov [bp+var_4], ax - or ax, dx - jz short loc_6321 - push [bp+var_2] - push [bp+var_4] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcpy - push [bp+var_2] - push [bp+var_4] - nop - push cs - call near ptr _farfree - add sp, 0Ch - -loc_6321: - ; sub_61E5+11Bj - pop di - pop si - mov sp, bp - pop bp - retf -sub_61E5 endp - +include libs/BorlandC/srchstr.asm include libs/BorlandC/setvbuf.asm include libs/BorlandC/_strcat.asm include libs/BorlandC/_strcmp.asm @@ -25016,8 +24834,7 @@ include libs/BorlandC/signal[data].asm include libs/BorlandC/pathops[data].asm db 0 db 0 - db 5Ch ; \ - db 0 +include libs/BorlandC/srchstr[data].asm include libs/BorlandC/setvbuf[data].asm include libs/BorlandC/sysnerr[data].asm include libs/BorlandC/xx[data].asm diff --git a/th04_maine.asm b/th04_maine.asm index 67e2318f..e5a6bb90 100644 --- a/th04_maine.asm +++ b/th04_maine.asm @@ -1072,9 +1072,7 @@ loc_572D: push word ptr [bp+var_4] ; __int32 push word ptr [bp+src+2] push word ptr [bp+src] ; src - nop - push cs - call near ptr sub_574D + nopcall __searchstr add sp, 0Ch pop di pop si @@ -1083,187 +1081,7 @@ loc_572D: retf __searchenv endp - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -; int __cdecl __far sub_574D(char *src, __int32, char *pathname) -sub_574D proc far - -var_4 = word ptr -4 -var_2 = word ptr -2 -src = dword ptr 6 -arg_4 = dword ptr 0Ah -pathname = dword ptr 0Eh - - push bp - mov bp, sp - sub sp, 4 - push si - push di - mov ax, 50h ; 'P' - push ax ; len - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; buf - xor ax, ax - push ax ; drive - nopcall __getdcwd - add sp, 8 - or ax, dx - jnz short loc_5772 - xor dx, dx - jmp short loc_5781 -; --------------------------------------------------------------------------- - -loc_5772: - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - mov dx, ax - -loc_5781: - les bx, [bp+pathname] - add bx, dx - mov byte ptr es:[bx], 0 - or dx, dx - jz short loc_57D6 - mov bx, dx - add bx, word ptr [bp+pathname] - mov bl, es:[bx-1] - mov al, bl - cmp al, 5Ch ; '\' - jz short loc_57A7 - cmp bl, 2Fh ; '/' - jz short loc_57A7 - cmp bl, 3Ah ; ':' - jnz short loc_57C3 - -loc_57A7: - mov ax, word ptr [bp+pathname] - add ax, dx - dec ax - push word ptr [bp+pathname+2] - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - nopcall ___path_issbcs - add sp, 8 - or ax, ax - jnz short loc_57D6 - -loc_57C3: - push ds - mov ax, 0DCEh - push ax ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - -loc_57D6: - push word ptr [bp+src+2] - push word ptr [bp+src] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - xor ax, ax - push ax ; char - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; pathname - nopcall __access - add sp, 6 - or ax, ax - jz short loc_584A - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_5811 - les bx, [bp+pathname] - mov byte ptr es:[bx], 0 - jmp short loc_5889 -; --------------------------------------------------------------------------- - -loc_5811: - xor dx, dx - jmp short loc_5829 -; --------------------------------------------------------------------------- - -loc_5815: - les bx, [bp+pathname] - add bx, dx - push es - les si, [bp+arg_4] - mov al, es:[si] - pop es - mov es:[bx], al - inc word ptr [bp+arg_4] - inc dx - -loc_5829: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 3Bh ; ';' - jz short loc_5838 - cmp byte ptr es:[bx], 0 - jnz short loc_5815 - -loc_5838: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_5844 - jmp loc_5781 -; --------------------------------------------------------------------------- - -loc_5844: - inc word ptr [bp+arg_4] - jmp loc_5781 -; --------------------------------------------------------------------------- - -loc_584A: - mov ax, 50h ; 'P' - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - xor ax, ax - push ax - push ax - nopcall __fullpath - add sp, 0Ah - mov [bp+var_2], dx - mov [bp+var_4], ax - or ax, dx - jz short loc_5889 - push [bp+var_2] - push [bp+var_4] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcpy - push [bp+var_2] - push [bp+var_4] - nop - push cs - call near ptr _farfree - add sp, 0Ch - -loc_5889: - ; sub_574D+11Bj - pop di - pop si - mov sp, bp - pop bp - retf -sub_574D endp - +include libs/BorlandC/srchstr.asm include libs/BorlandC/setvbuf.asm include libs/BorlandC/_strcat.asm include libs/BorlandC/_strcmp.asm @@ -9308,8 +9126,7 @@ include libs/BorlandC/signal[data].asm include libs/BorlandC/pathops[data].asm db 0 db 0 - db 5Ch ; \ - db 0 +include libs/BorlandC/srchstr[data].asm include libs/BorlandC/setvbuf[data].asm include libs/BorlandC/sysnerr[data].asm include libs/BorlandC/xx[data].asm diff --git a/th04_op.asm b/th04_op.asm index e6df0cb4..64d4923d 100644 --- a/th04_op.asm +++ b/th04_op.asm @@ -853,9 +853,7 @@ loc_5DED: push word ptr [bp+var_4] ; __int32 push word ptr [bp+src+2] push word ptr [bp+src] ; src - nop - push cs - call near ptr sub_5E0D + nopcall __searchstr add sp, 0Ch pop di pop si @@ -864,187 +862,7 @@ loc_5DED: retf __searchenv endp - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -; int __cdecl __far sub_5E0D(char *src, __int32, char *pathname) -sub_5E0D proc far - -var_4 = word ptr -4 -var_2 = word ptr -2 -src = dword ptr 6 -arg_4 = dword ptr 0Ah -pathname = dword ptr 0Eh - - push bp - mov bp, sp - sub sp, 4 - push si - push di - mov ax, 50h ; 'P' - push ax ; len - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; buf - xor ax, ax - push ax ; drive - nopcall __getdcwd - add sp, 8 - or ax, dx - jnz short loc_5E32 - xor dx, dx - jmp short loc_5E41 -; --------------------------------------------------------------------------- - -loc_5E32: - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - mov dx, ax - -loc_5E41: - les bx, [bp+pathname] - add bx, dx - mov byte ptr es:[bx], 0 - or dx, dx - jz short loc_5E96 - mov bx, dx - add bx, word ptr [bp+pathname] - mov bl, es:[bx-1] - mov al, bl - cmp al, 5Ch ; '\' - jz short loc_5E67 - cmp bl, 2Fh ; '/' - jz short loc_5E67 - cmp bl, 3Ah ; ':' - jnz short loc_5E83 - -loc_5E67: - mov ax, word ptr [bp+pathname] - add ax, dx - dec ax - push word ptr [bp+pathname+2] - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - nopcall ___path_issbcs - add sp, 8 - or ax, ax - jnz short loc_5E96 - -loc_5E83: - push ds - mov ax, 1992h - push ax ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - -loc_5E96: - push word ptr [bp+src+2] - push word ptr [bp+src] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - xor ax, ax - push ax ; char - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; pathname - nopcall __access - add sp, 6 - or ax, ax - jz short loc_5F0A - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_5ED1 - les bx, [bp+pathname] - mov byte ptr es:[bx], 0 - jmp short loc_5F49 -; --------------------------------------------------------------------------- - -loc_5ED1: - xor dx, dx - jmp short loc_5EE9 -; --------------------------------------------------------------------------- - -loc_5ED5: - les bx, [bp+pathname] - add bx, dx - push es - les si, [bp+arg_4] - mov al, es:[si] - pop es - mov es:[bx], al - inc word ptr [bp+arg_4] - inc dx - -loc_5EE9: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 3Bh ; ';' - jz short loc_5EF8 - cmp byte ptr es:[bx], 0 - jnz short loc_5ED5 - -loc_5EF8: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_5F04 - jmp loc_5E41 -; --------------------------------------------------------------------------- - -loc_5F04: - inc word ptr [bp+arg_4] - jmp loc_5E41 -; --------------------------------------------------------------------------- - -loc_5F0A: - mov ax, 50h ; 'P' - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - xor ax, ax - push ax - push ax - nopcall __fullpath - add sp, 0Ah - mov [bp+var_2], dx - mov [bp+var_4], ax - or ax, dx - jz short loc_5F49 - push [bp+var_2] - push [bp+var_4] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcpy - push [bp+var_2] - push [bp+var_4] - nop - push cs - call near ptr _farfree - add sp, 0Ch - -loc_5F49: - ; sub_5E0D+11Bj - pop di - pop si - mov sp, bp - pop bp - retf -sub_5E0D endp - +include libs/BorlandC/srchstr.asm include libs/BorlandC/setvbuf.asm include libs/BorlandC/_strcat.asm include libs/BorlandC/_strcmp.asm @@ -10124,8 +9942,7 @@ include libs/BorlandC/signal[data].asm include libs/BorlandC/pathops[data].asm db 0 db 0 - db 5Ch ; \ - db 0 +include libs/BorlandC/srchstr[data].asm include libs/BorlandC/setvbuf[data].asm include libs/BorlandC/sysnerr[data].asm include libs/BorlandC/xx[data].asm diff --git a/th05_main.asm b/th05_main.asm index cb7102ce..436431cd 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -1527,9 +1527,7 @@ loc_64F1: push word ptr [bp+var_4] ; __int32 push word ptr [bp+src+2] push word ptr [bp+src] ; src - nop - push cs - call near ptr sub_6511 + nopcall __searchstr add sp, 0Ch pop di pop si @@ -1538,187 +1536,7 @@ loc_64F1: retf __searchenv endp - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -; int __cdecl __far sub_6511(char *src, __int32, char *pathname) -sub_6511 proc far - -var_4 = word ptr -4 -var_2 = word ptr -2 -src = dword ptr 6 -arg_4 = dword ptr 0Ah -pathname = dword ptr 0Eh - - push bp - mov bp, sp - sub sp, 4 - push si - push di - mov ax, 50h ; 'P' - push ax ; len - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; buf - xor ax, ax - push ax ; drive - nopcall __getdcwd - add sp, 8 - or ax, dx - jnz short loc_6536 - xor dx, dx - jmp short loc_6545 -; --------------------------------------------------------------------------- - -loc_6536: - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - mov dx, ax - -loc_6545: - les bx, [bp+pathname] - add bx, dx - mov byte ptr es:[bx], 0 - or dx, dx - jz short loc_659A - mov bx, dx - add bx, word ptr [bp+pathname] - mov bl, es:[bx-1] - mov al, bl - cmp al, 5Ch ; '\' - jz short loc_656B - cmp bl, 2Fh ; '/' - jz short loc_656B - cmp bl, 3Ah ; ':' - jnz short loc_6587 - -loc_656B: - mov ax, word ptr [bp+pathname] - add ax, dx - dec ax - push word ptr [bp+pathname+2] - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - nopcall ___path_issbcs - add sp, 8 - or ax, ax - jnz short loc_659A - -loc_6587: - push ds - mov ax, 255Ch - push ax ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - -loc_659A: - push word ptr [bp+src+2] - push word ptr [bp+src] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - xor ax, ax - push ax ; char - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; pathname - nopcall __access - add sp, 6 - or ax, ax - jz short loc_660E - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_65D5 - les bx, [bp+pathname] - mov byte ptr es:[bx], 0 - jmp short loc_664D -; --------------------------------------------------------------------------- - -loc_65D5: - xor dx, dx - jmp short loc_65ED -; --------------------------------------------------------------------------- - -loc_65D9: - les bx, [bp+pathname] - add bx, dx - push es - les si, [bp+arg_4] - mov al, es:[si] - pop es - mov es:[bx], al - inc word ptr [bp+arg_4] - inc dx - -loc_65ED: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 3Bh ; ';' - jz short loc_65FC - cmp byte ptr es:[bx], 0 - jnz short loc_65D9 - -loc_65FC: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_6608 - jmp loc_6545 -; --------------------------------------------------------------------------- - -loc_6608: - inc word ptr [bp+arg_4] - jmp loc_6545 -; --------------------------------------------------------------------------- - -loc_660E: - mov ax, 50h ; 'P' - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - xor ax, ax - push ax - push ax - nopcall __fullpath - add sp, 0Ah - mov [bp+var_2], dx - mov [bp+var_4], ax - or ax, dx - jz short loc_664D - push [bp+var_2] - push [bp+var_4] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcpy - push [bp+var_2] - push [bp+var_4] - nop - push cs - call near ptr _farfree - add sp, 0Ch - -loc_664D: - ; sub_6511+11Bj - pop di - pop si - mov sp, bp - pop bp - retf -sub_6511 endp - +include libs/BorlandC/srchstr.asm include libs/BorlandC/setvbuf.asm include libs/BorlandC/_strcat.asm include libs/BorlandC/_strcmp.asm @@ -25613,8 +25431,7 @@ include libs/BorlandC/signal[data].asm include libs/BorlandC/pathops[data].asm db 0 db 0 - db 5Ch ; \ - db 0 +include libs/BorlandC/srchstr[data].asm include libs/BorlandC/setvbuf[data].asm include libs/BorlandC/sysnerr[data].asm include libs/BorlandC/xx[data].asm diff --git a/th05_maine.asm b/th05_maine.asm index 50625de6..9a98f38c 100644 --- a/th05_maine.asm +++ b/th05_maine.asm @@ -1225,9 +1225,7 @@ loc_5C19: push word ptr [bp+var_4] ; __int32 push word ptr [bp+src+2] push word ptr [bp+src] ; src - nop - push cs - call near ptr sub_5C39 + nopcall __searchstr add sp, 0Ch pop di pop si @@ -1236,187 +1234,7 @@ loc_5C19: retf __searchenv endp - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -; int __cdecl __far sub_5C39(char *src, __int32, char *pathname) -sub_5C39 proc far - -var_4 = word ptr -4 -var_2 = word ptr -2 -src = dword ptr 6 -arg_4 = dword ptr 0Ah -pathname = dword ptr 0Eh - - push bp - mov bp, sp - sub sp, 4 - push si - push di - mov ax, 50h ; 'P' - push ax ; len - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; buf - xor ax, ax - push ax ; drive - nopcall __getdcwd - add sp, 8 - or ax, dx - jnz short loc_5C5E - xor dx, dx - jmp short loc_5C6D -; --------------------------------------------------------------------------- - -loc_5C5E: - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - mov dx, ax - -loc_5C6D: - les bx, [bp+pathname] - add bx, dx - mov byte ptr es:[bx], 0 - or dx, dx - jz short loc_5CC2 - mov bx, dx - add bx, word ptr [bp+pathname] - mov bl, es:[bx-1] - mov al, bl - cmp al, 5Ch ; '\' - jz short loc_5C93 - cmp bl, 2Fh ; '/' - jz short loc_5C93 - cmp bl, 3Ah ; ':' - jnz short loc_5CAF - -loc_5C93: - mov ax, word ptr [bp+pathname] - add ax, dx - dec ax - push word ptr [bp+pathname+2] - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - nopcall ___path_issbcs - add sp, 8 - or ax, ax - jnz short loc_5CC2 - -loc_5CAF: - push ds - mov ax, 1C9Eh - push ax ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - -loc_5CC2: - push word ptr [bp+src+2] - push word ptr [bp+src] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - xor ax, ax - push ax ; char - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; pathname - nopcall __access - add sp, 6 - or ax, ax - jz short loc_5D36 - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_5CFD - les bx, [bp+pathname] - mov byte ptr es:[bx], 0 - jmp short loc_5D75 -; --------------------------------------------------------------------------- - -loc_5CFD: - xor dx, dx - jmp short loc_5D15 -; --------------------------------------------------------------------------- - -loc_5D01: - les bx, [bp+pathname] - add bx, dx - push es - les si, [bp+arg_4] - mov al, es:[si] - pop es - mov es:[bx], al - inc word ptr [bp+arg_4] - inc dx - -loc_5D15: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 3Bh ; ';' - jz short loc_5D24 - cmp byte ptr es:[bx], 0 - jnz short loc_5D01 - -loc_5D24: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_5D30 - jmp loc_5C6D -; --------------------------------------------------------------------------- - -loc_5D30: - inc word ptr [bp+arg_4] - jmp loc_5C6D -; --------------------------------------------------------------------------- - -loc_5D36: - mov ax, 50h ; 'P' - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - xor ax, ax - push ax - push ax - nopcall __fullpath - add sp, 0Ah - mov [bp+var_2], dx - mov [bp+var_4], ax - or ax, dx - jz short loc_5D75 - push [bp+var_2] - push [bp+var_4] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcpy - push [bp+var_2] - push [bp+var_4] - nop - push cs - call near ptr _farfree - add sp, 0Ch - -loc_5D75: - ; sub_5C39+11Bj - pop di - pop si - mov sp, bp - pop bp - retf -sub_5C39 endp - +include libs/BorlandC/srchstr.asm include libs/BorlandC/setvbuf.asm include libs/BorlandC/_strcat.asm include libs/BorlandC/_strcmp.asm @@ -12855,8 +12673,7 @@ include libs/BorlandC/signal[data].asm include libs/BorlandC/pathops[data].asm db 0 db 0 - db 5Ch ; \ - db 0 +include libs/BorlandC/srchstr[data].asm include libs/BorlandC/setvbuf[data].asm include libs/BorlandC/sysnerr[data].asm include libs/BorlandC/xx[data].asm diff --git a/th05_op.asm b/th05_op.asm index 07d6efdb..63be754f 100644 --- a/th05_op.asm +++ b/th05_op.asm @@ -1125,9 +1125,7 @@ loc_5A3D: push word ptr [bp+var_4] ; __int32 push word ptr [bp+src+2] push word ptr [bp+src] ; src - nop - push cs - call near ptr sub_5A5D + nopcall __searchstr add sp, 0Ch pop di pop si @@ -1136,187 +1134,7 @@ loc_5A3D: retf __searchenv endp - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -; int __cdecl __far sub_5A5D(char *src, __int32, char *pathname) -sub_5A5D proc far - -var_4 = word ptr -4 -var_2 = word ptr -2 -src = dword ptr 6 -arg_4 = dword ptr 0Ah -pathname = dword ptr 0Eh - - push bp - mov bp, sp - sub sp, 4 - push si - push di - mov ax, 50h ; 'P' - push ax ; len - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; buf - xor ax, ax - push ax ; drive - nopcall __getdcwd - add sp, 8 - or ax, dx - jnz short loc_5A82 - xor dx, dx - jmp short loc_5A91 -; --------------------------------------------------------------------------- - -loc_5A82: - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; s - nop - push cs - call near ptr _strlen - pop cx - pop cx - mov dx, ax - -loc_5A91: - les bx, [bp+pathname] - add bx, dx - mov byte ptr es:[bx], 0 - or dx, dx - jz short loc_5AE6 - mov bx, dx - add bx, word ptr [bp+pathname] - mov bl, es:[bx-1] - mov al, bl - cmp al, 5Ch ; '\' - jz short loc_5AB7 - cmp bl, 2Fh ; '/' - jz short loc_5AB7 - cmp bl, 3Ah ; ':' - jnz short loc_5AD3 - -loc_5AB7: - mov ax, word ptr [bp+pathname] - add ax, dx - dec ax - push word ptr [bp+pathname+2] - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - nopcall ___path_issbcs - add sp, 8 - or ax, ax - jnz short loc_5AE6 - -loc_5AD3: - push ds - mov ax, 2D1Ah - push ax ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - -loc_5AE6: - push word ptr [bp+src+2] - push word ptr [bp+src] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcat - add sp, 8 - xor ax, ax - push ax ; char - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; pathname - nopcall __access - add sp, 6 - or ax, ax - jz short loc_5B5A - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_5B21 - les bx, [bp+pathname] - mov byte ptr es:[bx], 0 - jmp short loc_5B99 -; --------------------------------------------------------------------------- - -loc_5B21: - xor dx, dx - jmp short loc_5B39 -; --------------------------------------------------------------------------- - -loc_5B25: - les bx, [bp+pathname] - add bx, dx - push es - les si, [bp+arg_4] - mov al, es:[si] - pop es - mov es:[bx], al - inc word ptr [bp+arg_4] - inc dx - -loc_5B39: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 3Bh ; ';' - jz short loc_5B48 - cmp byte ptr es:[bx], 0 - jnz short loc_5B25 - -loc_5B48: - les bx, [bp+arg_4] - cmp byte ptr es:[bx], 0 - jnz short loc_5B54 - jmp loc_5A91 -; --------------------------------------------------------------------------- - -loc_5B54: - inc word ptr [bp+arg_4] - jmp loc_5A91 -; --------------------------------------------------------------------------- - -loc_5B5A: - mov ax, 50h ; 'P' - push ax - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] - xor ax, ax - push ax - push ax - nopcall __fullpath - add sp, 0Ah - mov [bp+var_2], dx - mov [bp+var_4], ax - or ax, dx - jz short loc_5B99 - push [bp+var_2] - push [bp+var_4] ; src - push word ptr [bp+pathname+2] - push word ptr [bp+pathname] ; dest - nop - push cs - call near ptr _strcpy - push [bp+var_2] - push [bp+var_4] - nop - push cs - call near ptr _farfree - add sp, 0Ch - -loc_5B99: - ; sub_5A5D+11Bj - pop di - pop si - mov sp, bp - pop bp - retf -sub_5A5D endp - +include libs/BorlandC/srchstr.asm include libs/BorlandC/setvbuf.asm include libs/BorlandC/_strcat.asm include libs/BorlandC/_strcmp.asm @@ -11287,8 +11105,7 @@ include libs/BorlandC/signal[data].asm include libs/BorlandC/pathops[data].asm db 0 db 0 - db 5Ch ; \ - db 0 +include libs/BorlandC/srchstr[data].asm include libs/BorlandC/setvbuf[data].asm include libs/BorlandC/sysnerr[data].asm include libs/BorlandC/xx[data].asm