flat assembler
Message board for the users of flat assembler.

Index > Windows > template.asm

Author
Thread Post new topic Reply to topic
semiono



Joined: 31 Aug 2007
Posts: 176
Location: section '.code' executable
semiono
Code:
include '%fasm%/win64ax.inc'
section '.code' executable
start:
        sub rsp,8

        invoke ShellExecute,NULL,NULL,'http://msdn.microsoft.com/en-us/library/windows/desktop/hh447209(v=vs.85).aspx',NULL,NULL,SW_SHOWDEFAULT

        ; invoke SHGetSpecialFolderPath,NULL,a,CSIDL_PROGRAM_FILES,NULL
        ; invoke MessageBox,NULL,a,'',MB_OK

        ; invoke SHSetValue,HKEY_CURRENT_USER,'Software','',REG_SZ,'',1
        ; invoke WritePrivateProfileString,'','','1',a

        ; invoke MultiByteToWideChar,CP_ACP,NULL,a,-1,b,MAX_PATH

        ; invoke CreateDirectory,a,NULL
        ; invoke lstrcat,a,''

        ; invoke SetFileAttributes,a,1
        ; invoke RtlZeroMemory,a,MAX_PATH

        ; mov [lpFileOp.wFunc],2
        ; mov [lpFileOp.pFrom],a
        ; mov [lpFileOp.pTo],b
        ; mov [lpFileOp.fFlags],20

        ; invoke SHFileOperation,lpFileOp
exit:
        invoke ExitProcess,NULL

section '.data' readable writeable

struct SHFILEOPSTRUCT

        hwnd dq NULL
        wFunc dq NULL
        pFrom dq NULL
        pTo dq NULL
        fFlags dq NULL
        fAnyOperationsAborted dq NULL
        hNameMappings dq NULL
        lpszProgressTitle dq NULL
ends
        lpFileOp SHFILEOPSTRUCT

        a rb MAX_PATH
        b rb MAX_PATH
        c rb MAX_PATH
        d rb MAX_PATH
        e rb MAX_PATH
        f rb MAX_PATH
        g rb MAX_PATH
        h rb MAX_PATH
        i rb MAX_PATH
        j rb MAX_PATH
        k rb MAX_PATH
        l rb MAX_PATH
        m rb MAX_PATH
        n rb MAX_PATH
        o rb MAX_PATH
        p rb MAX_PATH
        q rb MAX_PATH
        r rb MAX_PATH
        s rb MAX_PATH
        t rb MAX_PATH
        u rb MAX_PATH
        v rb MAX_PATH
        w rb MAX_PATH
        x rb MAX_PATH
        y rb MAX_PATH
        z rb MAX_PATH

section '.idata' import readable

        library kernel32,'KERNEL32.DLL',shell32,'SHELL32.DLL',shlwapi,'SHLWAPI.DLL',user32,'USER32.DLL'
        include '%fasm%/api/kernel32.inc'
        include '%fasm%/api/shell32.inc'
        import shlwapi,\
               PathFileExists,'PathFileExistsA',\
               PathStripPath,'PathStripPathA',\
               PathStripToRoot,'PathStripToRootA',\
               SHDeleteKey,'SHDeleteKeyA',\
               SHDeleteValue,'SHDeleteValueA',\
               SHRegGetPath,'SHRegGetPathA',\
               SHSetValue,'SHSetValueA',\
               StrTrim,'StrTrimA'
        import user32,MessageBox,'MessageBoxA',MessageBoxTimeout,'MessageBoxTimeoutW'

section '.rsrc' resource readable

        directory RT_ICON,icons,RT_GROUP_ICON,group_icons,RT_VERSION,versions,RT_MANIFEST,_manifest

        resource icons,\
        1,LANG_NEUTRAL,icon_data1,\
        2,LANG_NEUTRAL,icon_data2,\
        3,LANG_NEUTRAL,icon_data3,\
        4,LANG_NEUTRAL,icon_data4

        resource group_icons,17,LANG_NEUTRAL,main_icon
        resource versions,1,LANG_NEUTRAL,version
        resource _manifest,1,LANG_NEUTRAL,manifest

        icon main_icon,\
        icon_data1,'%fasm%/exec1.ico',\
        icon_data2,'%fasm%/exec2.ico',\
        icon_data3,'%fasm%/exec3.ico',\
        icon_data4,'%fasm%/exec4.ico'

        versioninfo version,VOS__WINDOWS32,VFT_APP,VFT2_UNKNOWN,LANG_ENGLISH+SUBLANG_DEFAULT,NULL,\
                    'FileDescription','debug.exe',\
                    'LegalCopyright','2001-2005 GmbH',\
                    'FileVersion','1.0.0.0',\
                    'ProductVersion','1.0.0.0',\
                    'OriginalFilename','debug.exe',\
                    'Company','Semiono'

        resdata manifest
        file '%fasm%/manifest64.xml'
        endres
    


My template.asm Very Happy

_________________
Memory=8388608
Post 26 Feb 2013, 15:42
View user's profile Send private message ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.