; wraps command line arguments in quotes and launches a target. ; WRAPPER_SUFFIX equ '_wrapper_name' must be defined before including this file. include 'KOSfuncs.inc' virtual db WRAPPER_SUFFIX SUFFIX_SIZE = $ - $$ end virtual org 0x0 use32 db 'MENUET01' dd 1 dd start dd i_end dd m_end dd m_end dd path dd target_path start: 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 mov byte [q_path], '"' mov edi, path or ecx, -1 xor al, al repne scasb mov word [edi-1], '"' mov dword [fi + 8], q_path .launch: mov eax, SF_FILE mov ebx, fi int 0x40 mov eax, SF_TERMINATE_PROCESS int 0x40 fi: dd SSF_START_APP, 0, 0, 0, 0 db 0 dd target_path i_end: params rb 256 virtual at params q_path rb 1 path rb 255 end virtual target_path rb 1024 m_end: