Author Topic: noob questions about uasm64 usage  (Read 3141 times)

TimoVJL

  • Member
  • ***
  • Posts: 476
Re: noob questions about uasm64 usage
« Reply #30 on: August 12, 2019, 04:52:04 PM »
Code: [Select]
ExitProcess proto :dword
ShellExecuteA proto :ptr, :ptr, :ptr, :ptr, :ptr, :dword
URLDownloadToFileA  proto :ptr, :ptr, :ptr, :dword, :ptr
as LP... is a pointer
Code: [Select]
HRESULT 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 asmc
Code: [Select]
option 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:
Code: [Select]
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:
Code: [Select]
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 invoke
Code: [Select]
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 PARMAREA=5*8
invoke URLDownloadToFileA, 0, addr url, addr htm, 0, 0
mov ecx, ecx
invoke ExitProcess, ecx
WinMainCRTStartup endp
END
« Last Edit: August 12, 2019, 07:20:16 PM by TimoVJL »
May the source be with you