flat assembler
Message board for the users of flat assembler.

Index > Windows > downloading file by arg

Author
Thread Post new topic Reply to topic
aX3l



Joined: 29 Sep 2005
Posts: 1
aX3l
Hi!
I tried to wrie it in asmm
and I have this code



Code:
.386
.model flat,stdcall

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

.data
url byte 'http://chmureczki.republika.pl/test.exe',0
linia byte ?
target byte 'c:\x.exe',0


.code

start:

;------------------------------
; I`m goingo t put prog arg as URL
;but how to do it?
;could you fix it?

        
        call GetCommandLine
        mov linia,eax

        xor eax,eax
        push eax
        push offset linia
        push eax
        push eax
        call WinMain

;--- below is OK---------------
        
        push offset target
        call DeleteFile

        push eax 
        push eax
        push offset target
        push offset url
        push eax
        call UrlDownloadToFile
        
        push eax
        push offset target
        call WinExec

        push eax
        call ExitProcess

end start

    


What is wrong in taking parametr (argument)of program and putting it in URL?

could you fix it for me?
best wishes and BIG TNX!
Very Happy
Post 29 Sep 2005, 07:08
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17287
Location: In your JS exploiting you and your system
revolution
Code:
linia byte ?     
Is that a byte array of one character only?

You haven't post the WinMain and WinExec function code so I don't know what parameters they expect.

Should linia be a dword pointer? You use "mov linia.eax" so I think you should make linia a pointer.

Try to convert your code to FASM syntax and perhaps many people here can help you better.
Post 29 Sep 2005, 07:20
View user's profile Send private message Visit poster's website Reply with quote
okasvi



Joined: 18 Aug 2005
Posts: 382
Location: Finland
okasvi
WinExec = winapi...

_________________
When We Ride On Our Enemies
support reverse smileys |:
Post 30 Sep 2005, 04:52
View user's profile Send private message MSN Messenger 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. Also on YouTube, Twitter.

Website powered by rwasa.