Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How to create hex files become demo version

mini

Member
Hi Senior Member ,
A couple days ago, my friend came to my home.
He looked at my PC, you made some small project, I said to him yes, what your compiler, I said Oshonsoft.
Do you know how to protect your project as for demo version, it means you can generate it, then you can share it to other guys but as a demo version, and then after a week run or depending on what you want to do (days), then the files Hex become errors or give something message. and can't use, and need to burn again the hex file to uC.
I said, "how", he said you can create an eeprom.

As well as my latest conversion with him, can senior members here give me an idea.

Thanks,
Mini.
 
Hi Senior Member ,
A couple days ago, my friend came to my home.
He looked at my PC, you made some small project, I said to him yes, what your compiler, I said Oshonsoft.
Do you know how to protect your project as for demo version, it means you can generate it, then you can share it to other guys but as a demo version, and then after a week run or depending on what you want to do (days), then the files Hex become errors or give something message. and can't use, and need to burn again the hex file to uC.
I said, "how", he said you can create an eeprom.

As well as my latest conversion with him, can senior members here give me an idea.

Thanks,
Mini.
I can imagine half a dozen ways to do this, but from your description I cannot tell precisely what is going on. I think it would be better to ask your friend about it or just not worry about protecting your IP until you have something unique. You can also refrain from sharing anything.
 
Hi Senior,
I did below, but it won't work.
Code:
Define CONF_WORD = 0x3f41
Define CLOCK_FREQUENCY = 4

'#Processor PIC16F628A
AllDigital

TRISA = %11111011
TRISB = %00000000

PORTB.7 = 1  'LED on PORTB is On

Dim MyCounter As Byte  'Declaration
Dim ledIndicator As Byte
Dim x As Byte
x = 0


'LCD 2x16
Define LCD_LINES = 2
Define LCD_CHARS = 16
Define LCD_BITS = 4
Define LCD_DREG = PORTB
Define LCD_DBIT = 0
Define LCD_RSREG = PORTA
Define LCD_RSBIT = 2
Define LCD_EREG = PORTA
Define LCD_EBIT = 3
Lcdinit 0


'Show First Time On LCD
Lcdcmdout LcdLine1Pos(1)
Lcdout "PCB Etching"  'First Line
Lcdcmdout LcdLine2Pos(1)
Lcdout "Mini Osh"  'Second Line


For ledIndicator = 5 To 0 Step -1  'CountDown till reach 0

Lcdcmdout LcdLine2Pos(15)
Lcdout #ledIndicator  'Place number for CountDown in Second Line C15
If ledIndicator < 10 Then Lcdout " ", #ledIndicator
WaitMs 990  'Wait till reach
Next ledIndicator
Lcdcmdout LcdClear  'Off LCD
PORTB.7 = 0  'Then LED On PORTB is Off

RunBeforeMain:  'This make it run first the demo files
'RunAfterMain:  'This make it main code it run then demo files


EEPROM_Read x, MyCounter  'Read EEPROM begin this reading 0, mean not count yet
If MyCounter < 3 Then  'Set for 3 times count then

MyCounter = MyCounter + 1  'Begin to Count
EEPROM_Write x, MyCounter  'Write EEPROM begin from 0 to 3 times limit
WaitMs 200

Lcdcmdout LcdLine1Pos(1)
Lcdout MyCounter, "Count"  'Add Label Count to C1
WaitMs 200


Endif

Thanks,
Mini.
 
I can imagine half a dozen ways to do this, but from your description I cannot tell precisely what is going on. I think it would be better to ask your friend about it or just not worry about protecting your IP until you have something unique. You can also refrain from sharing anything.
Hi PB,
I am newbie, tried to learn, from Senior here.

Thanks,
Mini.
 
Just be aware HEX files can be de-compiled and read and modified to remove any restrictions you write in to the program..

You only have to use the simulator in Oshonsoft to see that in action.

If, as per Papabravo, you really need to protect your IP, don't release software in any form out in to the world.
 
Hi PB,
I am newbie, tried to learn, from Senior here.

Thanks,
Mini.
I understand that and I have no problem with you asking questions. I'm just letting you know that from your description I cannot tell precisely what is going on. You are there and can observe, I am not and so I'm blind to what you can see. I think your friend is a better source of information than random internet strangers. I hope you can find a way to achieve some clarity on the matter.
 
I understand that and I have no problem with you asking questions. I'm just letting you know that from your description I cannot tell precisely what is going on. You are there and can observe, I am not and so I'm blind to what you can see. I think your friend is a better source of information than random internet strangers. I hope you can find a way to achieve some clarity on the matter.
Hi PB,
Thank you so much.
My friend uses a C Compiler , he doesn't know about the Oshonsoft Compiler, I don't want to push it if someone doesn't know.
He gave me a sample code, then I tried to translate it to Oshonsoft, I have tried so far, but it still wont work.
So I came here to share my problem, hope I got an idea from someone here.

Thanks,
Mini.
 
This is an important piece of information. Some compilers/development environments provide certain features and others DO NOT. I'm going to guess that Oshensoft does not even have the concept of a demo version as you have described it. Your friend knows his environment but doesn't know squat about yours. I'm also guessing he has no motivation or intention to learn it. If you want to use this feature switch to his compiler and ditch the Oshensoft environment. You can always go back to if it you have sufficient motivation. This way you can figure out what is going on at your leisure with bothering your friend.
 
This is an important piece of information. Some compilers/development environments provide certain features and others DO NOT. I'm going to guess that Oshensoft does not even have the concept of a demo version as you have described it. Your friend knows his environment but doesn't know squat about yours. I'm also guessing he has no motivation or intention to learn it. If you want to use this feature switch to his compiler and ditch the Oshensoft environment. You can always go back to if it you have sufficient motivation. This way you can figure out what is going on at your leisure with bothering your friend.
Hi PB,
Thank you for giving me information.
Anyway, I am almost finished with my little code, now it has been working, just hope to put an EEPROM write into the main code.
It already counts for a few times, but a bit is not saved once it reaches the time limit.

Thanks,
Mini.
 
You can't make a hex file that acts as a demo but you can program chips that are read protected. You need to setup some config defines. Someone who knows Oshonsoft better should be able to help.

Mike.
 
Just be aware HEX files can be de-compiled and read and modified to remove any restrictions you write in to the program..
Not really - they can be dis-assembled to produce assembler code. You can't de-compile a HEX file to produce the original high level source, all that data has gone.
 
You can't make a hex file that acts as a demo but you can program chips that are read protected. You need to setup some config defines. Someone who knows Oshonsoft better should be able to help.

Mike.
Mike,
What is my goal, the code as a demo version consists of EEPROM to make few times use, then once a limit is reached that project (code has been generated to hex) is given some message and then the current hex is working, it can't work any more, but a uC cheap still can use for next burn with same hex file.

Example for a limit we set 3 times then it will give errors once it reaches 3 times, so they can use it again to burn again the hex files, but there will come errors again every 3 times.

This different meaning, like an App with "exe", that we can't use once it has expired, due we need to delete a registry or date time was added on the registry machine/software.

Sorry if my explanation is make a confusing.


Thanks,
Mini.
 
Mike,
What is my goal, the code as a demo version consists of EEPROM to make few times use, then once a limit is reached that project (code has been generated to hex) is given some message and then the current hex is working, it can't work any more, but a uC cheap still can use for next burn with same hex file.

Example for a limit we set 3 times then it will give errors once it reaches 3 times, so they can use it again to burn again the hex files, but there will come errors again every 3 times.

This different meaning, like an App with "exe", that we can't use once it has expired, due we need to delete a registry or date time was added on the registry machine/software.

Sorry if my explanation is make a confusing.


Thanks,
Mini.
It would be relatively simple to do, but it seems a pretty pointless thing to do? - but if you want to do it, just write the code to do what you want - you can easily keep track of how many times it's run, by saving a count to the data EEPROM.

I've never seen any system that provides such a pointless facility as part of it's operation though - and it would be easy to disassemble the HEX file and remove the function.

For those of you who remember the Commodore Amiga?, it had a famous Paint Program called Deluxe Paint, and this came on a protected (deliberate fault on the disk) floppy - and while you could install the program to HDD when you ran it you had to insert the floppy in the disk drive, to prove you had it. I simply stepped through the disassembled program until I found the sub-routine that checked for the damaged disk, which returned a value in a register for yes or no. I then simply replaced the sub-routine call with a line that wrote the 'yes' value to the required register.

So no assembling or anything, I simply patched the .EXE file directly using a HEX editor, one 32 bit word changed, and that was it.

With the PIC HEX file you could do the same, but you'd also have to correct the checksum at the end of the line of the HEX file - it would be simpler to just alter the assembly code, and re-assemble it.

If you want a demo file?, then produce one with limited functionality - or better still, don't produce one at all, just make the full version available.
 
It would be relatively simple to do, but it seems a pretty pointless thing to do? - but if you want to do it, just write the code to do what you want - you can easily keep track of how many times it's run, by saving a count to the data EEPROM.

I've never seen any system that provides such a pointless facility as part of it's operation though - and it would be easy to disassemble the HEX file and remove the function.

For those of you who remember the Commodore Amiga?, it had a famous Paint Program called Deluxe Paint, and this came on a protected (deliberate fault on the disk) floppy - and while you could install the program to HDD when you ran it you had to insert the floppy in the disk drive, to prove you had it. I simply stepped through the disassembled program until I found the sub-routine that checked for the damaged disk, which returned a value in a register for yes or no. I then simply replaced the sub-routine call with a line that wrote the 'yes' value to the required register.

So no assembling or anything, I simply patched the .EXE file directly using a HEX editor, one 32 bit word changed, and that was it.

With the PIC HEX file you could do the same, but you'd also have to correct the checksum at the end of the line of the HEX file - it would be simpler to just alter the assembly code, and re-assemble it.

If you want a demo file?, then produce one with limited functionality - or better still, don't produce one at all, just make the full version available.
NG,
Thank you so much.

Thanks,
Mini.
 
NG,
It would be relatively simple to do, but it seems a pretty pointless thing to do? - but if you want to do it, just write the code to do what you want - you can easily keep track of how many times it's run, by saving a count to the data EEPROM.

I've never seen any system that provides such a pointless facility as part of it's operation though - and it would be easy to disassemble the HEX file and remove the function.

For those of you who remember the Commodore Amiga?, it had a famous Paint Program called Deluxe Paint, and this came on a protected (deliberate fault on the disk) floppy - and while you could install the program to HDD when you ran it you had to insert the floppy in the disk drive, to prove you had it. I simply stepped through the disassembled program until I found the sub-routine that checked for the damaged disk, which returned a value in a register for yes or no. I then simply replaced the sub-routine call with a line that wrote the 'yes' value to the required register.

So no assembling or anything, I simply patched the .EXE file directly using a HEX editor, one 32 bit word changed, and that was it.

With the PIC HEX file you could do the same, but you'd also have to correct the checksum at the end of the line of the HEX file - it would be simpler to just alter the assembly code, and re-assemble it.

If you want a demo file?, then produce one with limited functionality - or better still, don't produce one at all, just make the full version available.
NG,
As well as you story that App, I remember few year ago, I was made little project for testing.
Please find attached files.

Thanks,
Mini.
 

Attachments

  • Test.rar
    388.1 KB · Views: 103
I don't think there is any practical way to "protect" a HEX file, especially from the Oshonsoft compiler/IDE. All anyone has to do is load the HEX file into the IDE and view the EEPROM data. Once you save that, it can be edited or reset to original values and run again.
You could try some encryption method for storing the value in EEPROM, but again, all anyone has to do is load the original HEX file and save the original EEPROM values for later use.
The only way to protect your code is to burn it into a PIC and set the Read Protection bit on, so no one can read the contents.
The same applies to a PICKIT2 or 3 that can load the HEX file, and display the contents. One can save the information before burning a PIC with the code, and simply burn it again to reset the trial events.
 
I don't think there is any practical way to "protect" a HEX file, especially from the Oshonsoft compiler/IDE. All anyone has to do is load the HEX file into the IDE and view the EEPROM data. Once you save that, it can be edited or reset to original values and run again.
You could try some encryption method for storing the value in EEPROM, but again, all anyone has to do is load the original HEX file and save the original EEPROM values for later use.
The only way to protect your code is to burn it into a PIC and set the Read Protection bit on, so no one can read the contents.
The same applies to a PICKIT2 or 3 that can load the HEX file, and display the contents. One can save the information before burning a PIC with the code, and simply burn it again to reset the trial events.
Sagor1,
As you said, is absolutely correct.
My goal is, adding a demo version into the main source code gives a limit and then appears a message.
I am sure if it is only a few times, say like just for 2 times, and then they will no longer use the Hex code, but if they do for burn it again, it will be use again, this will loop only use for 2 times, but if they think that hex code is very good for him, then they will contact your number, as well that has been set when the limit is over.
At Debugger or Compiler sites there are features for protection, I never test it but it has a different meaning.
My goal is to give hex files to the public for free use, then after they use it, they will get a message and finish to use, it means like an App Desktop Application.


Thanks,
Mini.
 
Sagor1,
As you said, is absolutely correct.
My goal is, adding a demo version into the main source code gives a limit and then appears a message.
I am sure if it is only a few times, say like just for 2 times, and then they will no longer use the Hex code, but if they do for burn it again, it will be use again, this will loop only use for 2 times, but if they think that hex code is very good for him, then they will contact your number, as well that has been set when the limit is over.
At Debugger or Compiler sites there are features for protection, I never test it but it has a different meaning.
My goal is to give hex files to the public for free use, then after they use it, they will get a message and finish to use, it means like an App Desktop Application.


Thanks,
Mini.
I would say your entire plan is doomed - people just won't use it - I certainly wouldn't, and I doubt many would.
 
I would say your entire plan is doomed - people just won't use it - I certainly wouldn't, and I doubt many would.
NG,
If an user no like it, they can skip and use another.
That my goals and plan, only showing the project (say is Hex).
Could be have another way, but I don't know how to do it, hope Senior here give an idea.

Thanks,
Mini.
 

Latest threads

Back
Top