;============================================================================================================================================= ; step_18.asm ;Get the name of the file executed ; Algorithm ;A1: Get the name of the module ;A2: Show the name ;(C)I don't take any responsibility for the use of this program ; Zedr0n -- connection closed ;============================================================================================================================================= ;============================================================================================================================================= ; Options/Declarations ;============================================================================================================================================= .386 .model flat, stdcall option casemap:none include windows.inc include kernel32.inc include user32.inc includelib \masm32\lib\kernel32.lib includelib \masm32\lib\user32.lib ;============================================================================================================================================= ; Data segment ;============================================================================================================================================= .data Caption db "Zedr0n's step #18",0 ;============================================================================================================================================ ; Variables segment ;============================================================================================================================================ .data? buffer db 256 dup(?) hModule HANDLE ? ;============================================================================================================================================= ; Code segment ;============================================================================================================================================= .code start: A1: invoke GetModuleHandle,NULL mov hModule,eax invoke GetModuleFileName,hModule,offset buffer,256 A2: invoke MessageBox,NULL,offset buffer,offset Caption,MB_OK Exit: invoke ExitProcess,NULL end start