...

View Full Version : View 'information' that is "return"ed by a javascript program running?



Upstats23
09-08-2011, 09:42 PM
I am pretty novice. I do not know much about the compilers or how these things run. I do however have a good eye for trends and can figure just about anything out by looking at it.

With that;

I have a game that uses a exe launcher with a built in patcher.

I have found the code for the launcher. There are several "jquery" scripts for basic components like scroll wheel. There are also things like "downloader.js", "inputs.js".

I am interested in seeing what (and more precisely how many) ip addresses are being retrieved. I fear this patcher is using a hidden bittorrent like download system.

The code for "downloader" is pretty basic. It clearly uses some other script, but I am wondering if you can point me in the direction of a utility to monitor running JS so that I can see what is being returned.


_Downloader = function()
{
this.downloadStatusCallback = null;
}

_Downloader.prototype =
{

setDownloadStatusCallback: function(callback)
{
this.downloadStatusCallback = callback;
},

addDownload: function(downloadName, metaUrl, outputPath, authorizationURL) // returns bool
{
return document.SSNLauncher.SSNLauncher_ReturnBool('addDownload', 'string:' + downloadName + '|' + 'string:' + metaUrl + '|' + 'string:' + outputPath + '|' + 'string:' + authorizationURL + '|');
},

removeDownload: function(downloadName) // returns bool
{
return document.SSNLauncher.SSNLauncher_ReturnBool('removeDownload', 'string:' + downloadName + '|');
},

getDownloadOption: function(downloadName, optionName) // returns string
{
return document.SSNLauncher.SSNLauncher_ReturnString('getDownloadOption', 'string:' + downloadName + '|' + 'string:' + optionName + '|');
},

setDownloadOptions: function(downloadName, enableBitSources, enableWebSources) // returns bool
{
return document.SSNLauncher.SSNLauncher_ReturnBool('setDownloadOptions', 'string:' + downloadName + '|' + 'bool:' + enableBitSources + '|' + 'bool:' + enableWebSources + '|');
},

getDownloadActive: function(downloadName) // returns bool
{
return document.SSNLauncher.SSNLauncher_ReturnBool('getDownloadActive', 'string:' + downloadName + '|');
},

setDownloadActive: function(downloadName, active) // returns bool
{
return document.SSNLauncher.SSNLauncher_ReturnBool('setDownloadActive', 'string:' + downloadName + '|' + 'bool:' + active + '|');
}

}

function __Downloader_reportdownloadStatus(downloadName, state, active, totalBytes, bytesLeft, maxIncoming, averageIncoming, currentIncoming, maxOutgoing, averageOutgoing, currentOutgoing, bytesRead, bytesSent, scanBytesLeft)
{
if (SSN.Downloader.downloadStatusCallback != null)
{
SSN.Downloader.downloadStatusCallback(downloadName, state, active, totalBytes, bytesLeft, maxIncoming, averageIncoming, currentIncoming, maxOutgoing, averageOutgoing, currentOutgoing, bytesRead, bytesSent, scanBytesLeft);
}
}


I have tried on several occasions to teach myself programing. I can get the commands and syntax fairly easily, and I am pretty good at 'coming up' with ways to get something done. I just don't have experience in this field (I'm in medical school) so I do not know about the tools and utilities programers use and scouring the internet has been less than fruitful.

Anybody capable of pointing me in the direction of finding a utility to monitor running js (if that is even possible =/).

I use dreamweaver CS5 to explore js code.

Old Pedant
09-08-2011, 10:35 PM
Firebug.

Use a FireFox browser and install the Firebug plugin. It allows you to monitor the JS code pretty easily, though it takes a little bit of playing with it to understand how best to use it.

You can set "breakpoints" in the code and then step through the following code line by line. When another function is called, you can choose to skip over the function call or follow the code into the function.

rnd me
09-09-2011, 09:05 PM
since you are constructing objects, firebug won't be able to peep in as easily, and it's hard to tell where the instances are; this is just the constructor.

replace the constructor with one that collects all instances to a global variable so you can browse the DOM tab of firebug and see what's goin on:



_Downloader = function()
{

window.INSTANCES=window.INSTANCES||[];
window.INSTANCES.push(this);

this.downloadStatusCallback = null;
}

Rowsdower!
09-09-2011, 09:50 PM
If your main concern is just finding out the IP address(es) or URL(s) being visited you can use Firefox with the "Live HTTP Headers" plugin (https://addons.mozilla.org/en-US/firefox/addon/live-http-headers/) to view and capture all HTTP requests from Firefox in real time.

Had a thought after re-reading your post. If this uses a *.exe file then I suppose you're not using it in-browser? If that is the case and you still want to monitor the IP addresses or URLs in use you can install Wireshark (http://www.wireshark.org/about.html) (Windows, Linux, and Mac) or the Windows-only Sysinternals Suite (http://technet.microsoft.com/en-us/sysinternals/bb842062.aspx) and use the "TCPView."

Either option should give you total view of the connections being made to external servers.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum