Limited Time Programs - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Utilities (https://qb64phoenix.com/forum/forumdisplay.php?fid=8) +---- Thread: Limited Time Programs (/showthread.php?tid=1446) Pages:
1
2
|
Limited Time Programs - SMcNeill - 02-05-2023 Ever wanted to give someone a timed trial of your program? Let them download it, play around for a few days, and then pop up a nag screen telling them to buy your junk? Well, now you can!! First the timestamper! Code: (Select All) INPUT "File to stamp TimeStamp to =>"; file$ And, a program set up to showcase the basic workings of it: Code: (Select All) TYPE SYSTIME So, to start with, run the second file first. It'll make an EXE for you and tell you that it's illegal! You're not allowed to use it. This is all someone that grabs your program out of the blue will see. Now, if you want to send someone a timestamped trial version, run the first program and point it to your other program's compiled EXE. It'll stick a timestamp to the end of it for you, and now you can now run that EXE and have it make use of that timestamp however you want. If they buy your junk, send (or change) the last 2 bytes of the EXE to "VC" for "Verified Copy", and they're good to go without any message for illegal downloading or nag screen to buy your stuff. Screenshots follow: RE: Limited Time Programs - SMcNeill - 02-05-2023 One thing to note -- this isn't any sort of super secure encryption or anything going on here. All we're doing is appending a timestamp and verification code to the end of your program. Any "hacker" who learns this simple trick and just go in and change the last 2 byte of your EXE for "TS" (for "Time Stamped") to "VC" (for "Verified Copy"), and then they'll be good to go. Hacking this would take very little effort for anyone who really wants to do so, but let's all take a moment and be honest with ourselves: Who's making and distributing such awesome programs with QB64 that somebody will actually go through the effort to hack them?? A simple system works just fine for the type of simple programs which are generally generated and shared via QB64. If you're good enough to make something fancy that requires better security for trial versions, then you're more than likely skilled enough to sort out this type of issue for yourself and you'll skip this type of simplex utility security. This won't stop Hacker Bob from hacking your program, but it'll probably be all that's needed for your Aunt Suzie and her 27 kidlings. RE: Limited Time Programs - mnrvovrfc - 02-06-2023 If only there was a way to lodge it somewhere inside the EXE file instead of tacking it to the end. I would have preferred a validation which is included as object file but which is different from "DATA" statements. For the example shown on this thread it should employ encryption. Even fewer hackers could employ tools to examine the EXE file header and discover that file was tampered with before they could tamper with it. If I were doing something like this I would gladly invite Aunt Suzie as beta-tester and force her relatives to buy my software. RE: Limited Time Programs - TerryRitchie - 02-06-2023 I've given this same topic a thought now and then over the years too. This is a really easy way to accomplish this. My idea always revolved around writing an entry to the registry but that's potentially dangerous, tricky, and probably not so easy with BASIC. Also, no matter which method you would use to limit time the hackers will always find a way around, so you might as well use something easy to implement like this any way. Personally, if I were to ever offer software that I though may be good enough for a little compensation I would probably go the old school shareware route. Either offer the fist level of the game (aka shareware DOOM) with more levels in the paid version or a limited set of features with all the features unlocked in the paid version. You still have the problem of people sharing the paid version though. Luckily (or unfortunately?) I have not written anything that I felt a need to get a little compensation for yet, although I would like to take a stab with Swift and iOS just to see if I could manage a few dollars on an app store. RE: Limited Time Programs - SMcNeill - 02-06-2023 (02-06-2023, 01:21 AM)mnrvovrfc Wrote: If only there was a way to lodge it somewhere inside the EXE file instead of tacking it to the end. I would have preferred a validation which is included as object file but which is different from "DATA" statements. For the example shown on this thread it should employ encryption. Even fewer hackers could employ tools to examine the EXE file header and discover that file was tampered with before they could tamper with it. Inside an EXE is a little tricky, as the OS doesn't like you writing to the file while it's loading in memory and running, but there's no reason why you can't embed that data inside a different file. For you old timers out there, how many of you remember playing games with an unusual border around the screen which tweaked and danced waay back in the day? How many of you know what that was all about, besides just adding a little "flare" to the screen/program? That was a lot of the program's data stored in video memory! Back in the day, one was lucky to have 64kb of memory to use, so programmers would tweak their work to try and find ways to maximize how much they could use. One trick was to use border blocks of video memory to store information in. Pixel (0,0) might be the character's health. Pixel (0,1) might be the character's mana. Pixel (0,2) might be the character's attack, while pixel (0,3) was the character's defense, and so on and so on... There's absolutely nothing that says you can't do the same thing in modern programs, but in a sneaker manner. Create a splash screen which works as a title screen for your game, and use the leastmost significant bit to toggle and represent the bits in your timestamp. *Nobody* is ever going to eyeball and tell the difference between _RGBA(255,255,255,254) and _RGBA(255,255,255,255). <-- right there is a toggle bit difference and with that you can embed whatever the heck you want into your splash screen, making it effectively a security screen. If anyone wants a demo, I'll be happy to whip something up to showcase the basic process for you guys. Imbedding data in images is something that I've been doing for ages and ages, just to store important information to myself on them, like people's names, places, dates, occasions, ect. Be creative. Think a little outside the box. It's really not that hard to sneakily embed and hide a few bytes of information into a program to use as a timestamp for a trial period. YOU'RE the programmer -- you can store whatever data you want, in whatever order/sequence you want, in your programs. Just add an 8-byte header to your user's inventory data if you want to! Let's see... umm.... my hero has a saved data of: "0206202303260107987234" Now, who sees that timestamp in there? Look close. Start at the left and break it down as we go right... 02-06-2023 Date 03:46 Time 01 -- Hero has "The Sword of Heroes" 07 -- Hero is wearing "Chain Armor" 987 -- Hero's 3 digit health 234 -- Hero's 3 digit mana Or is it? Maybe that's a completely different data structure than what I told you it was, and my timestamp is embedded into my enemy database! Or maybe it's somewhere in the middle of my compressed text files which represent the story line itself. "On 20.23.0206, by the Antarian Calendar, the end of the world occurred at 03:46 PM. Well, at least the beginning of the end of the world started at that time. This is the story of how it all came to an ending after that..." At the end of the day, all you need is someway to store a timestamp for when the user got your program and whether it's a valid copy or not. If you're making a game, there's a ton of places where you can hide such a small amount of information in your program. Just be creative a little, and you shouldn't have any issues at all in making a "Limited Activation" program. RE: Limited Time Programs - bplus - 02-06-2023 I barely remember way way back in late 80's, in the times of physical disc distributions, you could not allow copies to be made by embedding disc number into the exe when compiled from QB. If the exe found itself on wrong disk number it deleted itself. You could have probably done that with dates as well for time limit samples. RE: Limited Time Programs - Steffan-68 - 02-06-2023 I would write it in the program like this is even smaller. Code: (Select All) 'Print Date$ RE: Limited Time Programs - SpriggsySpriggs - 02-07-2023 (02-06-2023, 03:08 AM)TerryRitchie Wrote: I've given this same topic a thought now and then over the years too. This is a really easy way to accomplish this. My idea always revolved around writing an entry to the registry but that's potentially dangerous, tricky, and probably not so easy with BASIC. Also, no matter which method you would use to limit time the hackers will always find a way around, so you might as well use something easy to implement like this any way. I can help with that. I have a registry library that I wrote for QB64. RE: Limited Time Programs - TerryRitchie - 02-07-2023 (02-07-2023, 02:30 PM)Balderdash Wrote:(02-06-2023, 03:08 AM)TerryRitchie Wrote: I've given this same topic a thought now and then over the years too. This is a really easy way to accomplish this. My idea always revolved around writing an entry to the registry but that's potentially dangerous, tricky, and probably not so easy with BASIC. Also, no matter which method you would use to limit time the hackers will always find a way around, so you might as well use something easy to implement like this any way. I'm interested. Where can I obtain it? RE: Limited Time Programs - SpriggsySpriggs - 02-07-2023 (02-07-2023, 04:05 PM)TerryRitchie Wrote: I'm interested. Where can I obtain it? @TerryRitchie Attached are my BI and BM files. Here is a link to the post I made on the old forum about it which has example usage. Windows Registry Library (BI & BM) (alephc.xyz) |