Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Customise : Cannot locate the microsoft visual foxpro supportt library

Status
Not open for further replies.

newtofoxpro

Programmer
Sep 16, 2007
301
IN
Is it possible to customised " Cannot locate the microsoft visual foxpro supportt library " as

" Cannot locate the myapplication supportt library "

 
I never even thought of loading an .exe into notepad B-)

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Are you perhaps compiling with the encryption option set in the project info? Or using Konxise or Refox or something to protect your exe? "

Yes, I compiling with VFP's encryption option and then use third party tool to protect my exe against decompilation.
 
I think you would need to 'attack' the .exe looking for the string in a hex editor BEFORE you apply the third party tool.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
.exe -> .exe.txt

Was much easier for a quick glance at what Text is inside, especially with a very small sample exe of a few KB.

Ok, I could also have use modify command or modi file.

@newtofoxpro: As already said, of course you won't find the text, if the exe is encrypted. If you use a third party tool, then why use the internal encryption anyway, it is weaker as far as I know, eg refox is capable to recompile an vfp encrypted exe, isn't it?

So generate the exe unencrypted, modify the text, then encrypt with your tool and that should work.

Well, or you have to live with it.

Bye, Olaf.
 
***** DO NOT EDIT THE .EXE IN NOTEPAD ****

Get a free hex editor and do it in that.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
I never recommended that, Griff, but of course the editing should be done in a hex editor, as e know now notepad mangles the content and would save a nonworking exe most probably, it's not a binary editor.

Bye, Olaf.
 
Should I try to make pure vfp code. or is it possible ?

function mMakeExe

build project myapp from myapp.prg
build exe myapp from myapp
do MessagePatch

function MessagePatch

** change message "cannot locate the microsoft visual foxpro supportt library"

** change message "This is not a foxpro exe file"

RETURN
 
I think you could do that, automating a search and replace, but you will need to make sure your replacement is the same length as the original string (you could pad it out with chr(0) pairs.

Assuming the existing message is EXACTLY as I have it below, you could use code like this:

Code:
FUNCTION MESSAGEPATCH
	STRTOFILE(STRTRANS(FILETOSTR("c:\mydev\myapp.exe"),SEARCHSTRING("Cannot locate the Microsoft Visual FoxPro Support Library",48),SEARCHSTRING("Blah Blah MyApp",48),"c:\mydev\myapp.exe")
	RETURN(.T.)

FUNCTION SEARCHSTRING
	PARAMETERS m.STRING,m.NOPAIRS
	PRIVATE m.STRING,m.NOPAIRS,m.RESULT, I
	m.RESULT = ""
	FOR I = 1 TO LEN(m.STRING)
		m.RESULT = m.RESULT + SUBSTR(m.STRING,I,1)+CHR(0)
	NEXT
	m.RESULT = LEFT(m.RESULT+REPLICATE(CHR(0)+CHR(0),m.NOPAIRS),m.NOPAIRS*2)
	RETURN(m.RESULT)

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
You're creating projects from single prgs? And then need all this efforts?

That aside, yes, why shouldn't it not be possible? As long as the exe is lower than 16MB you can even read it in with FILETOSTR and do a STRTRAN, then put that string back to disc vis STRTOFILE().

Just be sure you search and find exactly what you want to replace and not change the size of the strings, that could shift portions of the file rendering it invalid, so if your replacement string is longer, fortget it, if it is shorter, fill it up with chr(32)+chr(0) to meet the length of the original string and in the worst case the message will display some space after your apps name.

If your EXEs are structured that simple you really only will need minimum runtime anyway. Putting the runtime in one central folder and registering them globally for that matter even sounds elegant, as users of such exes would then be able to put the exes anywhere, except of course another pc without runtimes.

Bye, Olaf.
 
You're creating projects from single prgs? And then need all this efforts? "

Yes, my project has .PRG , .BMP, .FLL , VCX

I Like to write script in prgs, I never use form, report etc., with prgs scripting I am well happy with grate flexibility. (its a matter of habit) One more thing is if I use prgs in project I can reduce my exe size.

Thanks I am trying your advices.

 
BUILD PROJECT ...FROM syntax would then need more than the single PRG, actually, wouldn't it?

Well, it's off topic. Griff has a nice function there, you could also bet STRCONV() from DBCS to Unicode would add in the chr(0), but then he does also pad to the same length.

Bye, Olaf.


 
Thank you Olaf

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Today, I have tried code as under. After patch I run myapp.exe and not problem at all. But I could not checked, the message changed or not because I will have to check on the computer where vfp not installed. Thank you GriffMG, your code helps well.


m1File=FILETOSTR("myapp.exe")
m1File=STRTRAN(m1File,SearchString("Visual FoxPro"),SearchString("I am good man"))
STRTOFILE(m1File,"myapp.exe")
RETURN

FUNCTION SearchString
PARAMETERS InString
mResult=""
FOR I=1 TO LEN(InString)
mResult=mResult+SUBSTR(InString,I,1)+CHR(0)
ENDFOR
mResult=LEFT(mResult+REPLICATE(CHR(0)+CHR(0),LEN(InString)),LEN(InString)*2)
RETURN mResult
 
You are missing a trick.

Your search and replacement strings need to be the same length!

If the replacement is longer or shorter, any references to areas after your message will be offkilter.



Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top