News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

noob questions about uasm64 usage

Started by jimg, August 03, 2018, 01:02:06 AM

Previous topic - Next topic

TimoVJL

#30
ExitProcess proto :dword
ShellExecuteA proto :ptr, :ptr, :ptr, :ptr, :ptr, :dword
URLDownloadToFileA  proto :ptr, :ptr, :ptr, :dword, :ptr
as LP... is a pointerHRESULT URLDownloadToFile(LPUNKNOWN pCaller, LPCTSTR szURL, LPCTSTR szFileName, _Reserved_ DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB);
HINSTANCE ShellExecuteA(HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT nShowCmd);

uasm and asmcoption casemap:none
option win64:15
option stackbase:rsp

includelib kernel32
includelib urlmon

ExitProcess proto :dword
URLDownloadToFileA  proto :ptr, :ptr, :ptr, :dword, :ptr

.data
url db "https://forum.pellesc.de/index.php?topic=3253.0",0
align 8
htm  db "PellesC.htm",0

.code
WinMainCRTStartup proc FRAME
invoke URLDownloadToFileA, 0, addr url, addr htm, 0, 0
xor ecx, ecx
invoke ExitProcess, ecx
WinMainCRTStartup endp
END

a test with ml64 too:includelib kernel32
includelib urlmon
extern __imp_URLDownloadToFileA :proc
extern __imp_ExitProcess :proc
.data
url db "https://forum.pellesc.de/index.php?topic=3253.0",0
align 8
htm  db "PellesC.htm",0
public WinMainCRTStartup
.code
WinMainCRTStartup:
sub rsp, 38h
xor ecx, ecx
lea rdx, url
lea r8, htm
xor r9d, r9d
;mov qword ptr [rsp+20h], 0h
mov qword ptr [rsp+20h], rcx
call qword ptr [__imp_URLDownloadToFileA]
xor ecx, ecx
call qword ptr [__imp_ExitProcess]
END
and poasm:includelib kernel32
includelib urlmon
extern __imp_URLDownloadToFileA :proc
extern __imp_ExitProcess :proc
.data
url db "https://forum.pellesc.de/index.php?topic=3253.0",0
align 8
htm  db "PellesC.htm",0
public WinMainCRTStartup
.code
WinMainCRTStartup:
sub rsp, 38h
xor ecx, ecx
lea rdx, [rip+url]
lea r8, [rip+htm]
xor r9d, r9d
;mov qword ptr [rsp+20h], 0h
mov qword ptr [rsp+20h], rcx
call qword ptr [rip+__imp_URLDownloadToFileA]
xor ecx, ecx
call qword ptr [rip+__imp_ExitProcess]
END
with invokeincludelib kernel32
includelib urlmon

ExitProcess proto :dword
URLDownloadToFileA  proto :ptr, :ptr, :ptr, :dword, :ptr

.data
url db "https://forum.pellesc.de/index.php?topic=3253.0",0
align 8
htm  db "PellesC.htm",0

.code
WinMainCRTStartup proc PARMAREA=5*8
invoke URLDownloadToFileA, 0, addr url, addr htm, 0, 0
mov ecx, ecx
invoke ExitProcess, ecx
WinMainCRTStartup endp
END
May the source be with you