Page 1 of 1 1
Topic Options
#210300 - 2015-05-28 01:49 PM Convert VBS/VBA Concatenation Expression to KiXtart Expression
Lipman Offline
Fresh Scripter

Registered: 2005-05-09
Posts: 43
Loc: Jersey Shore USA
I have VBA/VBS scripts that are deliberately obfuscated by the use of character concantenation.

 Code:
$a='StrReverse(Chr(84) & Chr(69)& Chr(71)), StrReverse(Chr(103) & Chr(110)& Chr(112)& Chr(46)& Chr(54)& Chr(53)& Chr(56)& Chr(49)& Chr(53)& Chr(48)& Chr(55)& Chr(47)& Chr(117)& Chr(114)& Chr(46)& Chr(99)& Chr(105)& Chr(112)& Chr(101)& Chr(118)& Chr(97)& Chr(115)& Chr(47)& Chr(47)& Chr(58)& Chr(112)& Chr(116)& Chr(116)& Chr(104))'


I then need to convert the VBA/VBS Expression to a KiXtart Expression.

 Code:
StrReverse(Chr(84)+Chr(69)+Chr(71))+" "+StrReverse(Chr(103)+Chr(110)+Chr(112)+Chr(46)+Chr(54)+Chr(53)+Chr(56)+Chr(49)+Chr(53)+Chr(48)+Chr(55)+Chr(47)+Chr(117)+Chr(114)+Chr(46)+Chr(99)+Chr(105)+Chr(112)+Chr(101)+Chr(118)+Chr(97)+Chr(115)+Chr(47)+Chr(47)+Chr(58)+Chr(112)+Chr(116)+Chr(116)+Chr(104))


Then I want to evaluate it but what I get is the above as just a string of characters.

How do I go from a string to something that can actually be evaluated and not just treated as a string of characters ?

I tried - Execute() and that does evaluate it as an expression but the result is a boolean for success or failure. The result of the expression is shown in the command console but I want the result of the evaluated expression to then be made a string I can easily manipulate and copy.


** Note. I have created a function StrReverse() like what exists in VBS/VBA.

Top
#210304 - 2015-05-28 04:48 PM Re: Convert VBS/VBA Concatenation Expression to KiXtart Expression [Re: Lipman]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
Can you reword what you are trying to do. I'm a little fuzzy on what you want.
Top
#210306 - 2015-05-28 05:54 PM Re: Convert VBS/VBA Concatenation Expression to KiXtart Expression [Re: Allen]
Lipman Offline
Fresh Scripter

Registered: 2005-05-09
Posts: 43
Loc: Jersey Shore USA
Sure. I extract an expression from VBA/VBS. It is a sub-script that concatenates characters together.

I copy that in a string then I convert the VBA/VBS sub-script to KiXtart syntax.

However, when I am done I have just a string of characters.

What I want is it to be a KixTart Expression that can be evaluated.



Edited by Lipman (2015-05-28 09:23 PM)

Top
#210310 - 2015-05-28 09:26 PM Re: Convert VBS/VBA Concatenation Expression to KiXtart Expression [Re: Lipman]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
To save time and my sanity... can you tell me what your string is after being converted from the chr(?)?
Top
#210311 - 2015-05-28 09:30 PM Re: Convert VBS/VBA Concatenation Expression to KiXtart Expression [Re: Allen]
Lipman Offline
Fresh Scripter

Registered: 2005-05-09
Posts: 43
Loc: Jersey Shore USA
It is in the first post.

The first Code Segment is VBA/VBS

The second is the KiXtart compliant expression.

The result of the concatenated string is; GET http://savepic.ru/7051856.png


Edited by Lipman (2015-05-28 09:30 PM)

Top
#210312 - 2015-05-28 09:33 PM Re: Convert VBS/VBA Concatenation Expression to KiXtart Expression [Re: Lipman]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
The result was what I was after. Thanks.

Is Get a function, exe, part of an object? How were you envisioning to use that?


Top
#210313 - 2015-05-28 09:48 PM Re: Convert VBS/VBA Concatenation Expression to KiXtart Expression [Re: Allen]
Lipman Offline
Fresh Scripter

Registered: 2005-05-09
Posts: 43
Loc: Jersey Shore USA
My objective is just to have a Human Readable ASCII text and mentally parse the results.

The text however must be easily manipulated such as in a TXT file.


Edited by Lipman (2015-05-28 09:49 PM)

Top
#210314 - 2015-05-28 09:57 PM Re: Convert VBS/VBA Concatenation Expression to KiXtart Expression [Re: Lipman]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
Goodness... After re-reading all your posts... I got it... Give me 10 minutes.

Top
#210315 - 2015-05-28 10:01 PM Re: Convert VBS/VBA Concatenation Expression to KiXtart Expression [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
 Code:
break on

$string="Chr(71) + Chr(69) + Chr(84)"
? $string
$RC=Execute("$" + "Output=" + $String)
? $output

Top
#210316 - 2015-05-28 10:22 PM Re: Convert VBS/VBA Concatenation Expression to KiXtart Expression [Re: Allen]
Lipman Offline
Fresh Scripter

Registered: 2005-05-09
Posts: 43
Loc: Jersey Shore USA
Cool !

That works.

Obrigado.

Now it is just a matter of implementing it.

Top
#210317 - 2015-05-28 10:36 PM Re: Convert VBS/VBA Concatenation Expression to KiXtart Expression [Re: Lipman]
Lipman Offline
Fresh Scripter

Registered: 2005-05-09
Posts: 43
Loc: Jersey Shore USA
I had no idea you can do a variable assignment within the Execute() function.

Once you see it, it seems so simple.

Thank you Allen


Edited by Lipman (2015-05-28 10:36 PM)

Top
#210318 - 2015-05-28 10:37 PM Re: Convert VBS/VBA Concatenation Expression to KiXtart Expression [Re: Lipman]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
Once I finally understood what you wanted, I was like "oh just that" \:\)

Glad to help.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 507 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.085 seconds in which 0.039 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org