requested changes (all)
This commit is contained in:
@@ -3,6 +3,6 @@
|
|||||||
|
|
||||||
format binary as ""
|
format binary as ""
|
||||||
|
|
||||||
TARGET equ '/kolibrios/emul/dgen/dgen'
|
WRAPPER_SUFFIX equ '_open'
|
||||||
|
|
||||||
include '../../quotkinizer.inc'
|
include '../../quotkinizer.inc'
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
; wraps command line arguments in quotes and launches a target.
|
; wraps command line arguments in quotes and launches a target.
|
||||||
; TARGET equ 'target_name' must be defined before including this file.
|
; WRAPPER_SUFFIX equ '_wrapper_name' must be defined before including this file.
|
||||||
|
|
||||||
include 'KOSfuncs.inc'
|
include 'KOSfuncs.inc'
|
||||||
|
|
||||||
|
virtual
|
||||||
|
db WRAPPER_SUFFIX
|
||||||
|
SUFFIX_SIZE = $ - $$
|
||||||
|
end virtual
|
||||||
|
|
||||||
org 0x0
|
org 0x0
|
||||||
use32
|
use32
|
||||||
|
|
||||||
@@ -12,27 +17,31 @@ dd start
|
|||||||
dd i_end
|
dd i_end
|
||||||
dd m_end
|
dd m_end
|
||||||
dd m_end
|
dd m_end
|
||||||
dd params
|
dd path
|
||||||
dd 0
|
dd target_path
|
||||||
|
|
||||||
start:
|
start:
|
||||||
cmp byte [params], 0
|
mov edi, target_path
|
||||||
|
or ecx, -1
|
||||||
|
xor al, al
|
||||||
|
repne scasb
|
||||||
|
|
||||||
|
sub edi, SUFFIX_SIZE + 1
|
||||||
|
mov byte [edi], 0
|
||||||
|
|
||||||
|
cmp byte [path], 0
|
||||||
je .launch
|
je .launch
|
||||||
|
|
||||||
mov esi, params
|
mov byte [q_path], '"'
|
||||||
mov ah, '"'
|
|
||||||
|
|
||||||
.shift_loop:
|
mov edi, path
|
||||||
mov al, [esi]
|
or ecx, -1
|
||||||
mov [esi], ah
|
xor al, al
|
||||||
inc esi
|
repne scasb
|
||||||
mov ah, al
|
|
||||||
test al, al
|
mov word [edi-1], '"'
|
||||||
jnz .shift_loop
|
|
||||||
|
|
||||||
mov word [esi], '"'
|
mov dword [fi + 8], q_path
|
||||||
|
|
||||||
mov dword [fi + 8], params
|
|
||||||
|
|
||||||
.launch:
|
.launch:
|
||||||
mov eax, SF_FILE
|
mov eax, SF_FILE
|
||||||
@@ -47,11 +56,14 @@ fi:
|
|||||||
db 0
|
db 0
|
||||||
dd target_path
|
dd target_path
|
||||||
|
|
||||||
target_path db TARGET, 0
|
|
||||||
|
|
||||||
i_end:
|
i_end:
|
||||||
|
|
||||||
params rb 1024
|
params rb 256
|
||||||
|
virtual at params
|
||||||
|
q_path rb 1
|
||||||
|
path rb 255
|
||||||
|
end virtual
|
||||||
|
|
||||||
|
target_path rb 1024
|
||||||
|
|
||||||
m_end:
|
m_end:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user