Sign in to follow this  
Followers 0
supergg02

Get arguments of jscript function

3 posts in this topic

I'm trying to catch arguments from a javascript function

Exemple:

My_js_Fun(0,24,null,true,'abcd',var) as it appear in html source code

Mu goal is to get all these arguments.

I have no succed with this pattern

$array=StringRegExp ( $html, "(My_js_Fun\(.*\)" , 2)

please help me if you have an other solution (maybe with a IE.au3 ) or with an other better solution

Share this post


Link to post
Share on other sites



I'm trying to catch arguments from a javascript function

Exemple:

My_js_Fun(0,24,null,true,'abcd',var) as it appear in html source code

Mu goal is to get all these arguments.

I have no succed with this pattern

$array=StringRegExp ( $html, "(My_js_Fun\(.*\)" , 2)

please help me if you have an other solution (maybe with a IE.au3 ) or with an other better solution

i'm not good with regexp either, but there's always more than one way to skin a cat. i would suggest using IE.au3 to read the html code to a string; then parsing out what you want like:

$TheFuncCall = StringInStr($htmlcode, "My_js_Fun(")
$parameters = StringSplit(StringMid($htmlcode, $TheFuncCall + 10, StringLen($htmlcode) - StringInStr(StringRight($htmlcode, StringLen($htmlcode) - $TheFuncCall + 10), ")"), ",")

the forum formatting will probably turn that into several lines, but it's actually just 2. the first identifies the numeric location for the beginning of the function call; that is then used in a couple of places to identify the parameter list, which is seperated by stringsplit and put into array $parameters. $htmlcode is just a representation of whatever variable you use to store the entire contents of the documents's html. the string created using IE.au3 suggestion...


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

The IE.au3 Builder is in my signature

You can copy from the "Examples" view... Paste into the "Builder Form".... and press "Test Run Form"

you can see the example executed

IE Builder is in my signature below

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0