Jump to content
Sign in to follow this  
sbsmac

Squint - the sqf editor and error-checker

Recommended Posts

Sbsmac, thanks you for a good sqf-tidy. It has almost correct sqf parser :) Here are some tough tests:


funcTestForSquint = {
   private ["_cond", "_func", "_code1", "_code2"];
   _func = if (count _this > 2) then {{
       player sideChat "count _this > 2"
   }} else {{
       player sideChat "count _this <= 2"
   }};
   _cond = if (typeName (_this select 0) == "CODE");
   _code1 = { player sideChat "it _code1"; call _func };
   _code2 = { player sideChat "it _code2"; call _func };
   _cond then _code1 else _code2;
};

private ["_printHello", "_for_i", "_for_i_from_1", "_do_ten_times"];

// Almost good!
_printHello = { diag_log "Hello!" };
_for_i = for "_i";
_for_i_from_1 = _for_i from 1;
_do_ten_times = _for_i_from_1 to 10;
_do_ten_times do _printHello;

// Squint removes the number 1e+99!
someValue = 1e+99;; // 1.#INF

Another test:

#define __project_name xxxxxx
#define func(name) __project_name##_func_##name
#define invoke(name) call func(name)
// 
// Function func(MapGrep)
// Syntax:
//     [array list, code filter] invoke(MapGrep)
//     [config class, code condition] invoke(MapGrep)
// Returns an array for those elements for which the condition evaluates to notNil. 
// Examples:
// 
//     // Returns all classnames of cars.
//     [configFile >> "CfgVehicles", {
//         if (isClass _x) then { 
//            if (getText(_x >> "simulation") == "car") then { 
//                configName _x 
//            }
//         }
//     }] invoke(MapGrep)
// 
//     // names of players' soldiers
//     [units player, { name _x }] invoke(MapGrep)
// 
//     // positions of all cars requiring repairs:
//     [allUnits, {
//         if (_x isKindOf "Car" && ! canMove _x) then { getPosASL2 _x }
//     }] invoke(MapGrep)
// 

func(MapGrep) = {
   private ["_SC0PE_", "_x"];
   // We use such strange names, in order to callback can refer to any variables of the calling context
   _SC0PE_ = ["_SC0PE_", "_C0NF_", "_Fi1T3R_", "_1iST_", "_1_"];
   private _SC0PE_;
   _C0NF_ = arg(0);
   _Fi1T3R_ = arg(1);
   _1iST_ = [];
   for "_1_" from 0 to count _C0NF_ -1 do {
       _x = _C0NF_ select _1_;
       // protect own variables and call usercallback filter function
       _Fi1T3R_ call { private _SC0PE_; _x call _this } call {
           __push(_1iST_, _this); // push if isn't nil
       };
   };
   _1iST_;
};

Edited by DenVdmj

Share this post


Link to post
Share on other sites

Can't make in-text tabs. Bad.

And no comment shortcut.

Share this post


Link to post
Share on other sites

Is Squint still being developed? It seems like a nice tool, but it's been a long time since the last update.

Share this post


Link to post
Share on other sites

Mac is currently no longer active. Maybe eventually he will return. Probably depends how A3 turns out among other things.

Sadly he didnt make it open source or at least give users the possibility to update the command definitions. :(

Share this post


Link to post
Share on other sites

Ok, thanks for the update. Back to notepad++

Share this post


Link to post
Share on other sites

For error checking it is still by far the best (and only) tool out there. A must for every scripter in my view.

Share this post


Link to post
Share on other sites

not trying to dig up an old thread, but has squint stop working for anyone else? It has been working fine , but today it has just stopped. I get a message saying "application cannot be started, contact application vendor". I use squint alot and hate losing it.

Nomad

Share this post


Link to post
Share on other sites

It's working for me just now. I think that the application contacts the authors website every time it's used and if that'd down, the application won't work. Perhaps it was down when you tried?

Share this post


Link to post
Share on other sites

That is very possible, it has been down most of the day. Will check it again tomorrow. Nothing that I know of has changed on my system to block it, not unless Windows did an update and changed something.

Edit: finally got it to work, had to uninstall/reinstall, seems to be working again.

Edited by Nomadd

Share this post


Link to post
Share on other sites

I've been having trouble as well over the last week or so. For example, Squint decided that the line

if (!isserver) exitwith {};

was incorrect (but offered no fix). After various other (non)-errors were detected I decided to reinstall.

Unfortunately I cannot reinstall. Running setup results in a failure with the following report:

PLATFORM VERSION INFO

Windows : 5.1.2600.196608 (Win32NT)

Common Language Runtime : 4.0.30319.296

System.Deployment.dll : 4.0.30319.1 (RTMRel.030319-0100)

clr.dll : 4.0.30319.296 (RTMGDR.030319-2900)

dfdll.dll : 4.0.30319.1 (RTMRel.030319-0100)

dfshim.dll : 4.0.31106.0 (Main.031106-0000)

SOURCES

Deployment url : http://www.armaleague.com/mac/squint/bin/squint.application

ERROR SUMMARY

Below is a summary of the errors, details of these errors are listed later in the log.

* Activation of http://www.armaleague.com/mac/squint/bin/squint.application resulted in exception. Following failure messages were detected:

+ Exception reading manifest from http://ww2.armaleague.com/mac/squint/bin/squint.application: the manifest may not be valid or the file could not be opened.

+ '--' is an unexpected token. The expected token is '>'. Line 21, position 3.

COMPONENT STORE TRANSACTION FAILURE SUMMARY

No transaction error was detected.

WARNINGS

There were no warnings during this operation.

OPERATION PROGRESS STATUS

* [24/01/2013 15:55:52] : Activation of http://www.armaleague.com/mac/squint/bin/squint.application has started.

ERROR DETAILS

Following errors were detected during this operation.

* [24/01/2013 15:56:24] System.Deployment.Application.InvalidDeploymentException (ManifestParse)

- Exception reading manifest from http://ww2.armaleague.com/mac/squint/bin/squint.application: the manifest may not be valid or the file could not be opened.

- Source: System.Deployment

- Stack trace:

at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)

at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)

at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)

at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)

at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)

--- Inner Exception ---

System.Xml.XmlException

- '--' is an unexpected token. The expected token is '>'. Line 21, position 3.

- Source: System.Xml

- Stack trace:

at System.Xml.XmlTextReaderImpl.Throw(Exception e)

at System.Xml.XmlTextReaderImpl.DtdParserProxy.System.Xml.IDtdParserAdapter.Throw(Exception e)

at System.Xml.DtdParser.Throw(Int32 curPos, String res, String[] args)

at System.Xml.DtdParser.ThrowUnexpectedToken(Int32 pos, String expectedToken1, String expectedToken2)

at System.Xml.DtdParser.ScanClosingTag()

at System.Xml.DtdParser.GetToken(Boolean needWhiteSpace)

at System.Xml.DtdParser.ParseEntityDecl()

at System.Xml.DtdParser.ParseSubset()

at System.Xml.DtdParser.ParseExternalSubset()

at System.Xml.DtdParser.ParseInDocumentDtd(Boolean saveInternalSubset)

at System.Xml.DtdParser.Parse(Boolean saveInternalSubset)

at System.Xml.DtdParser.System.Xml.IDtdParser.ParseInternalDtd(IDtdParserAdapter adapter, Boolean saveInternalSubset)

at System.Xml.XmlTextReaderImpl.ParseDtd()

at System.Xml.XmlTextReaderImpl.ParseDoctypeDecl()

at System.Xml.XmlTextReaderImpl.ParseDocumentContent()

at System.Xml.XmlTextReaderImpl.Read()

at System.Deployment.Application.ManifestValidatingReader.XmlFilteredReader.Read()

at System.Xml.XmlCharCheckingReader.Read()

at System.Xml.XsdValidatingReader.Read()

at System.Deployment.Application.ManifestReader.FromDocument(String localPath, ManifestType manifestType, Uri sourceUri)

COMPONENT STORE TRANSACTION DETAILS

No transaction information is available.

Perhaps a recent MS update has broken something?

Anyone have any ideas - this is much too valuable a tool to lose..

FWIW: XP Pro 32, SP3, etc. All up-to-date.

EDIT:

Ugh. the link in the first post is out of date (armaleague site is defunct).

The 'temporary' link posted by mac is working:

http://homepage.ntlworld.com/n.macmullen/projects/squint/bin/setup.exe

Edited by Orcinus
Updated information

Share this post


Link to post
Share on other sites

Orcinus has reported that there is some possibility that the old armaleague.com site from which the original installer ran has been compromised and contains malware. You should not even be able to run squint anymore if you installed from this site but on the off chance you are thinking of installing it again, please use the link in the above.

Share this post


Link to post
Share on other sites

ugh, my squint stopped working a week ago, and now I can't install it. says, "application cannot be started, contact the application vendor". tried on two different machines, with different internet connections. is anybody having this issue?

Share this post


Link to post
Share on other sites

maybe the problem is I'm using Win XP, and for some reason Squint doesn't support it anymore... I'll try to install it on my Win 7

Share this post


Link to post
Share on other sites

I deleted the old version, which was not running. downloaded from the link above "working" version.

during installation I receive the following error message^ can't download bla bla bla and "Details"....

PLATFORM VERSION INFO

Windows : 6.1.7601.65536 (Win32NT)

Common Language Runtime : 4.0.30319.586

System.Deployment.dll : 4.0.30319.1 (RTMRel.030319-0100)

clr.dll : 4.0.30319.586 (RTMLDR.030319-5800)

dfdll.dll : 4.0.30319.1 (RTMRel.030319-0100)

dfshim.dll : 4.0.31106.0 (Main.031106-0000)

SOURCES

Deployment url : http://homepage.ntlworld.com/n.macmullen/projects/squint/bin/squint.application

Server : Apache

Deployment Provider url : http://homepage.ntlworld.com/n.macmullen/projects/squint/bin/squint.application

Application url : http://homepage.ntlworld.com/n.macmullen/projects/squint/bin/Application%20Files/squint_1_0_0_134/squint.exe.manifest

Server : Apache

IDENTITIES

Deployment Identity : squint.application, Version=1.0.0.134, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=x86

Application Identity : squint.exe, Version=1.0.0.134, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=x86, type=win32

APPLICATION SUMMARY

* Installable application.

ERROR SUMMARY

Below is a summary of the errors, details of these errors are listed later in the log.

* Activation of http://homepage.ntlworld.com/n.macmullen/projects/squint/bin/squint.application resulted in exception. Following failure messages were detected:

+ Downloading http://homepage.ntlworld.com/n.macmullen/projects/squint/bin/Application Files/squint_1_0_0_134/squint.exe.deploy did not succeed.

+ The underlying connection was closed: An unexpected error occurred on a receive.

+ Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

+ An existing connection was forcibly closed by the remote host

COMPONENT STORE TRANSACTION FAILURE SUMMARY

No transaction error was detected.

WARNINGS

* The manifest for this application does not have a signature. Signature validation will be ignored.

* The manifest for this application does not have a signature. Signature validation will be ignored.

OPERATION PROGRESS STATUS

* [15.02.2013 14:53:12] : Activation of http://homepage.ntlworld.com/n.macmullen/projects/squint/bin/squint.application has started.

* [15.02.2013 14:53:13] : Processing of deployment manifest has successfully completed.

* [15.02.2013 14:53:13] : Installation of the application has started.

* [15.02.2013 14:53:13] : Processing of application manifest has successfully completed.

* [15.02.2013 14:53:38] : Found compatible runtime version 4.0.30319.

* [15.02.2013 14:53:38] : Request of trust and detection of platform is complete.

ERROR DETAILS

Following errors were detected during this operation.

* [15.02.2013 14:53:39] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)

- Downloading http://homepage.ntlworld.com/n.macmullen/projects/squint/bin/Application Files/squint_1_0_0_134/squint.exe.deploy did not succeed.

- Source: System.Deployment

- Stack trace:

at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)

at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()

at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)

at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)

at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)

at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)

at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)

at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)

--- Inner Exception ---

System.Net.WebException

- The underlying connection was closed: An unexpected error occurred on a receive.

- Source: System

- Stack trace:

at System.Net.HttpWebRequest.GetResponse()

at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)

--- Inner Exception ---

System.IO.IOException

- Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

- Source: System

- Stack trace:

at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)

at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)

at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)

--- Inner Exception ---

System.Net.Sockets.SocketException

- An existing connection was forcibly closed by the remote host

- Source: System

- Stack trace:

at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)

COMPONENT STORE TRANSACTION DETAILS

No transaction information is available.

There may be offline version?

Share this post


Link to post
Share on other sites

As indicated by sbsmac's post following a PM exchange, Armaleague.com has been hacked.

I discovered this the same day my PC was infected when attempting to reinstall Squint after the original installation stopped working (I used the link - now replaced - in the first post in the thread). CAPSA showed my PC had connected to two 'unauthorised' addresses, one in Scandinavia & one in PL. After disconnecting I found a set of copies of text files from my desktop in folders with long hex names in the temp folder of local settings. Elsewhere I found an HTML document that opened in Firefox with a Silverlight logo. Looking at the page source revealed a window with all stored passwords.

I don't keep any financial data such as passwords, card numbers and especially not PIN #s anywhere on my PC, btw. The text files were just various notes to myself.

Got rid of it by booting with a Trinity rescue disk and restoring all MBR & LBRs from my HDHacker backups, then used the ERDNT program of ERUNT to restore the registry from a couple of days earlier. Booted into Windows and then located & cleaned out a file hidden in c:\System restore.

I reinstalled Squint from ntlworld. However it appears to be v1.0 which ofc dials up Armaleague.com. Not sure what is going on, but I trust sbsmac to resolve matters.

Important: Do not visit Armalague,com. If you still have a version that dials up Armaleague.com your PC might be at risk. The simplest way to block the access is to use the HOSTS file. This is located in the C:\WINDOWS\system32\drivers\etc\ directory in all current versions of Windows.

"Open with" notepad, turn off wordwrap as always, and at the end of the file add the following lines:

127.0.0.1 armaleague.com
127.0.0.1 69.43.161.167

The second line is the IP address for Armaleague.com. Belt & braces as I'm not sure how the URL is coded in Squint (although AFAIK it shouldn't matter).

Save the file using the "All files" option in the notepad save window. If you make a mistake and save it as text, then change the original by adding the extension ".old" then delete the ".txt" from the new file.

PS: depending on your system you may need Administrator privileges to edit the Hosts file; some AV or firewall programs with HIPS may also fire an alarm.

Edited by Orcinus

Share this post


Link to post
Share on other sites

I'm using the ntl version of squint, and in the last few days, Avast complained about it and has quarantined it. Now it won't launch and gives the errors that sorophx describes above.

Given that we trust the download from Mac's own ISP, can we assume this is a false positive and add it to my virus checker's white list?

Share this post


Link to post
Share on other sites
Given that we trust the download from Mac's own ISP, can we assume this is a false positive and add it to my virus checker's white list?

Up to you ofc, but I would recommend waiting for Mac to respond. The varied experiences (albeit with a small number of reports) don't inspire confidence AFAIAC.

After a lot of time & a system that still glitches, I'm about to go the format & full reinstall route for both XP Pro & Win8. I'm not seeing any inward or outward connections that look other than legitimate, & the traffic doesn't look suspicious to my non-expert eye; but even if it's a just case of one or two non-critical files being damaged I think it's better safe than sorry. I have no idea whether Capsa's server can detect IP spoofing.

It did occur to me that it might not have been a random choice of site - some slimy little script kiddies hoping to steal A2/OA registration codes, perhaps. I don't play MP (well, not yet) & don't know if there's any way of checking if someone else might have started using my registration codes. Guess I'll have to deal with that when I start playing MP if not.

Share this post


Link to post
Share on other sites
Up to you ofc, but I would recommend waiting for Mac to respond. The varied experiences (albeit with a small number of reports) don't inspire confidence AFAIAC.

I think that's sensible.

Share this post


Link to post
Share on other sites

I had a quick look through the source code to refresh my memory. There are no links to armaleague except for a single mailto: reference in the event you decide to send feedback to the author.

You can double check you are using the ntlworld version: first the version number should be 134 and secondly if you look at the start-menu properties for the shortcut you should notice that the application is actually called squint2, not squint.

>Avast complained about it and has quarantined it.

Have you thought about submitting the exe to Avast for proper analysis? If nothing else, it would be nice to have it confirmed that it is a false positive (hopefully).

>Now it won't launch and gives the errors that sorophx describes above

Can you see http://homepage.ntlworld.com/n.macmullen/projects/squint/bin/ ? Use wget or curl if you are really paranoid.

Share this post


Link to post
Share on other sites

so the errors I and a few other are getting is AVAST being overly cautious?

Share this post


Link to post
Share on other sites

I have same problem - Avast simply blocks installation. Checked this:

But it is same:

process: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\dfsvc.exe

URL: http://homepage.ntlworld.com/n.macmullen/projects/squint/bin/Application Files/squint_1_0_0_134/squint.exe.deploy

Infection: FileRepMalware

According to Avast info it is about infected website.

I can disable Avast, if this is for 100% false alarm. It is? As for me, hard to imagine effective scripting without Squint's syntax check.

Share this post


Link to post
Share on other sites

As proud as I am of squint and as unlikely I think it is that someone has compromised my homepage, I would strongly recommend against disabling or ignoring your virus checker. As I say, better to check on the Avast forums whether this is a false positive (which also has the advantage that future updates of avast might not incorrectly flag the application as infected).

Share this post


Link to post
Share on other sites

Avast is definitely being weird. It suddenly gave me warnings a week ago when attempting to start it and moved it to virus chest. Then when scanned it said nothing was found.

Share this post


Link to post
Share on other sites

http://forum.avast.com/index.php?topic=116186.0

will post here if there's any progress

---------- Post added at 10:27 PM ---------- Previous post was at 09:47 PM ----------

here's their reply

Send to virus@avast.com in a password protected zip file

Mail subject: false positive

Zip password: infected

unfortunately I don't have squint on my PC anymore, could one of you do this? or should I just send the setup.exe?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×