flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
semiono 21 Nov 2009, 22:35
http://www.autoitscript.com/
Code: Run("regedit.exe",@ScriptDir) What's API to get @ScriptDir in asm? Not @WorkingDir (GetCurrentDirectory,MAX_PATH,lpBuffer)! Please, help! ![]() _________________ Windows 9, FL Studio 19 |
|||
![]() |
|
comrade 22 Nov 2009, 03:26
try the AUtoScript forums.
|
|||
![]() |
|
LocoDelAssembly 22 Nov 2009, 16:38
I think you want this:
Code: start: invoke GetModuleFileName,NULL,filename,MAX_PATH mov byte [eax+filename-10], 0 ; module.exe invoke MessageBox,NULL,filename,'Genuine:',MB_OK exit: invoke ExitProcess,0 filename rb MAX_PATH+1 I know your code worked, but it was just because after lpFilename there was (undeclared) space available. So, @ScriptDir is equivalent to GetModuleFileName(NULL, ...)? [edit]If the above question is true you may want this more general solution: Code: include 'win32ax.inc' entry start start: invoke GetModuleFileName,NULL,filename,MAX_PATH mov ecx, eax lea edi, [filename+eax-1] std mov al, '\' repne scasb mov byte [edi+1], 0 cld ; Important, besides it is documented my system crashed without this. invoke MessageBox,NULL,filename,'Genuine:',MB_OK invoke ExitProcess,0 filename rb MAX_PATH+1 section '.idata' import data readable writeable library kernel32,'KERNEL32.DLL',user32,'USER32.DLL' include 'api\kernel32.inc' include 'api\user32.inc' |
|||
![]() |
|
semiono 22 Nov 2009, 17:25
@LocoDelAssembly, thank You!
I see this code is parsing slash symbol - well, good! But usally long of file name is known, it's usally module self name. any knowledge to my favor! ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.