Dev Shed Lounge
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherDev Shed Lounge

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 27th, 2003, 02:10 PM
computer's Avatar
computer computer is offline
echo $usertitle['computer'];
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Jan 2003
Location: UK
Posts: 6,674 computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level)computer User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 4 Weeks 9 h 8 m 32 sec
Reputation Power: 219
Send a message via ICQ to computer
embedding files to .exe

Hi,

I'm working on a VB App and need to be able to embed a file (freely). At the moment it is a .txt which contains license info and user related info.

I want to be able to have that information in a file to be included with the final bootstrap .zip and have it so it can't be edited without a password or something.

This is for a Win 2000/NT/XP type of OS and will be released freely, however people need to require licenses so i can keep track of it.

The file looks like this at the moment:
Code:
"Registrant", "Company", "Postcode", "Date of issue", "Date of expiration", "Type of license", "Issuer"


thanks,
comp
__________________

Reply With Quote
  #2  
Old June 28th, 2003, 05:32 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 39 m 55 sec
Reputation Power: 184
You can embed data in exe files easily using resource files. I never did much VB, but VC has an option like "file/add existing file/add resource file".
read the help file for how to create them. iirc you have to make a list of your resources in text format and then run a compiler on it.

On each compile/build process of your program, the file will be included and can be retrieved using LoadResource().
Hereīs an article in the MSDN with an example for loading resources:http://msdn.microsoft.com/library/default.asp?.../usingresources.asp

PS: encrypt the file and donīt call it "LICENSE.TXT". Resources can be modified easily.
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
  #3  
Old June 29th, 2003, 10:54 PM
nao's Avatar
nao nao is offline
junior vice president
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Location: Springfield
Posts: 251 nao User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Thumbs up wow!

just passing by when... I realised I always wanted to know how to do that - thanks!

nao

Reply With Quote
  #4  
Old June 30th, 2003, 12:38 AM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,506 Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level)Scorpions4ever User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 23 h 42 m 25 sec
Reputation Power: 865
BTW, if you want to know how to screw around with the existing resources of a program, here's one way, using Visual C++

DISCLAIMER - I'm not responsible for any damages caused by this technique. Use at your own risk.

1. Start Visual C++
2. Go to File-->Open.
3. In the Open File Dialog box, change the Files of type combo box to Executable Files (*.exe; *.dll; *.ocx)
4. Open the file of your choice. For example, C:\WINNT\SYSTEM32\commdlg.dll (or C:\WINDOWS\SYSTEM32\commdlg.dll for Windoze 98 users)
5. You should be presented with the resource editor and a list of resources. If you used the above file, you can expand the Dialog resources and fiddle with the common dialogs -- my friend resizes the controls to show more files. You can change the dialogs, strings, icons etc. to your liking
6. If you do save the changes for the above file, then any program that uses the common dialogs will be affected. This means pretty much any program that displays a Open File, Save File, Print File, Find or Find/Replace Dialog

Remember, USE AT YOUR OWN RISK! I don't personally fiddle with the commdlg.dll file, but I know someone who does.

Reply With Quote
  #5  
Old June 30th, 2003, 07:03 AM
nao's Avatar
nao nao is offline
junior vice president
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Location: Springfield
Posts: 251 nao User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Cool ah yes... fond memories...

Hehehe...

Reminds of my high school days. I modifed the names of DOS commands in COMMAND.COM on all of the library computers by creating a start-up disk that used DEBUG to run my asm code...
Code:
debug < asmcode.asm

Debug will only take basic 80x86 instructions, so I had to write the program really awkwardly, but that was enough to change all of the commands. I changed DIR to EJS and CD to DF etc., incremented hex vals of (ascii) command names by one.

Anyway, the school techie said it was due to the 'Ripper' virus (anybody remember 1995/6... the Ripper virus epidemic?!), which was a load of horsesh*t. But he put those funny plastic cards with locks on them into all of the floppy drives to prevent people accidentally infecting further computers... well, my consience got the better of me, but I couldn't go back to fix the computers becasue I couldn't via the floppy-seek.

The moral of my story is, learn how to pick locks - you never know when you might want to go back in to undo a prank!



nao

Reply With Quote
  #6  
Old June 30th, 2003, 09:37 AM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,840 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 27 m 47 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
You can get to the resource editor in VB in the add-ins. Goto the add-ins manager and load up VB6 Resource Editor.

You can store and access multiple types store in the resource file. i.e. for strings use LoadResString(resource id)

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherDev Shed Lounge > embedding files to .exe


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway