topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
proposal / request | Xharbour has :
SET ERRORLOG TO <cLogFile> [ADDITIVE]
FWH seems to create his own error.log , but why it doesn't follow this set command ?
Frank |
proposal / request | Hola,
And in the multiuser enviroment what happend when there are more than one error per user?, my suggestion is to modify errorsys.prg to keep all the errors in a database table or other file with extra information, IP station etc... then you can develop a viewer module to admin this file.
I admin the errors in this way, idea only
regards
Marcelo |
proposal / request | I have changed errorsys.prg as :
cErFile := "ERRORS\Er" + DTOS(DATE()) + "." + CharOnly("0123456789",Time()) + ".log"
I create also one line which indicates the user
Frank |
proposal / request | It would be very helpful,
considering that there is a feature that lets you send this file by mail to support.
Have a nice day
marco |
proprietary file | How to create a proprietary file to insert information such as csv but not visible |
propuestas de solución en un PRESUPUESTO | Hola compañeros:
Tengo una APP en DBF/CDX que funciona a la perfección. Entre las opciones disponible, permite crear/modificar presupuestos. La cuestión es que a la hora de modificar un presupuesto para añadirle un nuevo artículo, este se coloca/visualiza al final. Me gustaría que el usuario pudiese elegir el orden de los artículos y decidir donde insertar el nuevo artículo añadido (en la 3ª linea, 5ª o la última, por ejemplo).
¿Qué solución se os ocurre que fuese la más sencilla de programar?
Saludos y mil gracias.
LORENZO. |
propuestas de solución en un PRESUPUESTO | Si quieres hacer eso lo más sencillo sería un campo numérico, empezando por el 1 en cada presupuesto, que se muestre en el Xbrowse, podrías indexarlo por su número de orden y número de presupuesto . Y si quieres insertar en cualquier posición es muy fácil renombrar los números teniendo conocimiento del actual. Supongo que los maestros te darán otras soluciones más adecuadas.
Un abrazo.
Enviado desde mi POCOPHONE F1 mediante Tapatalk |
propuestas de solución en un PRESUPUESTO | Buenas
Yo tengo algo desarrollado que te puede servir.
Dime un correo y te lo mando.
Saludos
Jesús |
propuestas de solución en un PRESUPUESTO | Gracias jvtecheto
Jesús este es mi email:
lorenzo_fernandez Arroba hotmail.com
Gracias!!
LORENZO. |
proteccion contra pirateria de software | Hola,
Tengo un sistemita hecho en FW16 que corre en clientes windows y los datos estan en un servidor.
Que opciones tengo para poder proteger el sistema de que no se lo lleven a otra parte y me lo pirateen.. ahorita no tengo nada de proteccion .
Gracias |
proteccion contra pirateria de software | Puedes usar la función nSerialHD() que te devuelve el número de serie del disco duro y asi comprobar el ordenador sobre el que funciona.
Otros sistemas más sencillos son, por ejemplo, tener un determinado fichero en algún directorio del ordenor (c:\windows) y si dicho fichero no está, terminar la ejecución del programa. Cuando copien tu programa, no copiarán ese fichero. |
proteccion contra pirateria de software | Gracias antonio... pero he visto algunos dispositivos USB que se colocan en las maquinas cliente... alguien sabe algo de eso ?
Rene |
proteccion contra pirateria de software | yo siempre he dicho que lo que entra por software, tarde o temprano sale por software (si no no existirian los "cracks"), definitivamente la mejor forma de proteger un programa es por medio de una llave de hardware de puerto paralelo o usb digamos que es la unica infalible.
a 32 bits puedes jugar un poco mas, por ejemplo nosotros tenemos un sistema de proteccion basado en advantage internet server que exige que el usuario tenga que conectarse a internet por lo menos una vez al mes para poder continuar usando el programa.
la otra forma es generar archivos en directorios estrategicos, por ejemplo archivos .MEM disfrazados de DLLs en la carpeta windows/system
esto de los archivos evita que copien el programa de una computadora a otra, pero no evita que se copie el disco original de instalacion
los sistemas de proteccion por internet tambien funcionan muy bien, los sistemas de clave y contra clave funcionan muy bien
Cuando el usuario arranca el programa y esta coentado a internet, se conecta nuestro servidor AIS se busca el numero nic de su tarjeta de red (para no tener problema cuando el usuario formatea o cambia el disco duro) en un dbf y se verifica en que fecha vence la suscripcion. |
proteccion contra pirateria de software | Rene, como puede obtener el numero nic de la tarjeta de red?
Saludos de Brasil
Maurilio |
proteccion contra pirateria de software | Maurilio,
GetNetCardId() |
proteccion contra pirateria de software | Thanks!!!!
Regards
Maurilio |
proteccion de pagina web mod_harbour | Estimado compañeros buenos dias
- tengo dos sitios uno http y otro https
- el http es para pruebas y el https para producción
Nos cayo el Ransomware a pesar que los dos servidores estaban detrás del firewall Sophos
La gente de Sophos afirma que estos sitios son inseguros por eso ( por culpa de los sitios inseguros ) entro el Ransomware
en la ignorancia nuestra en estos temas acudo a ustedes que me recomiendan para mejorar las seguridades o protecciones de estos dos sitios web ?
algún software para tener respaldados los servidores ( a pesar que eso lo saca la gente de sistemas pero tenían un respaldo de hace 15 dias y solo del sitio https )
sitio https
web server apache instalado con xampp ( ultima version disponible 64 bits ) puerto en el que opera web server 8443
windows 2019 server
ip publica
certificado comprado ( no es caro pero es un certificado)
Se tiene en proceso de pruebas un programa de logística de camiones que use mod_harbour + tWeb + mercury del consultor Charly
sitio http
web server apache instalado con xampp ( ultima versión disponible 64 bits ) puerto en el que opera web server 80
windows 2019 server
ip publica diferente a la anterior
el programa anterior esta en este server también
muchas gracias por sus comentarios |
proteccion de pagina web mod_harbour | Hello Wilson,
Lo que todavía está instalado en este servidor web.
La mayoría de las veces, el RANSOMWARE se envía a través de un archivo adjunto de correo electrónico.
¿Está seguro de que el software de cifrado llegó a través de su servidor APACHE?
¿Está todo su disco duro cifrado o solo el directorio htdocs?
Best regards,
Otto
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=37383&p=223340&hilit=backup&sid=76cebc693d1f5c861e9b4471e8917d9f#p223340">viewtopic.php?f=3&t=37383&p=223340&hilit=backup&sid=76cebc693d1f5c861e9b4471e8917d9f#p223340</a><!-- l -->
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=37326&p=222974&hilit=ransomware&sid=76cebc693d1f5c861e9b4471e8917d9f#p222974">viewtopic.php?f=3&t=37326&p=222974&hilit=ransomware&sid=76cebc693d1f5c861e9b4471e8917d9f#p222974</a><!-- l -->
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=35900&p=213884&hilit=ransomware&sid=76cebc693d1f5c861e9b4471e8917d9f#p213884">viewtopic.php?f=3&t=35900&p=213884&hilit=ransomware&sid=76cebc693d1f5c861e9b4471e8917d9f#p213884</a><!-- l --> |
proteccion de pagina web mod_harbour | Otto gracias por su preocupación
es lo que dicen los Sres del firewall que es un hardware mas un software que vendieron y según yo no protegió
es mas acaban de bajarme las paginas ( bajaron los servidores ) hasta que yo haga algo que permita que sean fiables las paginas
saludos
Wilson |
proteccion de pagina web mod_harbour | ¿Es ese su servidor interno? |
proteccion de pagina web mod_harbour | Dear Otto two servers are on the customer infraestructure not mine, I'm only make an software writen in mod_harbour and need to operate on that enviroment the people of the firewall claims I'm the guilty because this two servers were attack with ransomware
Now the customer banned this two servers until we install protections
The questions are
How we protect this two servers ?
many thanks for your help
wilson
excuseme my english |
proteccion de pagina web mod_harbour | Hello Wilson,
Personalmente, no creo que el ataque se haya producido a través del protocolo http.
¿Pudiste realizar un seguimiento de qué archivos / directorios se cifraron primero?
El correo electrónico no deseado con un archivo adjunto malicioso es el método más común para introducir ransomware en la máquina de la víctima.
¿Hay software de correo electrónico en estos dispositivos?
Sería muy importante para todos nosotros saber qué sucedió exactamente.
Para que podamos tomar precauciones.
Pienso en desinstalar PHP en mis servidores.
Por el momento, Mod Harbour no es muy conocido, por lo que el riesgo de un ataque es mínimo.
------------------------------------
Personally, I don't think the attack was via the http protocol.
Were you able to keep track of which files / directories were encrypted first?
Spam email with a malicious attachment is the most common method to get ransomware onto a victim's machine.
Is there email software on these servers?
It would be very important for all of us to know what exactly happened.
So that we can take precautions.
I think of uninstalling PHP on my servers.
Mod harbour at the moment is not widely known, so the risk of an attack is minimal.
Best regards,
Otto |
proteccion de pagina web mod_harbour | Estimado Otto
Ellos tienes Office 365 como email y les vendieron con la seguridad que nunca les va a atacar el ransomware ( al menos eso dijeron ellos y le stienen convencidos a todos en la empresa )
No se puede hacer ningún rastreo porque los servidores fueron formateados el uno y el otro restaurado desde respaldos
El problema es que los han bajado a esos servidores y yo no se que ponerles para que los acepten y poder subirlos de nuevo
saludos
Wilson
pd: estoy seguro que el sophos no detecto y paso por el y ahora me culpan a mi eso pienso por eso pregunto si alguien sabe del tema |
proteccion de pagina web mod_harbour | Dear Wilson,
Take a look at a YouTube video of how a RANSOMWARE attack takes place.
With the antivirus software we use, we can basically block newly installed applications.
That already thwarted a great many attacks.
We use Panda watchguard antivirus software.
It is a pity that you can no longer examine the system yourself.
I always look first to see which bat, com, exe files have been installed in the last 24 hours. Then I compare the modification dates of the encrypted files. Often this is how I find out where the attack came from.
RDP with simple passwords is also dangerous.
Mapped drives can also be encrypted from another PC.
Best regards,
Otto |
proteccion de pagina web mod_harbour | Wilson,
Tu tienes montado un servidor con apache y el mod, cierto ? O ademas es un servidor coorporativo, con carpetas compartidas, servidor de correo, otros servidores,...
Primero, el mod no es el culpable del ransom. Ademas como sabes que es un ransomware? Por cierto, el objetivo del ransom no es formatear un ordenador, sino pedir un rescate por tus datos.
El ransomware normalmente viene anexado en fichero via mail. La gente los abre y se ejecuta el programa malicioso, el malware. Para evitar esto como debes proceder: un buen antivirus. En este caso, lo detectaria al abrir y lo neutralizaria.
Pero ademas, a esta accion en el server debes tu o el responsable del servidor tener un buen respaldo de copias y esto es vital la regla 1. Justamente ayer hablaba con Antonio de la regla 3+2+1 para respaldos, pero bueno cada uno tiene su estrategia, pero si es cierto una cosa. Toda empresa debe de tener sus backups en orden.
Pueden haber casos en que entren en tu máquina aprovechando firewall mal configurado o vulnerabilidades del sistema operativo, por eso tambien es siempre importante tener actualizado tu SO. En resumen, todo un mundo el ambito de sistemas.
Que tengas un http o https solo te garantiza uan encriptacion de datos de un punto a otro y se encarga dicho protocolo. En este sentido si tienes un http solo debes saber que si que pueden con técnicas de sniffer chequear paquetes de datos y ver contenido, entre otras posibilidades. Son tecnicas complicadas pero estan disponibles para los hackers. Por eso si es importante tener un cifrado. En resument cuando haces tu login/psw a un banco o a tu applicacion, si "sniffas" por ejemplo por la wifi esta transmision podrias llegar a pillar estos datos. Pero por aqui no te van a colar un ransom.
Me extraña que te culpen a ti, quizas por que ven que en este ambito de sistemas desconoces el tema, pero tampoco se en que se basan, lo desconozco. |
proteccion de pagina web mod_harbour | Charly buenos dias
gracias por tus explicaciones
Pues va a ver que descubri lo siguiente
- Esos servidores no tenian instalados antivirus
- al parecer si entro por el sophos OJO con este firewall te lo venden diciendo que te protege ransomware y si pasa por alli el ransomware ( que creo es el caso ) empiezan a buscar culpables ( no me parece bien depender de esta gente )
- ya me dejaron de culpar ( al menos ya no he escuchado mas esos comentarios )
- van a subir el primer servidor y veo que recién le instala antivirus ( negligencia )
- en fin que todo esto es un mundo y tarde o temprano tendré que en mi nube poner protecciones
saludos y gracias por sus ideas
regards
Wilson |
proteccion de pagina web mod_harbour | Wilson,
Muchas gracias por compartir tu información tan valiosa para todos nosotros |
proteccion de pagina web mod_harbour | Gracias a ti Master mira lo que estas creando con el mod ja ja ja
RESUMEN
- vamos a cambiar el puerto 80 por otro al apache
- por fin !! van a poner un antivirus
del server con https aun no lo topamos porque están sin tiempo los de sistemas
ya iré comentando
saludos
Wilson |
proteccion de programas | Colegas una de las maneras mas seguras que yo conozco y utilizo es con pequeño programita de no mas de 15 lineas donde recupero el: LABEL y el SERIAL del disco duro, y si quieres extremar la seguridad con una funcion POKE(), extraes de una direccion fija en todos los PC la FECHA DEL BIOS, con estos 3 datos encriptados los guardas en alguna parte de tu DD en un archivo *.mem, con cualquier "NOMBRE.DLL" para despistar a los mas avezados y siempre al ingresar a tu programa revisas estos tres parametros contra los que tienes encriptados y guardados; deberian y tienen que ser exactamente iguales de lo contrario te copiaron el programa.
Otra opcion que yo utilizo es marcar el "COMMAND.COM" con un numero serial de tu sola propiedad y conocimiento el cual siempre lo compararas al entrar a tu aplicacion.
Saludos RODOLFO SILVA
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --> |
proteccion sistema en red y local | Hola Foro,Recien termine un proyecto y lo acabo de instalar en una sucursal, necesito proteger el sistema contra instalacion en otras pc, expongo mi caso a ver que me recomiendan:Tengo una LAN de 10 pc's, en la de almacen instale el sistema y el usuaio puede accesar localmente por su disco c:, la proteccion que tiene es por medio de no. serie de su HD,Se compartio la carpeta donde se instalo el sistema para que accesara compras y contabilidad, pero no les permite acceder porque el no. de serie de su HD es diferente al de almacen, como hago para que puedan accesar y a la vez les valide el sistema?No quiero restriccion de computadoras accesadas en red, sino evitar que el mismo usuario de almacen lo copie a su usb y lo instale en otro negocio lo ponga en red y lo puedan accesar.GraciasSalu2Paco |
proteccion sistema en red y local | Ya lo he comentado en otras ocasiones.La forma más segura que he encontrado para evitar el copiado (o piratería) es mediante la generación de claves o contra-cuentas asociadas al elemento a controlar. Para JUAN PEREZ puedes generar una clave XG23F-G7FS4.El secreto estará en el algoritmo que genere la contra-cuenta. Puedes obtener el valor Asc() de cada caracter de la cadena origen y aplicarle cualquier operación aritmética (un juego entre primos) para generar un elemento de la contra-cuenta, te aseguro que cuando quites o agregues un caracter del origen variará la cadena final.La cadena de origen puede tener cualquier cantidad de elementos asociados Nombre, Empresa, Cantidad de Usuarios concurrentes, Fecha de Vencimiento, etc.Ahora te diré, si no se permites huecos de seguridad (controlados) en el control de tu producto solo tendrás en pocos usuarios o clientes. Deja que lo copien y lo distribuyan es parte de la publicidad, solo contrólalo. |
proteccion sistema en red y local | Completamente de acuerdo con Alfredo. El problema no es el que te copien sino que en la copia no pueda establecerse un control del cliente que te compró. En otras palabras, si la copia sigue reflejando el nombre de tu cliente "legal" es altamente probable que si al "ilegal" o pirata le interesa tu aplicación te lo va ha comprar (por el tema de que sólo a pocos les interesa operar una aplicación que a todas luces aparece como pirata ya que siempres sale en pantalla o en reportes un nombre que no es el suyo) |
proteccion sistema en red y local | Hola Paco:Presisamente he vuelto a retomar este proyecto. Y es que como recordarán, meses atras mi colega Carlos Gallego y su servidor estabamos trabajando en conjunto para la creación de un sistema de protección medianteun disco USB, apartir de un ejemplo que viene en las ultimas actualizaciones de FW.<!-- m --><a class="postlink" href="http://67.222.39.232/forums/viewtopic.php?t=10050&highlight=pendrive">http://67.222.39.232/forums/viewtopic.p ... t=pendrive</a><!-- m -->Te comento que el candado funciona perfectamente para un equipo local, pero desgraciadamente para que trabaje en equipos remotos no funciona, y es que el problema radica en que es casi imposible acceder al disco y obtener el número de serie físico del USB desde las terminales remotas. <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: --> Me comentaba Carlos Gallego, que se le acabaron las ideas y el tiempo para continuar con el proyecto, no se si el haya continuado. <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> Hace 3 dias he vuelto a remotar este proyecto y he logrado acceder a la unidad de forma remota, pero me he quedado atascado porque no logro obtener el numero de serie, la mejor forma de obtenerlo es con WMI, pero estoy empezando a investigar y es muy poca la informacion sobre este tema. <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> De todas maneras sigo haciendo pruebas y buscando en san goolgle, si alguien gusta aportar nuevas ideas serán bienvenidas.. <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
proteccion sistema en red y local | [quote="Francisco Horta":169vilz1]Hola Foro,
Recien termine un proyecto y lo acabo de instalar en una sucursal, necesito proteger el sistema contra instalacion en otras pc, expongo mi caso a ver que me recomiendan:
Tengo una LAN de 10 pc's, en la de almacen instale el sistema y el usuaio puede accesar localmente por su disco c:, la proteccion que tiene es por medio de no. serie de su HD,
Se compartio la carpeta donde se instalo el sistema para que accesara compras y contabilidad, pero no les permite acceder porque el no. de serie de su HD es diferente al de almacen, como hago para que puedan accesar y a la vez les valide el sistema?
No quiero restriccion de computadoras accesadas en red, sino evitar que el mismo usuario de almacen lo copie a su usb y lo instale en otro negocio lo ponga en red y lo puedan accesar.
Gracias
Salu2
Paco[/quote:169vilz1]Donde puedo dejar un fichero para que lo mires/pruebes?Tu sistema está instalado en W2000?SaludosCarlos G. |
proteccion sistema en red y local | Paco revisa tu correo de hotmail |
proteccion sistema en red y local | Gracias a todos por sus observaciones y sugerencias,carlos puedes enviarlo a: <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->Salu2Paco |
proteccion sistema en red y local | Jovenes colegas,Por un lado en lo relacionado a las copias piratas, lo que yo hago es restringir a cierto numero de registros capturados en el DBF principal de forma que pueden trabajar (y probar) el sistema hasta cierto limite.Despues de que el prospecto a cliente le ha invertido un buen tiempo al sistema capturando gran parte de su informacion, desaparezco de "por ahi" algun archivo que se genero al instalar el sistema y a partir de ese momento se pone a verificar lo relacionado a la proteccion.Por otro lado, hablan de proteger el sistema mediante un "chupon" (USB-Drive) y para eso en versiones recientes de FWH viene la funcion GetUSBSerial( cDrive ) que no se que le vean de malo como para no usarlo para proteger los sistemas mediante este equema. |
proteccion sistema en red y local | [quote="RodolfoRBG":1se3q8ax]Jovenes colegas,
Por un lado en lo relacionado a las copias piratas, lo que yo hago es restringir a cierto numero de registros capturados en el DBF principal de forma que pueden trabajar (y probar) el sistema hasta cierto limite.
Despues de que el prospecto a cliente le ha invertido un buen tiempo al sistema capturando gran parte de su informacion, desaparezco de "por ahi" algun archivo que se genero al instalar el sistema y a partir de ese momento se pone a verificar lo relacionado a la proteccion.
Por otro lado, hablan de proteger el sistema mediante un "chupon" (USB-Drive) y para eso en versiones recientes de FWH viene la funcion GetUSBSerial( cDrive ) que no se que le vean de malo como para no usarlo para proteger los sistemas mediante este equema.[/quote:1se3q8ax]Yo lo estoy empezando a probar y de momento le he encontrado que en sistemas bajo W2000 si no eres administrador no puedes obtener y por tanto comprobar el número de serie del USB.La decisión que he tomado ha sido mirar hacia el futuro; el W2000 es muy bueno, está cumpliendo su cometido pero ya tiene 8 años; delante tengo el Xp y el Vista y tengo entendido que en ellos funciona.SaludosCarlos G. |
proteccion sistema en red y local | Sugerencias-Encripta del nombre o razon social de la empresa a la instalaste el software, de ese modo, asi lo copien, siempre aparecera el nombre del comprador original-A l instalar en la estacion de trabajo, debes "leer" el MacAddrees de la tarjeta de red, esa serie la almacenas en una dbf en el servidor, asi que cada vez que la estacion se comunique con el server, se hace una verificacion, el el mac de la estacion no esta registrada en la dbf, debe pedir una clave que solamante tu la conoces ademas el propietarion de la empresa,,, cuando alguien llega a copiar tu app. siempre pedira la clave para registrar los mac respectivos de cada estacion..Salu2 |
proteccion sistema en red y local | Hola Francisco, Yo utilizo unas llaves usb muy buenas y seguras y baratas.Son de fabricacion argentina. su pagina es <!-- m --><a class="postlink" href="http://www.hardkey.net/">http://www.hardkey.net/</a><!-- m --> Yo uso unas llaves que tienen un reloj RTC interno, si te interesa te pasoel fuente para acceso a la dll de ellos. |
proteccion sistema en red y local | Vaya cuantas sugerencias (que chido), gracias a todos por sus aportes, algo rapido, pense en contabilizar cierta cantidad de registros capturada (lo que comenta Rodolfo) y cazar el sistema con el nombre de la empresa (encryptada en un dbf protegida).Pablo, definitivamente es una muy buena opcion, habria que evaluar, pero por otra parte si seria bueno que quien lo copie le de un cierto uso limitado para que lo conozca y asi decidan la compra (es muy buena publicidad y gratis).Gracias a todos !!Salu2Paco |
proteccion sistema en red y local | Totalmente permitido, si no encuentra la llave le puedes decir que te limite los registros a 100 o 50.. como quieras, todo depende de tus necesidades |
protect a PDF | Hi everyone
I would like to protect a PDF file already signed with Aruba with
a user password, has anyone already addressed the problem?
I through the HaruPdf library of harbour have performed the protection
only when creating the document, I was wondering if the library
it also allows you to open a PDF and protect it.
Thanks in advance |
protecting an app for illigal copying | Hello Antonio,
I want to protect my app from illigal copying/distibuting. In Windows I use the serial number of the harddisk where the app is installed on. This serial number is a 8 numbers HEX string like 'AE23 12BF'. In my app I calcutates with this string so users can only install the app on one disk, depending on a key I give them.
I have looked in Apple developers for such functionallity, but the harddisk number seems not to be a save way. However, every Mac has a unique MAC-adres which I can use to protect my app. Here is a explanation:
[url:kne8545h]https://developer.apple.com/library/content/technotes/tn1103/_index.html[/url:kne8545h]
Is it possible for you to make a function that retrieves the MAC adres of a computer? Someting like 'cMacAdres:= GetMacAdres()'. With this string I can protect my app with a registration key that I store in a .plist
On the next page is a sample code, hope this can be build in.
[url:kne8545h]https://developer.apple.com/library/content/samplecode/GetPrimaryMACAddress/Introduction/Intro.html[/url:kne8545h]
René |
protecting an app for illigal copying | We have other possibilities here:
[url:tu6qf6w7]http://stackoverflow.com/questions/677530/how-can-i-programmatically-get-the-mac-address-of-an-iphone[/url:tu6qf6w7]
reviewing them |
protecting an app for illigal copying | This one is also interesting:
[url:2ri5q797]http://forums.macrumors.com/threads/how-to-find-mac-address-using-xcode.689645/[/url:2ri5q797]
[code=fw:2ri5q797]<div class="fw" id="{CB}" style="font-family: monospace;">NSPipe *outPipe = <span style="color: #000000;">[</span>NSPipe pipe<span style="color: #000000;">]</span>;<br />NSTask* theTask = <span style="color: #000000;">[</span><span style="color: #000000;">[</span>NSTask alloc<span style="color: #000000;">]</span> <span style="color: #0000ff;">init</span><span style="color: #000000;">]</span>;<br />NSString *string;<br />NSString *s;<br /><span style="color: #B900B9;">//Built-in ethernet</span><br /><span style="color: #000000;">[</span>theTask setStandardOutput:<span style="color: #000000;">outPipe</span><span style="color: #000000;">]</span>;<br /><span style="color: #000000;">[</span>theTask setStandardError:<span style="color: #000000;">outPipe</span><span style="color: #000000;">]</span>;<br /><span style="color: #000000;">[</span>theTask setLaunchPath:@<span style="color: #ff0000;">"/sbin/ifconfig"</span><span style="color: #000000;">]</span>;<br /><span style="color: #000000;">[</span>theTask setCurrentDirectoryPath:@<span style="color: #ff0000;">"~/"</span><span style="color: #000000;">]</span>;<br /><span style="color: #000000;">[</span>theTask setArguments:<span style="color: #000000;">[</span>NSArray arrayWithObjects:@<span style="color: #ff0000;">"en0"</span>, <span style="color: #00C800;">nil</span><span style="color: #000000;">]</span><span style="color: #000000;">]</span>;<br /><span style="color: #000000;">[</span>theTask launch<span style="color: #000000;">]</span>;<br /><span style="color: #000000;">[</span>theTask waitUntilExit<span style="color: #000000;">]</span>;<br /><br />string = <span style="color: #000000;">[</span><span style="color: #000000;">[</span>NSString alloc<span style="color: #000000;">]</span> initWithData:<span style="color: #000000;">[</span><span style="color: #000000;">[</span>outPipe fileHandleForReading<span style="color: #000000;">]</span> readDataToEndOfFile<span style="color: #000000;">]</span> encoding:<span style="color: #000000;">NSUTF8StringEncoding</span><span style="color: #000000;">]</span>;<br /><br /><span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>!<span style="color: #000000;">[</span>string isEqualToString:@<span style="color: #ff0000;">"ifconfig: interface en0 does not exist"</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> s = string;<br /> NSRange f;<br /> f = <span style="color: #000000;">[</span>s rangeOfString:@<span style="color: #ff0000;">"ether "</span><span style="color: #000000;">]</span>;<br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>f.location != NSNotFound<span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> s = <span style="color: #000000;">[</span>s substringFromIndex:<span style="color: #000000;">f</span>.location + f.length<span style="color: #000000;">]</span>;<br /> <br /> string = <span style="color: #000000;">[</span>s substringWithRange:<span style="color: #000000;">NSMakeRange</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span>, <span style="color: #000000;">17</span><span style="color: #000000;">)</span><span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #000000;">[</span>ethernet setStringValue:<span style="color: #000000;">string</span><span style="color: #000000;">]</span>;<br /><span style="color: #000000;">}</span></div>[/code:2ri5q797] |
protecting an app for illigal copying | one more:
[url:xjqlmd1p]http://www.cocoabuilder.com/archive/cocoa/68919-how-to-get-mac-address.html[/url:xjqlmd1p]
[code=fw:xjqlmd1p]<div class="fw" id="{CB}" style="font-family: monospace;">void getEthernetAddress<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> InetInterfaceInfo myInetInterfaceInfo;<br /> int i, adaptorInterface;<br /><br /> NSLog<span style="color: #000000;">(</span>@<span style="color: #ff0000;">"Ethernet addresses: "</span><span style="color: #000000;">)</span>;<br /><br /> adaptorInterface=<span style="color: #000000;">0</span>;<br /> <span style="color: #00C800;">do</span> <span style="color: #000000;">{</span><br /> OTInetGetInterfaceInfo<span style="color: #000000;">(</span>&myInetInterfaceInfo, adaptorInterface<span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>myInetInterfaceInfo.fHWAddrLen > <span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span>i=<span style="color: #000000;">0</span>; i<myInetInterfaceInfo.fHWAddrLen; i++<span style="color: #000000;">)</span> <span style="color: #000000;">{</span><br /> printf<span style="color: #000000;">(</span><span style="color: #ff0000;">"%02x "</span>,myInetInterfaceInfo.fHWAddr<span style="color: #000000;">[</span>i<span style="color: #000000;">]</span><span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> printf<span style="color: #000000;">(</span><span style="color: #ff0000;">"<span style="color: #000000;">\n</span>"</span><span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> adaptorInterface++;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">while</span> <span style="color: #000000;">(</span>myInetInterfaceInfo.fHWAddrLen > <span style="color: #000000;">0</span><span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /> </div>[/code:xjqlmd1p] |
protecting an app for illigal copying | This one is working nicely <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
I send you the new FiveMac libs by email
[code=fw:2x4i6qvu]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> GETMACADDRESS <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> NSPipe *outPipe = <span style="color: #000000;">[</span>NSPipe pipe<span style="color: #000000;">]</span>;<br /> NSTask* theTask = <span style="color: #000000;">[</span><span style="color: #000000;">[</span>NSTask alloc<span style="color: #000000;">]</span> <span style="color: #0000ff;">init</span><span style="color: #000000;">]</span>;<br /> NSString *string;<br /> NSString *s;<br /> <span style="color: #B900B9;">//Built-in ethernet</span><br /> <span style="color: #000000;">[</span>theTask setStandardOutput:<span style="color: #000000;">outPipe</span><span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">[</span>theTask setStandardError:<span style="color: #000000;">outPipe</span><span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">[</span>theTask setLaunchPath:@<span style="color: #ff0000;">"/sbin/ifconfig"</span><span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">[</span>theTask setCurrentDirectoryPath:@<span style="color: #ff0000;">"~/"</span><span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">[</span>theTask setArguments:<span style="color: #000000;">[</span>NSArray arrayWithObjects:@<span style="color: #ff0000;">"en0"</span>, <span style="color: #00C800;">nil</span><span style="color: #000000;">]</span><span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">[</span>theTask launch<span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">[</span>theTask waitUntilExit<span style="color: #000000;">]</span>;<br /><br /> string = <span style="color: #000000;">[</span><span style="color: #000000;">[</span>NSString alloc<span style="color: #000000;">]</span> initWithData:<span style="color: #000000;">[</span><span style="color: #000000;">[</span>outPipe fileHandleForReading<span style="color: #000000;">]</span> readDataToEndOfFile<span style="color: #000000;">]</span> encoding:<span style="color: #000000;">NSUTF8StringEncoding</span><span style="color: #000000;">]</span>;<br /><br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>!<span style="color: #000000;">[</span>string isEqualToString:@<span style="color: #ff0000;">"ifconfig: interface en0 does not exist"</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span> <br /> <span style="color: #000000;">{</span><br /> s = string;<br /> NSRange f;<br /> f = <span style="color: #000000;">[</span>s rangeOfString:@<span style="color: #ff0000;">"ether "</span><span style="color: #000000;">]</span>;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> f.location != NSNotFound<span style="color: #000000;">)</span> <br /> <span style="color: #000000;">{</span><br /> s = <span style="color: #000000;">[</span>s substringFromIndex:<span style="color: #000000;">f</span>.location + f.length<span style="color: #000000;">]</span>;<br /> <br /> string = <span style="color: #000000;">[</span>s substringWithRange:<span style="color: #000000;">NSMakeRange</span><span style="color: #000000;">(</span><span style="color: #000000;">0</span>, <span style="color: #000000;">17</span><span style="color: #000000;">)</span><span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #000000;">}</span><br /><br /> hb_retc<span style="color: #000000;">(</span> <span style="color: #000000;">[</span> string cStringUsingEncoding : <span style="color: #000000;">NSWindowsCP1252StringEncoding</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span>; <br /><span style="color: #000000;">}</span></div>[/code:2x4i6qvu] |
protecting an app for illigal copying | Already sent <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
protecting an app for illigal copying | Antonio Añadida Funcion que devuelve el numero de serie de la maquina . Cada mac tiene un numero de serie único ... se debe añadir al compilar el ejemplo el framework iokit |
protecting an app for illigal copying | Tested and working fine
many thanks Manuel <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
protecting an app for illigal copying | Hello Antonio,
Thanks for this function. Just what I needed.
Tomorrow I will make a sample prg on how to use this for protection
Greetings,
Rene |
protecting an app for illigal copying | Rene,
very good
surely others users may appreciate to review your example PRG when it gets ready <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
protecting an app for illigal copying | Hello Antonio,
Here is a sample program on how I use the MacAdress to protect my program. The only thing I can't get to work is to calculate the days since the program is first opened. Normally I could calculate this by puting the first date in the registration key and when the program is opened again, get DATE()-Firstdate. The number that comes out of this calculation is not what I expect, it is a long number instead of the number of days.
[code=fw:mtcn043j]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveMac.ch"</span><br /><span style="color: #00D7D7;">#define</span> CR_LF Chr<span style="color: #000000;">(</span><span style="color: #000000;">13</span><span style="color: #000000;">)</span> + Chr<span style="color: #000000;">(</span><span style="color: #000000;">10</span><span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">/*<br />With this example we can build a protected program. The user must enter a registration key the first time he uses the program<br />This key is based on the MacAdres of the computer, every computer has at least one unique MacAdres<br />When the user gives his program to someone else, the key given is not working anymore<br />*/</span><br /><br /><span style="color: #00C800;">FUNCTION</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">PUBLIC</span> cVarFile<br /> <span style="color: #00C800;">PUBLIC</span> oWnd && the main <span style="color: #0000ff;">window</span><br /> <span style="color: #00C800;">PUBLIC</span> cPath := ResPath<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">PUBLIC</span> cRegKey := <span style="color: #ff0000;">''</span><br /> <span style="color: #00C800;">PUBLIC</span> nVersion := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">PUBLIC</span> lContinue := .F.<br /> <span style="color: #00C800;">PUBLIC</span> nDays := <span style="color: #000000;">0</span><br /> <br /> cVarFile := cPath + <span style="color: #ff0000;">'/registration.plist'</span><br /><br /> RK_LoadVariables<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span>cRegKey<span style="color: #000000;">)</span><br /> lContinue := RK_CheckKey<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">'testing registration'</span> ;<br /> <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">600</span>, <span style="color: #000000;">600</span><br /><br /><span style="color: #00C800;">IF</span> lContinue<br />@ <span style="color: #000000;">400</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">'Success, version: '</span> + ALLTRIM<span style="color: #000000;">(</span>STR<span style="color: #000000;">(</span>nVersion<span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">OF</span> oWnd <br /><span style="color: #00C800;">ELSE</span><br />@ <span style="color: #000000;">500</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">'Register, days to go: '</span> + ALLTRIM<span style="color: #000000;">(</span>STR<span style="color: #000000;">(</span>nDays<span style="color: #000000;">)</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">OF</span> oWnd ; <br /> <span style="color: #0000ff;">ACTION</span> RK_Register<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">25</span> <br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd ;<br /><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br />*************************************************<br /><br /><span style="color: #00C800;">FUNCTION</span> RK_LoadVariables<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />*all variables are saved in a .plist file<br />*date: <span style="color: #000000;">13</span><span style="color: #000000;">-11</span><span style="color: #000000;">-2016</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oPList := TPList<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cVarFile <span style="color: #000000;">)</span><br /> cRegKey := oPList:<span style="color: #000000;">GetItemByName</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">'RegistrationKey'</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span><br /><br />*************************************************<br /><br /><span style="color: #00C800;">FUNCTION</span> RK_SaveVariables<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />*all variables are saved in a .plist file<br />*date: <span style="color: #000000;">13</span><span style="color: #000000;">-11</span><span style="color: #000000;">-2016</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oPList := TPList<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> cVarFile <span style="color: #000000;">)</span><br /><br /> oPList:<span style="color: #000000;">SetItemByName</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">'RegistrationKey'</span>, cRegKey, .T. <span style="color: #000000;">)</span><br /> <br /><span style="color: #00C800;">RETURN</span><br /><br />*************************************************<br /><br /><span style="color: #00C800;">FUNCTION</span> RK_CheckKey<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />*<span style="color: #0000ff;">to</span> check the registration key<br />*date: <span style="color: #000000;">15</span><span style="color: #000000;">-11</span><span style="color: #000000;">-2016</span><br /><br /><span style="color: #00C800;">LOCAL</span> cMacAdres<br /><span style="color: #00C800;">LOCAL</span> cCode1 := <span style="color: #ff0000;">''</span>, cCode2 := <span style="color: #ff0000;">''</span>, dDate<br /><span style="color: #00C800;">LOCAL</span> nVersion := <span style="color: #000000;">0</span><br /><br /><span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">(</span>cRegKey<span style="color: #000000;">)</span> == <span style="color: #000000;">0</span> && <span style="color: #00C800;">if</span> there is not a registration yet<br /> cRegKey := <span style="color: #ff0000;">'#'</span>+DtoC<span style="color: #000000;">(</span>Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">'1'</span><br /> <span style="color: #00C800;">RETURN</span> .F.<br />ELSEIF <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKey,<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span><span style="color: #000000;">)</span> == <span style="color: #ff0000;">'#'</span> && <span style="color: #00C800;">if</span> first opening is more than <span style="color: #000000;">30</span> days ago, this is not working correct....<br /> dDate := CToD<span style="color: #000000;">(</span><span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKey, <span style="color: #000000;">2</span>, <span style="color: #000000;">8</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> nDays := nDays-<span style="color: #000000;">(</span>DATE<span style="color: #000000;">(</span><span style="color: #000000;">)</span>-dDate<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> .F.<br /><span style="color: #00C800;">ELSE</span> && check <span style="color: #00C800;">if</span> the key is correct<br /> cMacAdres := GetMacAddress<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> cCode1 := <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cMacAdres, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span><span style="color: #000000;">)</span> + <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cMacAdres, <span style="color: #000000;">4</span>, <span style="color: #000000;">2</span><span style="color: #000000;">)</span><br /> cCode2 := <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cMacAdres, <span style="color: #000000;">7</span>, <span style="color: #000000;">2</span><span style="color: #000000;">)</span> + <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cMacAdres,<span style="color: #000000;">10</span>, <span style="color: #000000;">2</span><span style="color: #000000;">)</span><br /> cRegKode1 := <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKey, <span style="color: #000000;">1</span>,<span style="color: #000000;">1</span><span style="color: #000000;">)</span> + <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKey, <span style="color: #000000;">3</span>,<span style="color: #000000;">1</span><span style="color: #000000;">)</span> + <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKey, <span style="color: #000000;">5</span>,<span style="color: #000000;">1</span><span style="color: #000000;">)</span> + <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKey, <span style="color: #000000;">7</span>,<span style="color: #000000;">1</span><span style="color: #000000;">)</span><br /> cRegKode2 := <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKey, <span style="color: #000000;">9</span>,<span style="color: #000000;">1</span><span style="color: #000000;">)</span> + <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKey, <span style="color: #000000;">11</span>,<span style="color: #000000;">1</span><span style="color: #000000;">)</span> + <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKey, <span style="color: #000000;">13</span>,<span style="color: #000000;">1</span><span style="color: #000000;">)</span> + <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKey, <span style="color: #000000;">15</span>,<span style="color: #000000;">1</span><span style="color: #000000;">)</span><br /> nVersion := VAL<span style="color: #000000;">(</span><span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKey,<span style="color: #000000;">16</span>,<span style="color: #000000;">1</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> cRegKode7 := CHR<span style="color: #000000;">(</span><span style="color: #0000ff;">ASC</span><span style="color: #000000;">(</span><span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKey, <span style="color: #000000;">2</span>, <span style="color: #000000;">1</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>- nVersion<span style="color: #000000;">)</span> + ;<br /> CHR<span style="color: #000000;">(</span><span style="color: #0000ff;">ASC</span><span style="color: #000000;">(</span><span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKey, <span style="color: #000000;">4</span>, <span style="color: #000000;">1</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>+ nVersion<span style="color: #000000;">)</span> + ;<br /> CHR<span style="color: #000000;">(</span><span style="color: #0000ff;">ASC</span><span style="color: #000000;">(</span><span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKey, <span style="color: #000000;">6</span>, <span style="color: #000000;">1</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>- nVersion-nVersion<span style="color: #000000;">)</span> + ;<br /> CHR<span style="color: #000000;">(</span><span style="color: #0000ff;">ASC</span><span style="color: #000000;">(</span><span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKey, <span style="color: #000000;">8</span>, <span style="color: #000000;">1</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>+ nVersion+nVersion<span style="color: #000000;">)</span><br /> cRegKode8 := CHR<span style="color: #000000;">(</span><span style="color: #0000ff;">ASC</span><span style="color: #000000;">(</span><span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKey, <span style="color: #000000;">10</span>, <span style="color: #000000;">1</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>- nVersion<span style="color: #000000;">)</span> + ;<br /> CHR<span style="color: #000000;">(</span><span style="color: #0000ff;">ASC</span><span style="color: #000000;">(</span><span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKey, <span style="color: #000000;">12</span>, <span style="color: #000000;">1</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>+ nVersion<span style="color: #000000;">)</span> + ;<br /> CHR<span style="color: #000000;">(</span><span style="color: #0000ff;">ASC</span><span style="color: #000000;">(</span><span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKey, <span style="color: #000000;">14</span>, <span style="color: #000000;">1</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>- nVersion-nVersion<span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">IF</span> hb_HexToNum<span style="color: #000000;">(</span>cCode1<span style="color: #000000;">)</span>+hb_HexToNum<span style="color: #000000;">(</span>cRegKode1<span style="color: #000000;">)</span> == <span style="color: #000000;">65535</span> .AND. hb_HexToNum<span style="color: #000000;">(</span>cCode2<span style="color: #000000;">)</span>+hb_HexToNum<span style="color: #000000;">(</span>cRegKode2<span style="color: #000000;">)</span> == <span style="color: #000000;">65535</span> .AND. cRegKode7 + cRegKode8 == <span style="color: #ff0000;">'PLANTEN'</span><br /> <br /> <span style="color: #00C800;">RETURN</span> .T.<br /> <span style="color: #00C800;">ELSE</span><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">'The registration code you have entered is not correct,'</span>+CR_LF+<span style="color: #ff0000;">'Please inform us'</span>+CR_LF+ <span style="color: #ff0000;">'You can do this via <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->.'</span>, <span style="color: #ff0000;">'error'</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">RETURN</span> .F.<br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span> .F.<br /><br />*************************************************<br /><br /><span style="color: #00C800;">FUNCTION</span> RK_Register<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oDlg, oGet1, oGet2, cGet3:=<span style="color: #ff0000;">''</span>, cGet4:=<span style="color: #ff0000;">''</span>, cGet5:=<span style="color: #ff0000;">''</span>, cGet6:= <span style="color: #ff0000;">''</span><br /><br /> <span style="color: #00C800;">LOCAL</span> cMacAdres := GetMacAddress<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> cCode1 := <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cMacAdres, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span><span style="color: #000000;">)</span> + <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cMacAdres, <span style="color: #000000;">4</span>, <span style="color: #000000;">2</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> cCode2 := <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cMacAdres, <span style="color: #000000;">7</span>, <span style="color: #000000;">2</span><span style="color: #000000;">)</span> + <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cMacAdres,<span style="color: #000000;">10</span>, <span style="color: #000000;">2</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"registration code"</span> PANELED <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">400</span><br /> <br /> @ <span style="color: #000000;">200</span>, <span style="color: #000000;">100</span> <span style="color: #0000ff;">GET</span> oGet1 <span style="color: #0000ff;">VAR</span> cCode1 <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">75</span>, <span style="color: #000000;">25</span><br /> @ <span style="color: #000000;">200</span>, <span style="color: #000000;">200</span> <span style="color: #0000ff;">GET</span> oGet2 <span style="color: #0000ff;">VAR</span> cCode2 <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">75</span>, <span style="color: #000000;">25</span><br /><br /><br /> @ <span style="color: #000000;">100</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">GET</span> oGet3 <span style="color: #0000ff;">VAR</span> cGet3 <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">75</span>, <span style="color: #000000;">25</span><br /> @ <span style="color: #000000;">100</span>, <span style="color: #000000;">90</span> <span style="color: #0000ff;">GET</span> oGet4 <span style="color: #0000ff;">VAR</span> cGet4 <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">75</span>, <span style="color: #000000;">25</span><br /> @ <span style="color: #000000;">100</span>, <span style="color: #000000;">170</span> <span style="color: #0000ff;">GET</span> oGet5 <span style="color: #0000ff;">VAR</span> cGet5 <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">75</span>, <span style="color: #000000;">25</span><br /> @ <span style="color: #000000;">100</span>, <span style="color: #000000;">250</span> <span style="color: #0000ff;">GET</span> oGet6 <span style="color: #0000ff;">VAR</span> cGet6 <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">75</span>, <span style="color: #000000;">25</span><br /> <br /> @ <span style="color: #000000;">23</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"OK"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span>cRegKey := cGet3+cGet4+cGet5+cGet6, <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span>RK_CheckKey<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">'The entered key is correct, close program to continue'</span><span style="color: #000000;">)</span>, <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">'Wrong key'</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span>;<br /> <span style="color: #0000ff;">VALID</span> RK_SaveVariables<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br />*************************************************<br /> </div>[/code:mtcn043j]
To use this protection the buyer of the program must ask a registration key by me. I have a small program to calculate the registration key. Here is the code for that.
[code=fw:mtcn043j]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveMac.ch"</span><br /><br /><span style="color: #B900B9;">/*<br />This function is to make a registration code that users can put in there app, so it functions well.<br />use this sample together with the registration_test.prg.<br />The radiobuttons I use for different versions of the program, PRO has more options than Standard.....<br /><br />Created by René Koot, 15-11-2016<br />*/</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd, oRad, nRad := <span style="color: #000000;">2</span><br /> <span style="color: #00C800;">local</span> cGet1 := <span style="color: #ff0000;">''</span>, cGet2 := <span style="color: #ff0000;">''</span>, cGet3 := <span style="color: #ff0000;">''</span><br /><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"creating registration code"</span> PANELED <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">400</span>, <span style="color: #000000;">400</span><br /> <br /> @ <span style="color: #000000;">300</span>, <span style="color: #000000;">100</span> <span style="color: #0000ff;">GET</span> cGet1 <span style="color: #0000ff;">of</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">75</span>, <span style="color: #000000;">25</span><br /> @ <span style="color: #000000;">300</span>, <span style="color: #000000;">200</span> <span style="color: #0000ff;">GET</span> cGet2 <span style="color: #0000ff;">of</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">75</span>, <span style="color: #000000;">25</span><br /><br /> @ <span style="color: #000000;">250</span>, <span style="color: #000000;">130</span> <span style="color: #0000ff;">RADIO</span> oRad <span style="color: #0000ff;">VAR</span> nRad <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"Standard"</span>, <span style="color: #ff0000;">"PRO"</span>, <span style="color: #ff0000;">"PRO[+]"</span> <span style="color: #000000;">}</span> <span style="color: #0000ff;">OF</span> oWnd<br /><br /> @ <span style="color: #000000;">100</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">GET</span> oGet3 <span style="color: #0000ff;">VAR</span> cGet3 <span style="color: #0000ff;">of</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>, <span style="color: #000000;">25</span><br /> <br /> @ <span style="color: #000000;">23</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Create"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> RK_MakeRegistrationCode<span style="color: #000000;">(</span> cGet1, cGet2, nRad <span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">23</span>, <span style="color: #000000;">120</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Cancel"</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">ACTION</span> oWnd:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br />*************************************************<br /><br /><span style="color: #00C800;">FUNCTION</span> RK_MakeRegistrationCode<span style="color: #000000;">(</span>cCode1, cCode2, nRad<span style="color: #000000;">)</span><br /><br />*<span style="color: #00C800;">for</span> creating the registration code<br />*date: <span style="color: #000000;">15</span><span style="color: #000000;">-11</span><span style="color: #000000;">-2016</span><br /><br /><span style="color: #00C800;">LOCAL</span> aLet := <span style="color: #000000;">{</span><span style="color: #ff0000;">'P'</span>, <span style="color: #ff0000;">'L'</span>, <span style="color: #ff0000;">'A'</span>, <span style="color: #ff0000;">'N'</span>, <span style="color: #ff0000;">'T'</span>, <span style="color: #ff0000;">'E'</span>, <span style="color: #ff0000;">'N'</span><span style="color: #000000;">}</span> &&you can <span style="color: #0000ff;">change</span> this array, but use the same array in your program<br /><span style="color: #00C800;">LOCAL</span> cRegKode1 := hb_NumToHex<span style="color: #000000;">(</span><span style="color: #000000;">65535</span> - hb_HexToNum<span style="color: #000000;">(</span>cCode1<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> cRegKode2 := hb_NumToHex<span style="color: #000000;">(</span><span style="color: #000000;">65535</span> - hb_HexToNum<span style="color: #000000;">(</span>cCode2<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> cRegKode3 := <span style="color: #ff0000;">''</span><br /><span style="color: #00C800;">LOCAL</span> cRegKode4 := <span style="color: #ff0000;">''</span><br /><span style="color: #00C800;">LOCAL</span> cRegKode5 := <span style="color: #ff0000;">''</span><br /><span style="color: #00C800;">LOCAL</span> cRegKode6 := <span style="color: #ff0000;">''</span><br /><br /><span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">(</span>cRegkode1<span style="color: #000000;">)</span> == <span style="color: #000000;">3</span><br /> cRegkode1 := <span style="color: #ff0000;">'0'</span> + cRegkode1<br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">(</span>cRegkode2<span style="color: #000000;">)</span> == <span style="color: #000000;">3</span><br /> cRegkode2 := <span style="color: #ff0000;">'0'</span> + cRegkode2<br /><span style="color: #00C800;">ENDIF</span><br /><br />cRegKode3 := <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKode1, <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span><span style="color: #000000;">)</span> + CHR<span style="color: #000000;">(</span><span style="color: #0000ff;">ASC</span><span style="color: #000000;">(</span>aLet<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>+ nRad<span style="color: #000000;">)</span> + <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKode1, <span style="color: #000000;">2</span>, <span style="color: #000000;">1</span><span style="color: #000000;">)</span> + CHR<span style="color: #000000;">(</span><span style="color: #0000ff;">ASC</span><span style="color: #000000;">(</span>aLet<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>- nRad<span style="color: #000000;">)</span><br />cRegKode4 := <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKode1, <span style="color: #000000;">3</span>, <span style="color: #000000;">1</span><span style="color: #000000;">)</span> + CHR<span style="color: #000000;">(</span><span style="color: #0000ff;">ASC</span><span style="color: #000000;">(</span>aLet<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>+ nRad+nRad<span style="color: #000000;">)</span> + <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKode1, <span style="color: #000000;">4</span>, <span style="color: #000000;">1</span><span style="color: #000000;">)</span> + CHR<span style="color: #000000;">(</span><span style="color: #0000ff;">ASC</span><span style="color: #000000;">(</span>aLet<span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>- nRad-nRad<span style="color: #000000;">)</span><br />cRegKode5 := <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKode2, <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span><span style="color: #000000;">)</span> + CHR<span style="color: #000000;">(</span><span style="color: #0000ff;">ASC</span><span style="color: #000000;">(</span>aLet<span style="color: #000000;">[</span><span style="color: #000000;">5</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>+ nRad<span style="color: #000000;">)</span> + <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKode2, <span style="color: #000000;">2</span>, <span style="color: #000000;">1</span><span style="color: #000000;">)</span> + CHR<span style="color: #000000;">(</span><span style="color: #0000ff;">ASC</span><span style="color: #000000;">(</span>aLet<span style="color: #000000;">[</span><span style="color: #000000;">6</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>- nRad<span style="color: #000000;">)</span><br />cRegKode6 := <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKode2, <span style="color: #000000;">3</span>, <span style="color: #000000;">1</span><span style="color: #000000;">)</span> + CHR<span style="color: #000000;">(</span><span style="color: #0000ff;">ASC</span><span style="color: #000000;">(</span>aLet<span style="color: #000000;">[</span><span style="color: #000000;">7</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span>+ nRad+nRad<span style="color: #000000;">)</span> + <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">(</span>cRegKode2, <span style="color: #000000;">4</span>, <span style="color: #000000;">1</span><span style="color: #000000;">)</span> + ALLTRIM<span style="color: #000000;">(</span>STR<span style="color: #000000;">(</span>nRad<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /><br />oGet3:<span style="color: #000000;">SetText</span><span style="color: #000000;">(</span>cRegKode3 + <span style="color: #ff0000;">' '</span> + cRegKode4 + <span style="color: #ff0000;">' '</span> + cRegKode5 + <span style="color: #ff0000;">' '</span> + cRegKode6<span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:mtcn043j]
I hope this code is useful
Rene |
protecting an app for illigal copying | René,
Many thanks for this great contribution <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Do you mean here in your code ?
nDays := nDays-(DATE()-dDate)
what number do you get ? |
protecting an app for illigal copying | I like protecting method of Easyreport, Refer original source code of EasyReport |
protecting an app for illigal copying | Hello Antonio,
Yes, there is the problem. I was expecting the number of days different between those dates, but i get a number like 36498. That is also not seconds of days....
Rene |
protecting an app for illigal copying | René,
Please check those values:
MsgInfo( nDays, ValType( nDays ) )
MsgInfo( dDate, ValType( dDate ) )
nDays := nDays-(DATE()-dDate) |
protecting an app for illigal copying | Hello Antonio,
Both var give D as Valtype. The problem is solved by adding this setting at the top of the program:
SET DATE FORMAT TO 'dd-mm-yyyy'
Now I can calculate with the dates. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
René |
protecting an app for illigal copying | very good <!-- s;-) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";-)" title="Wink" /><!-- s;-) --> |
protection EXE file | Hi All !
The EXE file produced by Borland or MSVC is stand alone EXE without any dll.
The application installed by installer is good way for the first time.
But when the application installed move again to another computer, this is ilegal copy.
How to make EXE file can't be copy to another ?
Best Regard
Areang |
protection EXE file | Areang,
You can try my KeyGen.obj
Basically you give them a software "key". Then you can verify the "key" to make sure they do not install the software on other computers.
(Instructions Below)
You can download it at:
<!-- m --><a class="postlink" href="http://hyperupload.com/download/020e7f0246/KeyGen32.obj.html">http://hyperupload.com/download/020e7f0 ... 2.obj.html</a><!-- m -->
Hope This helps,
Jeff
[code:3vc86qd3]Useage: MakeKey( nKey, nLicense )
nKey is your "secret key"
nLicense is the number of licenses the end user has purchased
this is a number that can be extracted by GetLicense()
Example: We will use 581 as our "secret key"
We will give the end user 5 licenses
cKey := MakeKey( 581, 5 )
If the Hard Drive Serial Number is: 123456789
cKey will be: 986-3266501-3064-26145
cKey is the number you give the end user to "unlock"
your software.
Useage: MakeKey()
If you use MakeKey() without any parameters you will be prompted
to enter nKey, Hard Drive Serial Number and nLicense.
The the cKey will be displayed via MsgInfo()
The "Hard Drive Serial Number", "Generated Key" and "Number of Licenses" will also
be copied into the Clipboard.
Useage: GetLicense( nKey, cKey )
nKey is the "Secret Key" you used in MakeKey()
cKey is the string returned by MakeKey()
Example: We will use 581 as our "secret key"
cKey will be: 986-3266501-3064-26145 (see example above)
nLicense := GetLicense(581, "986-3266501-3064-26145" )
This will determine the Hard Drive Serial Number and using
the parameters provided, will return the number of licenses
that were encoded when you used MakeKey()
So, if the Hard Drive Serial Number is 123456789
nKey is 581 and
cKey is 986-3266501-3064-26145
nLicense = 5
Useage: VerifyKey( nKey, cKey)
nKey is the "Secret Key" you used in MakeKey()
cKey is the string returned by MakeKey()
Example: We will use 581 as our "secret key"
cKey will be: 986-3266501-3064-26145 (see example above)
IF VerifyKey( 581, "986-3266501-3064-26145" )
MsgInfo("Valid Key...")
ELSE
MsgInfo("Invalid Key...")
ENDIF
Useage: GetSecretKey( nSerial, cKey )
WARNING: Run this function without other programs running. It uses as much of the
CPU as it can and depending on your "Secret Key" may take a LONG TIME to
complete its calculations before you are given your "Secret Key"
(it is slow, but atleast you now can get your "Secret Key" if you forget it)
nSerial is the serial number used to make cKey
cKey is the string returned by MakeKey()
Example:
nSerial = 123456789
cKey = 986-3266501-3064-26145 (see example above)
cSecret := GetSecretKey( 123456789, "986-3266501-3064-26145" )
cSecret wil be 581
NOTES: 1. The value returned by MakeKey() should be stored on the end users
system and a check [ VerifyKey() ] should be done to determine if
the user has a valid installation.
2. If you need to change the amount of licenses, you will need to
generate a new Key. [ MakeKey() ]
3. This library only gives you "a number" for licenses, it will not
limit the end user ... This is left up to you, the programmer.
So the value returned from GetLicense() should be used to limit
connections to the program. (This is mainly for networked systems)
If you are not worried about licenses then you can use this as a
secondary "Secret Key", however you MUST supply a value.
4. The only function that can be used without any parameters is
MakeKey(), you MUST supply the parameters for the other functions.
5. The "Secret Key" must not be zero, this may cause problems.[/code:3vc86qd3] |
protection EXE file | Jeff,
Thanks for reply.
Do you mind to send me a small application with source code ?
Best Regard
Areang |
protection EXE file | Hi Jeff
A good solution.
[quote:3qiz306u]If the Hard Drive Serial Number is: 123456789[/quote:3qiz306u]
Is it Hard Drive Serial No. ?
or
Volume Serial Number like the following one
Volume in drive C is 80GB_C
Volume Serial Number is 0C2E-1CE6
Directory of C:\
If it is Hard Drive Serial No., How do we get it (is there any function
that returns Hard Drive Serial No. automatically) ?
When I supplied 0C2E-1CE6 as 2nd parameter to makekey() ,
It is returning '0' as serial no.
Regards
Ramesh Babu P |
protection EXE file | It uses hard drive serial number.
nSerialHD()
Hope this helps,
Jeff |
protection EXE file | Hi Jeff
Thank you very much for quick reply.
Now your solution to the problem in subject is complete.
Regards
- Ramesh Babu P |
protection EXE file | [quote="RAMESHBABU":36974ymf]Hi Jeff
Thank you very much for quick reply.
Now your solution to the problem in subject is complete.
Regards
- Ramesh Babu P[/quote:36974ymf]
reference the web link:
<!-- m --><a class="postlink" href="http://www4.zzz.com.tw/phpbb2/viewtopic.php?t=26">http://www4.zzz.com.tw/phpbb2/viewtopic.php?t=26</a><!-- m -->
You can get HDD Lower level serial-number!! |
protection EXE file | Hi ssbbs
Posting in Fivewin, Taiwan forum are very Interesting!.
Regards,
- Ramesh Babu P |
protection EXE file | Hi Mr.Antonio
I need few clarifications in respect of nSerialHd()
This is the code I used for testing nSerialHd().
[quote:29tk280w]
#include "fivewin.ch"
FUNCTION Main()
LOCAL cSerialNos := "", cDrive, n, nSerial, aDrives
cSerialNos += "Default Drive Serial No."+STR(nSerialHD())+CRLF+CRLF
aDrives := aDrives()
FOR n = 1 TO LEN(aDrives)
cDrive := aDrives[n]
nSerial := LTRIM(STR(nSerialHD( cDrive )))
IF cDrive == "A:"
IF IsDiskette()
cSerialNos += "Drive "+cDrive+" Serial No."+LTRIM(STR(nSerialA()) )+CRLF
ELSE
cSerialNos += "Drive "+cDrive+" Serial No."+LTRIM(STR(nSerialA()) )+" ( No Floppy Present in Drive )"+CRLF
ENDIF
ELSE
IF !IsCdRom(cDrive)
cSerialNos += "Drive "+cDrive+" Serial No."+nSerial + CRLF
ELSE
cSerialNos += "Drive "+cDrive+" is a CD Rom Drive"+CRLF
ENDIF
ENDIF
NEXT
MsgInfo(cSerialNos)
RETURN nil
[/quote:29tk280w]
And following is the output generated by above program.
[url=http://img141.imageshack.us/my.php?image=hddslno1zb8.png:29tk280w][img:29tk280w]http://img141.imageshack.us/img141/5077/hddslno1zb8.th.png[/img:29tk280w][/url:29tk280w]
The return value of nSerialHd() is exactly what?
a) Wether is the actual serial number printed on the Hard Disk Drive,
b) Or it is a number generated by the OS ?
c) Will it change when the Hard Disk Drive is formatted ?
d) What are these numbers when called nSerialHd() without any parameter and
when called with nSerialHd("C:"), nSerialHd("D:") and so on...
I have checked another library called "smart.lib" ( the link is provided in this topic itself )
I am getting the following output.
[url=http://img96.imageshack.us/my.php?image=hddslno2ca6.png:29tk280w][img:29tk280w]http://img96.imageshack.us/img96/4421/hddslno2ca6.th.png[/img:29tk280w][/url:29tk280w]
When I compared Serial No., Model No. and Firmware shown in the above output, they are exactly the same printed on
the Hard Disk Drive.
Kindly clarify the points from a to d.
Regards to you
- Ramesh Babu P[code:29tk280w][/code:29tk280w][code:29tk280w][/code:29tk280w] |
protection EXE file | [quote="RAMESHBABU":28nwtzq9]The return value of nSerialHd() is exactly what?[/quote:28nwtzq9]
It is the volume serial number generated by the OS (check console VOL command that is in hex).
[quote="RAMESHBABU":28nwtzq9]c) Will it change when the Hard Disk Drive is formatted ?[/quote:28nwtzq9]
Yes.
EMG |
protection EXE file | Hi ssbbs
Thank you very much for your "SMART.LIB".
I need some guidance from you.
[quote:2hy9d6xb]nRet := SmartFindATADisk(255)[/quote:2hy9d6xb]
is returning the correct number of ATA Disks fixed in the Computer System.
[quote:2hy9d6xb]aData := SmartIdentify(0)[/quote:2hy9d6xb]
is holding the information about Model No, Serial No. and Firmware
As you said the '0' parameter used in SmartIdentify indicates `C Drive`.
Is it `C` Drive or 1st or Default Hard Disk?
And I want to know How to get the information abount the 2nd and other Hard disks fixed in the System.
When I tested like
aData1 := SmartIdentify(1)
aData1 is holding the same information of "aData := SmartIdentify(0)"
Please guide me how to get the information of 2nd and ... hard disks.
Regards to you,
- Ramesh Babu P |
protection EXE file | Hello Mr.Enrico
Thank you very much for your quick reply.
Your guidence is always very useful to me in particular and all of us in general. Keep it up
Regards to you
- Ramesh Babu P |
protection EXE file | Hi Rameshbabu,
if you knew a serial number of hardisk, so you can write on your application like this :
e.g
if nSerialHd() == "316371276"
MsgAlert("yes, go to application")
else
MsgAlert("No, you don't to continue..")
endif
by the ghost application from Simanthec, can duplicate your hardisk serial number.
If you want to protect your EXE file, good way by motherboard serial number or information from BIOS of CMOS .
Best Regard
Areang |
protection EXE file | Mr.Areang
Thanks for your suggestion.
The method we were discussing above is one among many ways to
protect the piracy to some extent (not fully!).
By the way do you any functions which can return the information about
"motherboard serial number or information from BIOS of CMOS ."
Regards to you
- Ramesh Babu P |
protection EXE file | I will send you by your private email
Areang |
protection EXE file | I always use the function GetNetCardID(), which gives Mac address of the ethernet card to protec my EXE
[code:2sotrni6]
if GetNetCardID() <> 'XXXXXXX'
MsgInfo('This Computer is not licensed')
endif
[/code:2sotrni6] |
protection EXE file | Hi betoncu
[quote:3c2sfgme]
if GetNetCardID() <> 'XXXXXXX'
MsgInfo('This Computer is not licensed')
endif
[/quote:3c2sfgme]
This is useful only when the user has an eithernet card in his P.C
and to control multi-user applications. It may not be useful for stand
alone applications.
If the user has several eithernet cards in his P.C ?
or
If he keep changing his eithernet cards frequently ?
Regards to you
- Ramesh Babu P |
protection EXE file | Dear Ramesh,
Nowadays each computer has an ethernet card embedded on the main board.
If your customer changes the main board he will need another exe from you. But don't forget that he can change the harddisk also.
If there are two ethernet cards?
May be you are right here. I haven't check this function on a computer which has two ethernet cards. So I don't know.
Regards,
Birol Betoncu |
protection EXE file | Amiguinhos
O modulo aqui apresentado permite colocar em seus sistemas uma forma profissional de registro de uso do sistema.
É composto por um código que deve ser colocado em sua aplicação para interagir com o modulo e finalmente um modulo a parte que serve para registrar a aplicação.
No que consiste?
A aplicação, ao abrir fará uma verificação do registro e se o mesmo ainda não estiver gravado no mesmo fará a chamada ao modulo de registro.
O modulo de registro permitira que o usuario rode a demonstração do aplicativo que tem um prazo prédefinido na variavel MAXDAYS e verificado pela função MAXTRIAL.
Caso o registro seja efetivado com exito toda informação de registro sera grafada, isto mesmo, grafada dentro do aplicativo, nada de uso de arquivos externos.
A rotina funcionou muito bem com BLinker sem compressão e Harbour.
O modulo de registro é composto por um .RC que contem a definição da DIALOG de registro e um .PRG contendo o código.
Arquivo REGISTRO.RC
[code:loxv1ycw]
registro DIALOG 77, 49, 211, 175
STYLE 0x4L | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX
CAPTION "Acesso ao sistema"
FONT 8, "MS Sans Serif"
{
EDITTEXT 103, 98, 130, 102, 12, ES_UPPERCASE | WS_BORDER | WS_TABSTOP
PUSHBUTTON "C&onfirma", 201, 5, 157, 64, 14
PUSHBUTTON "&Cancela", 203, 76, 157, 62, 14
PUSHBUTTON "Demonstração", 204, 145, 157, 62, 14
EDITTEXT 101, 98, 113, 102, 12, ES_UPPERCASE | ES_READONLY | WS_BORDER | WS_TABSTOP
LTEXT "", 98, 311, 21, 98, 148, NOT WS_GROUP
ICON "icon_Chaves", -1, 8, 9, 21, 20
LTEXT "Este aplicativo está em MODO DEMONSTRAÇÃO.", 90, 35, 9, 170, 18
GROUPBOX "", -1, 5, 101, 202, 50, BS_GROUPBOX
CONTROL "", 97, "static", SS_BLACKRECT | WS_CHILD | WS_VISIBLE, 219, 3, 202, 66
LTEXT "Número de Série:", 95, 12, 115, 60, 8
LTEXT "Código de Liberação:", 96, 12, 131, 72, 8
LTEXT "Para avaliar a Versão de Demonstração clique no botão Demonstração.", 91, 35, 27, 170, 18
LTEXT "Registre o programa e receba o Código de Liberação para utilizar o produto completo.", 92, 35, 55, 170, 18
LTEXT "Entre em contato com o suporte através do telefone (11) 3903-4461", 93, 35, 84, 170, 18
}
icon_Chaves ICON
{
'00 00 01 00 01 00 20 20 10 00 00 00 00 00 E8 02'
'00 00 16 00 00 00 28 00 00 00 20 00 00 00 40 00'
'00 00 01 00 04 00 00 00 00 00 80 02 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 80 00 00 80 00 00 00 80 80 00 80 00'
'00 00 80 00 80 00 80 80 00 00 80 80 80 00 C0 C0'
'C0 00 00 00 FF 00 00 FF 00 00 00 FF FF 00 FF 00'
'00 00 FF 00 FF 00 FF FF 00 00 FF FF FF 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 08 80 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 F8 78 00 00 00 00 00 00 00 00 00 00'
'00 08 80 07 08 78 00 00 00 00 00 00 00 00 00 00'
'07 78 88 00 78 78 00 00 00 00 00 00 00 00 00 00'
'07 F8 78 7F 88 78 00 00 00 00 00 00 70 00 00 00'
'07 F8 78 07 F8 78 00 00 00 00 00 07 B3 30 00 00'
'00 08 78 0F 08 78 00 00 00 00 07 00 BB 70 00 00'
'00 78 78 00 78 78 00 00 00 00 73 3B B7 00 00 00'
'7F 88 78 7F 88 78 00 00 00 00 7B BB 70 30 00 00'
'07 F8 78 7F 88 78 00 00 00 70 0B B7 03 00 00 00'
'00 08 78 07 F8 78 00 00 07 33 BB 70 30 00 00 00'
'00 78 78 07 F8 77 00 00 7B BB B7 03 00 00 00 00'
'7F 88 78 7F 88 F7 00 00 7B BB 70 30 00 00 00 00'
'7F 88 77 F8 8F 88 70 00 BB B7 03 00 00 00 00 00'
'07 F8 7F 88 F0 00 00 0B BB 70 30 00 00 00 00 00'
'07 F7 F8 80 07 77 77 7B B7 03 00 00 00 00 00 00'
'7F 7F 88 07 7B BB BB BB 70 30 00 00 00 00 00 07'
'F8 7F 80 7B BB BB BB B8 B3 00 00 00 00 00 00 7F'
'88 7F 80 BB BB 8B 8B 8B 83 00 00 00 00 00 07 F8'
'8F 7F 0B BB B0 B0 B8 B8 B3 00 00 00 00 00 7F 88'
'F8 7F 7B BB BB 0B 0B 8B 83 00 00 00 00 00 7F 88'
'8F 87 7B BB BB B0 B0 B8 B3 00 00 00 00 00 7F 88'
'F8 00 7B BB 77 0B 0B 0B 83 00 00 00 00 00 7F 88'
'80 7F 7B B0 F8 80 B0 B8 30 00 00 00 00 00 7F 88'
'F0 78 7B B0 0F 80 BB B8 30 00 00 00 00 00 07 F8'
'80 77 07 B0 07 F0 BB 83 00 00 00 00 00 00 00 7F'
'88 00 08 77 00 0B B3 30 00 00 00 00 00 00 00 07'
'FF F0 78 70 88 88 30 00 00 00 00 00 00 00 00 00'
'77 70 77 70 77 77 00 00 00 00 00 00 00 00 00 00'
'00 00 70 00 70 00 00 00 00 00 00 00 00 00 00 00'
'00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF F9'
'FF FF FF F0 FF FF FE 60 7F FF FC 00 7F FF F8 00'
'7F FF F8 00 7F F1 F8 00 7F E0 FC 00 7F 80 F8 00'
'7F 00 F0 00 7F 00 F8 00 7C 01 FC 00 78 03 F8 00'
'70 07 F0 00 70 0F F0 00 20 1F F8 00 00 3F F8 00'
'00 7F F0 00 00 FF E0 00 01 FF C0 00 01 FF 80 00'
'01 FF 00 00 01 FF 00 00 01 FF 00 00 01 FF 00 00'
'03 FF 00 00 03 FF 80 00 07 FF C0 00 0F FF E0 00'
'1F FF F0 10 7F FF FE 73 FF FF FF 07 FF FF'
}
[/code:loxv1ycw]
Codigo REGISTRO.PRG
[code:loxv1ycw]
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *
* Procedure_: REGISTRO.PRG
* Autor_____: Jose Carlos da Rocha - Konectiva Automacao
* Cria‡„o___: 13 de Dezembro de 2005
* Objetivo__: Pedir codigo de registro para habilitar aplicacao totalmente
* Rotina____: Executavel stand-alone chamado pelo aplicativo principal
* Direitos__: Qualquer alteração neste código pode ser feita deste que
* seja mantida a autoria principal.
* Alterado__: ___/___/____
* por_______: ___________________________________________
* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
function Main()
local oDlg, oGet, oText1, oText2
local nSerie := substr(HDSERIAL(),1,8)
local nLiberacao:= space(8)
SET _3DLOOK ON
DEFINE DIALOG oDlg NAME "registro" COLOR RGB(000,000,000),RGB(255,255,255)
REDEFINE SAY ID 90 OF oDlg COLOR RGB(000,000,000),RGB(255,255,255)
REDEFINE SAY ID 91 OF oDlg COLOR RGB(000,000,000),RGB(255,255,255)
REDEFINE SAY ID 92 OF oDlg COLOR RGB(000,000,000),RGB(255,255,255)
REDEFINE SAY ID 93 OF oDlg COLOR RGB(000,000,000),RGB(255,255,255)
REDEFINE SAY ID 95 OF oDlg COLOR RGB(000,000,000),RGB(255,255,255)
REDEFINE SAY ID 96 OF oDlg COLOR RGB(000,000,000),RGB(255,255,255)
// Altere os comandos WinExec para chamarem o seu aplicativo principal
REDEFINE BUTTON oBtn201 ID 201 OF oDlg ACTION ( PROTECT3(), WinExec( "NFWH.EXE" ), oDlg:End() )
REDEFINE BUTTON ID 203 OF oDlg ACTION oDlg:End()
REDEFINE BUTTON ID 204 OF oDlg ACTION ( WinExec( "NFWH.EXE demo" ), oDlg:End())
//
REDEFINE GET oText1 VAR nSerie ID 101 PICTURE "@!" OF oDlg COLOR RGB(255,255,255),RGB(000,000,255) NO MODIFY
REDEFINE GET oText2 VAR nLiberacao ID 103 PICTURE "@!" OF oDlg VALID lOkPassword(nLiberacao,nSerie,oBtn201)
ACTIVATE DIALOG oDlg CENTERED ON INIT (oBtn201:Disable(),oText2:SetFocus())
return nil
FUNCTION PROTECT3()
PRIVATE ARQ, BUFFERS, RET, PALAVRA, P, T, ARQUIVO1
SET CENTURY OFF
REGISTRO := "HDHDHDHDRBRBRBRB99999999YYYYYYYYYYYY"
HDSERIAL := SUBSTR(HDSERIAL(),1,8) // Serial do HD
MAXDAYS := "30" // Tempo maximo de DIAS de uso
ROMBIOS := "RBRBRB" // CheckSum da RomBios
MAXUSERS := "05" // Maximo de usuarios por sessao
MAXTRIAL := SUBSTR(STRTRAN(DTOC(MAXTRIAL(MAXDAYS)),'/',''),1,6) // Tempo maximo de uso
ARQUIVO1 := "NFWH.EXE" // Nome do aplicativo
PALAVRA := "KONECTIVA" // String a ser protegida ate 10 caracteres
PROTEGER := HDSERIAL+MAXDAYS+ROMBIOS+MAXUSERS+MAXTRIAL // Dados para serem armazenados
IF REPL("HD",4) $ REGISTRO
//MSGRUN( "Protegendo..." )
ARQ := FOPEN(ARQUIVO1,2)
IF FERROR() # 0
MSGRUN( "Erro na abertura do arquivo "+ARQUIVO1 )
QUIT
ENDIF
T = FSEEK(ARQ,0,2)
FSEEK(ARQ,0,0)
BUFFER := SPACE(512)
BUFFE0 := PROTEGER+SPACE(512-LEN(PROTEGER))
P := 0
FOR A = 1 TO 512
P := P + ASC(SUBS(SUBSTR(ROMBIOS+SPACE(12),1,12),A,1)) + A
NEXT
PALAVRA := ALLTRIM(PALAVRA)
PS := ACHOU(PALAVRA)
IF PS = 0
//MSGRUN( "String nao encontrada em "+ARQUIVO1 )
QUIT
ENDIF
BYTES1 := 0
FOR A = 1 TO 512
BYTES1 := BYTES1 + ASC(SUBS(BUFFE0,A,1)) + A
NEXT
IF ACHOU(REPL("HD",4)) = 0
//MSGRUN( "String de prote‡„o nao foi encontrada em "+ARQUIVO1 )
RETURN 0
ENDIF
L = AT("HDHD",BUFFER)
BUFFER1 := SUBS(PROTEGER+SPACE(24),1,24)+STRZERO(P,12)
BUFFER := STUFF(BUFFER,L,36,BUFFER1)
FSEEK(ARQ,-512,1)
FWRITE(ARQ,BUFFER)
FCLOSE(ARQ)
//MSGRUN( "Protegido... " )
//@ 4,0 SAY "Verifica‡„o conferida"
//INKEY(3)
ELSE
//MSGRUN( "Ambientando..." )
ARQUIVO := "NFWH.EXE"
HDSERIAL := SUBS(REGISTRO, 1, 8) // Serial do HD
MAXDAYS := VAL(SUBS(REGISTRO, 9, 2)) // Maximo de Dias
ROMBIOS := SUBS(REGISTRO,11, 6) // STR(ROMCKSUM(),8) // CheckSum da RomBios
MAXUSERS := VAL(SUBS(REGISTRO,17, 2)) // Maximo de usuarios por sessao
MAXTRIAL := CTOD(SUBS(REGISTRO,21, 2)+"/"+;
SUBS(REGISTRO,19, 2)+"/"+;
SUBS(REGISTRO,23, 2))
DESLOCA := VAL(SUBS(REGISTRO,25,12))
//
// -> Rotinas de verificacao de travas
IF HDSERIAL() <> HDSERIAL ; RETURN 1; ENDIF
IF ROMBIOS(ROMBIOS) <> ROMBIOS ; RETURN 2; ENDIF
IF MAXUSERS(MAXUSERS) > MAXUSERS ; RETURN 3; ENDIF
IF (MAXTRIAL() > MAXTRIAL+30) .OR. (MAXTRIAL > DATE()); RETURN 4; ENDIF
ENDIF
RETURN 0
FUNCTION HDSERIAL()
RETURN ALLTRIM(STR(nSerialHD()))
FUNCTION MAXUSERS(MAXUSERS)
RETURN 0
FUNCTION ROMBIOS(ROMBIOS)
RETURN ROMBIOS
FUNCTION MAXTRIAL(MAXDAYS)
RETURN date()+val(MAXDAYS)
FUNCTION ACHOU(PALAVRA)
PRIVATE Q
FSEEK(ARQ,0,0)
FOR Q = 0 TO T STEP + 512
FREAD(ARQ, @BUFFER, 512)
IF AT(PALAVRA, BUFFER) # 0
RETURN Q
ENDIF
NEXT
RETURN 0
FUNCTION lOkPassword(nLiberacao,nSerie)
if val(nLiberacao)+val(nSerie)=99999999
oBtn201:Enable()
else
oBtn201:Disable()
endif
return .t.
[/code:loxv1ycw]
A parte que vai dentro do aplicativo esta descrita abaixo:
function main(M_O_D_O) // Necessario receber este parametro
...
if M_O_D_O = NIL // Arqui o parametro sera criticado
PROTERRO := PROTECT3() // Funcao que verifica se o aplicativo foi registrado
IF PROTERRO > 0
IF PROTERRO = 1; PROTMENS := 'NAO REGISTRADO' ; WinExec( "REGISTRO.EXE" ); QUIT ; ENDIF
IF PROTERRO = 2; PROTMENS := 'ROMBIOS ERRADO' ; ENDIF
IF PROTERRO = 3; PROTMENS := 'MUITOS USUARIOS' ; ENDIF
IF PROTERRO = 4; PROTMENS := 'TEMPO ESTOURADO' ; ENDIF
CLEAR SCREEN
IF PROTERRO > 1
cMensa := OemToAnsi( "(****" + PROTMENS + "****)"+CRLF+CRLF+;
"Um erro grave ocorreu na inicializacao do sistema"+CRLF+;
"Favor entrar em contato com o:"+CRLF+;
"Suporte tecnico SuaEmpresa Ltda"+CRLF+;
" Telefones:"+CRLF+;
" Central: (0xx11) 9999-9999"+CRLF+;
" Email: <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->" )
MsgStop( cMensa )
QUIT
ENDIF
ENDIF
endif
...
Resto do codigo principal do aplicativo contendo Window, Menus, Buttons, etc
...
// Funcoes de critica do registro
FUNCTION PROTECT3()
PRIVATE ARQ, BUFFERS, RET, PALAVRA, P, T, ARQUIVO1
SET CENTURY OFF
REGISTRO := "HDHDHDHDRBRBRBRB99999999YYYYYYYYYYYY" // Nao altere este conteudo
HDSERIAL := SUBSTR(HDSERIAL(),1,8) // Serial do HD
MAXDAYS := "30" // Tempo maximo de DIAS de uso com no maximo 2 digitos
ROMBIOS := "RBRBRB" // CheckSum da RomBios, nunca modifique esta variavel
MAXUSERS := "05" // Maximo de usuarios por sessao
MAXTRIAL := SUBSTR(STRTRAN(DTOC(MAXTRIAL(MAXDAYS)),'/',''),1,6) // Tempo maximo de uso
// Altere estas 3 linhas com o nome de seu aplicativo principal
ARQUIVO1 := "NFWH.EXE" // Nome do aplicativo
PALAVRA := "KONECTIVA" // String a ser protegida
ARQUIVO := "NFWH.EXE"
//
PROTEGER := HDSERIAL+MAXDAYS+ROMBIOS+MAXUSERS+MAXTRIAL // Dados para serem armazenados
// Verifica a protecao
HDSERIAL := SUBS(REGISTRO, 1, 8) // Serial do HD
MAXDAYS := VAL(SUBS(REGISTRO, 9, 2)) // Maximo de Dias
ROMBIOS := SUBS(REGISTRO,11, 6) // STR(ROMCKSUM(),8) // CheckSum da RomBios
MAXUSERS := VAL(SUBS(REGISTRO,17, 2)) // Maximo de usuarios por sessao
MAXTRIAL := CTOD(SUBS(REGISTRO,21, 2)+"/"+;
SUBS(REGISTRO,19, 2)+"/"+;
SUBS(REGISTRO,23, 2))
DESLOCA := VAL(SUBS(REGISTRO,25,12))
//
// -> Rotinas de verificacao de travas
IF HDSERIAL() <> HDSERIAL ; RETURN 1; ENDIF
IF ROMBIOS(ROMBIOS) <> ROMBIOS ; RETURN 2; ENDIF
IF MAXUSERS(MAXUSERS) > MAXUSERS ; RETURN 3; ENDIF
IF DATE() > MAXTRIAL ; RETURN 4; ENDIF
RETURN 0
FUNCTION HDSERIAL()
RETURN ALLTRIM(STR(nSerialHD()))
FUNCTION MAXUSERS(MAXUSERS)
RETURN 0
FUNCTION ROMBIOS(ROMBIOS)
RETURN ROMBIOS
FUNCTION MAXTRIAL(MAXDAYS)
RETURN date()+val(MAXDAYS)
FUNCTION ACHOU(PALAVRA)
PRIVATE Q
FSEEK(ARQ,0,0)
FOR Q = 0 TO T STEP + 512
FREAD(ARQ, @BUFFER, 512)
IF AT(STRING, BUFFER) # 0
RETURN Q
ENDIF
NEXT
RETURN 0
Estas rotinas poderão ser usadas também em aplicativos DOS bastando modificar o codigo do REGISTRO.EXE retirando o que for referente ao FIVEWIN.
Uma vez gravada a informação de registro o aplicativo sera executado somente na maquina em que foi instalado. se por acaso for copiado ele não executara mais.
Portanto após compilar o aplicativo o mesmo já deve ser empacotado para entrega/instalação, pois se for executado não rodará na maquina do cliente.
As funções trabalham com o numero serial do hd em que foram instalados e portanto para saber qual o codigo de liberação para este exemplo basta calcular:
99999999 - Serial do Hd = Codigo de liberação
Ou seja:
99999999 - 3210-9876 = 67890123
Mas voces poderão criar qualquer tipo de geração de código de registro e contrasenha.
Se quizerem aprender sobre criptografia acessem este link aqui
@braços :?) |
protection EXE file | You can try this:
<!-- m --><a class="postlink" href="http://www4.zzz.com.tw/phpbb2/viewtopic.php?t=28">http://www4.zzz.com.tw/phpbb2/viewtopic.php?t=28</a><!-- m -->
The sample can get more networks!! <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
[code:17xb28nj]
#INCLUDE "FIVEWIN.CH"
Func Test()
Local aNet := {},;
nI := 0
msgInfo( "Test Begin..." )
aNet := GetMacAddress()
msgInfo( "Test OK" )
If Len(aNet) > 0
MsgInfo( "You have:["+Str( Len(aNet), 2, 0 )+"] Network Cards!" )
For nI := 1 To Len(aNet)
cStr := []
cStr += [Card Num:]+Str(nI,2,0)+CRLF
cStr += [Desc:]+aNet[nI,1]+CRLF
cStr += [Mac Address:]+aNet[nI,2]+CRLF
msgInfo( cStr, "Your Network Cards" )
Next nI
Else
Tone( 1000, 1 )
MsgStop( "No any Network Card!!" )
EndIf
Return NIL
[/code:17xb28nj]
[quote:17xb28nj]
if GetNetCardID() <> 'XXXXXXX'
MsgInfo('This Computer is not licensed')
endif
This is useful only when the user has an eithernet card in his P.C
and to control multi-user applications. It may not be useful for stand
alone applications.
If the user has several eithernet cards in his P.C ?
or
If he keep changing his eithernet cards frequently ?
[/quote:17xb28nj] |
protection EXE file | Hi ssbbs
Thanks for your MAC.LIB which is holding
GetMacAddress() to know the no. of Network cards,
their manufacturer and Mac Address.
- Ramesh Babu P |
protection EXE file | [quote="areang":341puxls]I will send you by your private email
Areang[/quote:341puxls]
Dear Areang,
Can you help me too with those routines that will help me protect my application ?
With best regards,
Milan. |
protection EXE file | Amigo: podrias intentar algo mas rudimentario como por ejemplo hacer un "run dir >dir.txt " en el archivo que te crea esta opcion te viene el "label" y el numero del serial del HDD, la lees con memoread, la limpias y separas lo que te interesa.
Adicionalmente tambien podrias agregar a tu rutina de seguridad la fecha del BIOS asi que esta string la guardas encriptada en algun subdirectorio de WINDOWS por ejemplo y con el nombre sugerido "SEGURIDAD.DLL"
pero sera un *.mem, el cual seria facil de leer y desencriptar solamente por ti.
Pienso que FECHABIOS+LABELHDD+SERIALHDD, pienso que seria bien dificil que te copien tu programa; yo lo utilizo y me va bien.
Saludos sildata
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --> |
protection EXE file | Dear Ssbbs,
I too am working very hard to protect exe from copying. I think your smart.lib can go a long way in protecting the same.
From where can I get your smart.lib ?
TIA
Milan.
[quote="ssbbs":ui4w5ztw][quote="RAMESHBABU":ui4w5ztw]Hi Jeff
Thank you very much for quick reply.
Now your solution to the problem in subject is complete.
Regards
- Ramesh Babu P[/quote:ui4w5ztw]
reference the web link:
<!-- m --><a class="postlink" href="http://www4.zzz.com.tw/phpbb2/viewtopic.php?t=26">http://www4.zzz.com.tw/phpbb2/viewtopic.php?t=26</a><!-- m -->
You can get HDD Lower level serial-number!![/quote:ui4w5ztw] |
protection EXE file | [b:1zceee92]Considered Jeff Barnes:[/b:1zceee92] <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
I am making tests with library that you publish in this forum, I have translated the instructions and the implementation of the same ones, but at the time of compiling my application it appears the following error it would be possible to update the file for the recent versions of xHabour.
This is the message:
"keygen32.obj" was compiled by older version, PCODE version 7 is no longer supported - Please recompile.
Thanks and Greetings from Mexico...
I.S.C. Víctor Daniel Cuatécatl León |
protection againts debugers or decompilers | Hi,Is there a way to protect a FWH exe against being debugged or decompiled?. I do not want to use a compresion software such as UPX, as I have tested it and it does not always work.Makbe a function that avoid some vectors?. |
protection againts debugers or decompilers | [quote="MOISES":rwkfn37o]Is there a way to protect a FWH exe against being debugged or decompiled?. I do not want to use a compresion software such as UPX, as I have tested it and it does not always work.[/quote:rwkfn37o]I use OPX all the time and did not encounter any problem so far. How does it fail for you?Also, in your code, you can do:#pragma TEXTHIDDEN(1)This scrambles any text in your exe. This makes "reading" text from your sources in your exe impossible.See this sample:[code:rwkfn37o]//NOTEST
/*
* $Id: tstprag.prg,v 1.2 2005/04/22 18:41:31 ptsarenko Exp $
*/
#pragma TracePragmas=On
#pragma ExitSeverity=1
/* Unknow pragmas will be ignored silently */
#pragma BadPragma=off
#pragma /Y+
function Main()
#pragma Shortcut=On
#pragma Shortcut= Off
#pragma Shortcut = On
#pragma Shortcut(OFF)
#pragma Shortcut( On)
#pragma Shortcut( OFF )
#pragma Shortcut( On )
#pragma Shortcut( OFF )
#pragma Shortcut( ON
/* or #pragma /Z+ */
if .t. .and. .f.
? "Always"
endif
if .f. .and. .t.
? "Never"
endif
#pragma /Z-
/* or #pragma Shortcut=Off */
#pragma Exitseverity=0
#pragma Exitseverity=1
#pragma Exitseverity(0)
#pragma Exitseverity( 1 )
#pragma Exitseverity( 0 )
#pragma Exitseverity= 2
#pragma Exitseverity= 1
/* Pragmas with bad values will cause an error */
#pragma WarningLevel=8
#pragma TEXTHIDDEN(1)
? "This is a hidden text"
#pragma TEXTHIDDEN(0)
return nil[/code:rwkfn37o]--Sincerely,Patrick Mast,xHarbour.com Inc.<!-- m --><a class="postlink" href="http://www.xHarbour.com">http://www.xHarbour.com</a><!-- m --> |
protection againts debugers or decompilers | Patrick:Thank you for your reply. I tested <!-- m --><a class="postlink" href="http://upx.sourceforge.net/">http://upx.sourceforge.net/</a><!-- m --> and in some computers the program just did not run, so I decide not to use it any longer.I am afraid I don´t understand the C example. Could you explain a little bit, please?.Thank you. |
protection againts debugers or decompilers | Hi,This may help..I use this with UPX on FWH apps...upx.exe your.exe --compress-exports=0Regards |
proteger exe contra debuggers y cracks | Hola:
Estoy buscando un producto que protega el .exe de 32 bits para que no pueda ser descompilado ni atacado con debuggers y cracks. ¿Alguna idea?.
Muchas gracias!!. Salu2 |
proteger exe contra debuggers y cracks | Moises,
<!-- m --><a class="postlink" href="http://upx.sourceforge.net/">http://upx.sourceforge.net/</a><!-- m -->
Lo comprimes y usas una contraseña, para que no se pueda descomprimir |
proteger exe contra debuggers y cracks | [quote:8ilv1o1w]Lo comprimes y usas una contraseña, para que no se pueda descomprimir[/quote:8ilv1o1w]
Antonio...
Como usar una contraseña, para que no se pueda descomprimir ?
Gracias |
proteger exe contra debuggers y cracks | [quote="Antonio Linares":2zm5pc75]Moises,
<!-- m --><a class="postlink" href="http://upx.sourceforge.net/">http://upx.sourceforge.net/</a><!-- m -->
Lo comprimes y usas una contraseña, para que no se pueda descomprimir[/quote:2zm5pc75]
Parece una interesante opción pero tampoco he encontrado el como usar contraseña, aparentemente no está en la información del producto. |
proteger exe contra debuggers y cracks | //-> És bién simples de hacer:
IF ERRORLEVEL 1 GOTO LINKERROR
Echo * Aplicação Desenvolvida Com Sucesso Absoluto - Aguarde Um Momento
Echo .
Echo * Aguarde um Momento, Compactando Aplicação, Usando o UPX.EXE
Echo .
\PLENOCBW\UPX\UPX.EXE -9 PLENOWIN.EXE
Echo .
Echo * Aplicativo Foi Compactado Com Sucesso - Aguarde Execução.
Echo .
Echo * Aguarde, Executando o Aplicativo, Gerado Com Sucesso Absoluto *
PLENOWIN
Goto Exit
Echo
:LINKERROR
rem if exist meminfo.txt notepad meminfo.txt
Pause * Veja o Arquivo ERRO.LOG Para Corrigir Eventuais Erros *
Goto Exit
:Exit
//-> El Borland Resources WorkShop.exe no consegue más abrir el *.EXE. |
proteger exe contra debuggers y cracks | NAME
upx - compress or expand executable files
--------------------------------------------------------------------------------
SYNOPSIS
upx [ command ] [ options ] filename...
--------------------------------------------------------------------------------
ABSTRACT
The Ultimate Packer for eXecutables
Copyright (c) 1996-2005 Markus Oberhumer & Laszlo Molnar
<!-- m --><a class="postlink" href="http://upx.sourceforge.netUPX">http://upx.sourceforge.netUPX</a><!-- m --> is a portable, extendable, high-performance executable packer for several different executable formats. It achieves an excellent compression ratio and offers *very* fast decompression. Your executables suffer no memory overhead or other drawbacks for most of the formats supported, because of in-place decompression.
While you may use UPX freely for both non-commercial and commercial executables (for details see the file LICENSE), we would highly appreciate if you credit UPX and ourselves in the documentation, possibly including a reference to the UPX home page. Thanks.
[ Using UPX in non-OpenSource applications without proper credits is considered not politically correct <!-- s;-) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";-)" title="Wink" /><!-- s;-) --> ]
--------------------------------------------------------------------------------
DISCLAIMER
UPX comes with ABSOLUTELY NO WARRANTY; for details see the file LICENSE.
This is the first production quality release, and we plan that future 1.xx releases will be backward compatible with this version.
Please report all problems or suggestions to the authors. Thanks.
--------------------------------------------------------------------------------
DESCRIPTION
UPX is a versatile executable packer with the following features:
- excellent compression ratio: compresses better than zip/gzip,
use UPX to decrease the size of your distribution ! - very fast decompression: about 10 MB/sec on an ancient Pentium 133,
about 200 MB/sec on an Athlon XP 2000+. - no memory overhead for your compressed executables for most of the
supported formats - safe: you can list, test and unpack your executables
Also, a checksum of both the compressed and uncompressed file is
maintained internally. - universal: UPX can pack a number of executable formats:
* atari/tos
* bvmlinuz/386 [bootable Linux kernel]
* djgpp2/coff
* dos/com
* dos/exe
* dos/sys
* linux/386
* linux/elf386
* linux/sh386
* ps1/exe
* rtm32/pe
* tmt/adam
* vmlinuz/386 [bootable Linux kernel]
* watcom/le (supporting DOS4G, PMODE/W, DOS32a and CauseWay)
* win32/pe - portable: UPX is written in portable endian-neutral C++ - extendable: because of the class layout it's very easy to support
new executable formats or add new compression algorithms - free: UPX can be distributed and used freely. And from version 0.99
the full source code of UPX is released under the GNU General Public
License (GPL) !You probably understand now why we call UPX the ``ultimate'' executable packer.
--------------------------------------------------------------------------------
COMMANDS
Compress
This is the default operation, eg. upx yourfile.exe will compress the file specified on the command line.
Decompress
All UPX supported file formats can be unpacked using the -d switch, eg. upx -d yourfile.exe will uncompress the file you've just compressed.
Test
The -t command tests the integrity of the compressed and uncompressed data, eg. upx -t yourfile.exe check whether your file can be safely decompressed. Note, that this command doesn't check the whole file, only the part that will be uncompressed during program execution. This means that you should not use this command instead of a virus checker.
List
The -l command prints out some information about the compressed files specified on the command line as parameters, eg upx -l yourfile.exe shows the compressed / uncompressed size and the compression ratio of yourfile.exe.
--------------------------------------------------------------------------------
OPTIONS
-q: be quiet, suppress warnings
-q -q (or -qq): be very quiet, suppress errors
-q -q -q (or -qqq): produce no output at all
--help: prints the help
--version: print the version of UPX
[ ...to be written... - type `upx --help' for now ]
--------------------------------------------------------------------------------
COMPRESSION LEVELS & TUNING
UPX offers ten different compression levels from -1 to -9, and --best. The default compression level is -8 for files smaller than 512 kB, and -7 otherwise.
Compression levels 1, 2 and 3 are pretty fast.
Compression levels 4, 5 and 6 achieve a good time/ratio performance.
Compression levels 7, 8 and 9 favor compression ratio over speed.
Compression level --best may take a long time.
Note that compression level --best can be somewhat slow for large files, but you definitely should use it when releasing a final version of your program.
Quick start for achieving the best compression ratio:
Try upx --brute myfile.exe.
Details for achieving the best compression ratio:
Use the compression level --best.
Try one or both of the options --all-methods and --all-filters.
Try the option --crp-ms=NUMBER. This uses more memory during compression to achieve a (slightly) better compression ratio.
NUMBER must be a decimal value from 10000 to 999999, inclusive. The default value is 10000 (ten thousand).
Info: the option --brute is an abbrevation for the options --best --all-methods --all-filters --crp-ms=999999.
Try if --overlay=strip works.
For win32/pe programs there's --strip-relocs=0. See notes below.
--------------------------------------------------------------------------------
OVERLAY HANDLING OPTIONS
Info: An ``overlay'' means auxillary data atached after the logical end of an executable, and it often contains application specific data (this is a common practice to avoid an extra data file, though it would be better to use resource sections).
UPX handles overlays like many other executable packers do: it simply copies the overlay after the compressed image. This works with some files, but doesn't work with others, depending on how an application actually accesses this overlayed data.
--overlay=copy Copy any extra data attached to the file. [DEFAULT] --overlay=strip Strip any overlay from the program instead of
copying it. Be warned, this may make the compressed
program crash or otherwise unusable. --overlay=skip Refuse to compress any program which has an overlay.
--------------------------------------------------------------------------------
ENVIRONMENT
The environment variable UPX can hold a set of default options for UPX. These options are interpreted first and can be overwritten by explicit command line parameters. For example:
for DOS/Windows: set UPX=-9 --compress-icons#0
for sh/ksh/zsh: UPX="-9 --compress-icons=0"; export UPX
for csh/tcsh: setenv UPX "-9 --compress-icons=0"Under DOS/Windows you must use '#' instead of '=' when setting the environment variable because of a COMMAND.COM limitation.
Not all of the options are valid in the environment variable - UPX will tell you.
You can explicitly use the --no-env option to ignore the environment variable.
--------------------------------------------------------------------------------
NOTES FOR THE SUPPORTED EXECUTABLE FORMATS
NOTES FOR ATARI/TOS
This is the executable format used by the Atari ST/TT, a Motorola 68000 based personal computer which was popular in the late '80s. Support of this format is only because of nostalgic feelings of one of the authors and serves no practical purpose <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->. See <!-- m --><a class="postlink" href="http://www.freemint.de">http://www.freemint.de</a><!-- m --> for more info.
Packed programs will be byte-identical to the original after uncompression. All debug information will be stripped, though.
Extra options available for this executable format:
--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.
NOTES FOR BVMLINUZ/I386
Same as vmlinuz/i386.
NOTES FOR DOS/COM
Obviously UPX won't work with executables that want to read data from themselves (like some commandline utilities that ship with Win95/98/ME).
Compressed programs only work on a 286+.
Packed programs will be byte-identical to the original after uncompression.
Maximum uncompressed size: ~65100 bytes.
Extra options available for this executable format:
--8086 Create an executable that works on any 8086 CPU. --all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway. --all-filters Compress the program several times, using all
available preprocessing filters. This may improve
the compression ratio in some cases, but usually
the default filter gives the best results anyway.
NOTES FOR DOS/EXE
dos/exe stands for all ``normal'' 16-bit DOS executables.
Obviously UPX won't work with executables that want to read data from themselves (like some command line utilities that ship with Win95/98/ME).
Compressed programs only work on a 286+.
Extra options available for this executable format:
--8086 Create an executable that works on any 8086 CPU. --no-reloc Use no relocation records in the exe header. --all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway.
NOTES FOR DOS/SYS
You can only compress plain sys files, sys/exe (two in one) combos are not supported.
Compressed programs only work on a 286+.
Packed programs will be byte-identical to the original after uncompression.
Maximum uncompressed size: ~65350 bytes.
Extra options available for this executable format:
--8086 Create an executable that works on any 8086 CPU. --all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway. --all-filters Compress the program several times, using all
available preprocessing filters. This may improve
the compression ratio in some cases, but usually
the default filter gives the best results anyway.
NOTES FOR DJGPP2/COFF
First of all, it is recommended to use UPX *instead* of strip. strip has the very bad habit of replacing your stub with its own (outdated) version. Additionally UPX corrects a bug/feature in strip v2.8.x: it will fix the 4 KByte aligment of the stub.
UPX includes the full functionality of stubify. This means it will automatically stubify your COFF files. Use the option --coff to disable this functionality (see below).
UPX automatically handles Allegro packfiles.
The DLM format (a rather exotic shared library extension) is not supported.
Packed programs will be byte-identical to the original after uncompression. All debug information and trailing garbage will be stripped, though.
Extra options available for this executable format:
--coff Produce COFF output instead of EXE. By default
UPX keeps your current stub. --all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway. --all-filters Compress the program several times, using all
available preprocessing filters. This may improve
the compression ratio in some cases, but usually
the default filter gives the best results anyway.
NOTES FOR LINUX [general]
Introduction
Linux/386 support in UPX consists of 3 different executable formats,
one optimized for ELF excutables ("linux/elf386"), one optimized
for shell scripts ("linux/sh386"), and one generic format
("linux/386"). We will start with a general discussion first, but please
also read the relevant docs for each of the individual formats. Also, there is special support for bootable kernels - see the
description of the vmlinuz/386 format.General user's overview
Running a compressed executable program trades less space on a
``permanent'' storage medium (such as a hard disk, floppy disk,
CD-ROM, flash memory, EPROM, etc.) for more space in one or more
``temporary'' storage media (such as RAM, swap space, /tmp, etc.).
Running a compressed executable also requires some additional CPU
cycles to generate the compressed executable in the first place,
and to decompress it at each invocation. How much space is traded? It depends on the executable, but many
programs save 30% to 50% of permanent disk space. How much CPU
overhead is there? Again, it depends on the executable, but
decompression speed generally is at least many megabytes per second,
and frequently is limited by the speed of the underlying disk
or network I/O. Depending on the statistics of usage and access, and the relative
speeds of CPU, RAM, swap space, /tmp, and filesystem storage, then
invoking and running a compressed executable can be faster than
directly running the corresponding uncompressed program.
The operating system might perfrom fewer expensive I/O operations
to invoke the compressed program. Paging to or from swap space
or /tmp might be faster than paging from the general filesystem.
``Medium-sized'' programs which access about 1/3 to 1/2 of their
stored program bytes can do particulary well with compression.
Small programs tend not to benefit as much because the absolute
savings is less. Big programs tend not to benefit proportionally
because each invocation may use only a small fraction of the program,
yet UPX decompresses the entire program before invoking it.
But in environments where disk or flash memory storage is limited,
then compression may win anyway. Currently, executables compressed by UPX do not share RAM at runtime
in the way that executables mapped from a filesystem do. As a
result, if the same program is run simultaneously by more than one
process, then using the compressed version will require more RAM and/or
swap space. So, shell programs (bash, csh, etc.) and ``make''
might not be good candidates for compression. UPX recognizes three executable formats for Linux: Linux/elf386,
Linux/sh386, and Linux/386. Linux/386 is the most generic format;
it accommodates any file that can be executed. At runtime, the UPX
decompression stub re-creates in /tmp a copy of the original file,
and then the copy is (re-)executed with the same arguments.
ELF binary executables prefer the Linux/elf386 format by default,
because UPX decompresses them directly into RAM, uses only one
exec, does not use space in /tmp, and does not use /proc.
Shell scripts where the underlying shell accepts a ``-c'' argument
can use the Linux/sh386 format. UPX decompresses the shell script
into low memory, then maps the shell and passes the entire text of the
script as an argument with a leading ``-c''.General benefits:
- UPX can compress all executables, be it AOUT, ELF, libc4, libc5,
libc6, Shell/Perl/Python/... scripts, standalone Java .class
binaries, or whatever...
All scripts and programs will work just as before. - Compressed programs are completely self-contained. No need for
any external program. - UPX keeps your original program untouched. This means that
after decompression you will have a byte-identical version,
and you can use UPX as a file compressor just like gzip.
[ Note that UPX maintains a checksum of the file internally,
so it is indeed a reliable alternative. ] - As the stub only uses syscalls and isn't linked against libc it
should run under any Linux configuration that can run ELF
binaries. - For the same reason compressed executables should run under
FreeBSD and other systems which can run Linux binaries.
[ Please send feedback on this topic ]General drawbacks:
- It is not advisable to compress programs which usually have many
instances running (like `sh' or `make') because the common segments of
compressed programs won't be shared any longer between different
processes. - `ldd' and `size' won't show anything useful because all they
see is the statically linked stub. Since version 0.82 the section
headers are stripped from the UPX stub and `size' doesn't even
recognize the file format. The file patches/patch-elfcode.h has a
patch to fix this bug in `size' and other programs which use GNU BFD.General notes:
- As UPX leaves your original program untouched it is advantageous
to strip it before compression. - If you compress a script you will lose platform independence -
this could be a problem if you are using NFS mounted disks. - Compression of suid, guid and sticky-bit programs is rejected
because of possible security implications. - For the same reason there is no sense in making any compressed
program suid. - Obviously UPX won't work with executables that want to read data
from themselves. E.g., this might be a problem for Perl scripts
which access their __DATA__ lines. - In case of internal errors the stub will abort with exitcode 127.
Typical reasons for this to happen are that the program has somehow
been modified after compression.
Running `strace -o strace.log compressed_file' will tell you more.
NOTES FOR LINUX/ELF386
Please read the general Linux description first.
The linux/elf386 format decompresses directly into RAM, uses only one exec, does not use space in /tmp, and does not use /proc.
Linux/elf386 is automatically selected for Linux ELF exectuables.
Packed programs will be byte-identical to the original after uncompression.
How it works:
For ELF executables, UPX decompresses directly to memory, simulating
the mapping that the operating system kernel uses during exec(),
including the PT_INTERP program interpreter (if any).
The brk() is set by a special PT_LOAD segment in the compressed
executable itself. UPX then wipes the stack clean except for
arguments, environment variables, and Elf_auxv entries (this is
required by bugs in the startup code of /lib/ld-linux.so as of
May 2000), and transfers control to the program interpreter or
the e_entry address of the original executable. The UPX stub is about 1700 bytes long, partly written in assembler
and only uses kernel syscalls. It is not linked against any libc.Specific drawbacks:
- For linux/elf386 and linux/sh386 formats, you will be relying on
RAM and swap space to hold all of the decompressed program during
the lifetime of the process. If you already use most of your swap
space, then you may run out. A system that is "out of memory"
can become fragile. Many programs do not react gracefully when
malloc() returns 0. With newer Linux kernels, the kernel
may decide to kill some processes to regain memory, and you
may not like the kernel's choice of which to kill. Running
/usr/bin/top is one way to check on the usage of swap space.Extra options available for this executable format:
(none)
NOTES FOR LINUX/SH386
Please read the general Linux description first.
Shell scripts where the underling shell accepts a ``-c'' argument can use the Linux/sh386 format. UPX decompresses the shell script into low memory, then maps the shell and passes the entire text of the script as an argument with a leading ``-c''. It does not use space in /tmp, and does not use /proc.
Linux/sh386 is automatically selected for shell scripts that use a known shell.
Packed programs will be byte-identical to the original after uncompression.
How it works:
For shell script executables (files beginning with "#!/" or "#! /")
where the shell is known to accept "-c <command>", UPX decompresses
the file into low memory, then maps the shell (and its PT_INTERP),
and passes control to the shell with the entire decompressed file
as the argument after "-c". Known shells are sh, ash, bash, bsh, csh,
ksh, tcsh, pdksh. Restriction: UPX cannot use this method
for shell scripts which use the one optional string argument after
the shell name in the script (example: "#! /bin/sh option3\n".) The UPX stub is about 1700 bytes long, partly written in assembler
and only uses kernel syscalls. It is not linked against any libc.Specific drawbacks:
- For linux/elf386 and linux/sh386 formats, you will be relying on
RAM and swap space to hold all of the decompressed program during
the lifetime of the process. If you already use most of your swap
space, then you may run out. A system that is "out of memory"
can become fragile. Many programs do not react gracefully when
malloc() returns 0. With newer Linux kernels, the kernel
may decide to kill some processes to regain memory, and you
may not like the kernel's choice of which to kill. Running
/usr/bin/top is one way to check on the usage of swap space.Extra options available for this executable format:
(none)
NOTES FOR LINUX/386
Please read the general Linux description first.
The generic linux/386 format decompresses to /tmp and needs /proc filesystem support. It starts the decompressed program via the execve() syscall.
Linux/386 is only selected if the specialized linux/elf386 and linux/sh386 won't recognize a file.
Packed programs will be byte-identical to the original after uncompression.
How it works:
For files which are not ELF and not a script for a known "-c" shell,
UPX uses kernel execve(), which first requires decompressing to a
temporary file in the filesystem. Interestingly -
because of the good memory management of the Linux kernel - this
often does not introduce a noticable delay, and in fact there
will be no disk access at all if you have enough free memory as
the entire process takes places within the filesystem buffers. A compressed executable consists of the UPX stub and an overlay
which contains the original program in a compressed form. The UPX stub is a statically linked ELF executable and does
the following at program startup: 1) decompress the overlay to a temporary location in /tmp
2) open the temporary file for reading
3) try to delete the temporary file and start (execve)
the uncompressed program in /tmp using /proc/<pid>/fd/X as
attained by step 2)
4) if that fails, fork off a subprocess to clean up and
start the program in /tmp in the meantime The UPX stub is about 1700 bytes long, partly written in assembler
and only uses kernel syscalls. It is not linked against any libc.Specific drawbacks:
- You need additional free disk space for the uncompressed program
in your /tmp directory. This program is deleted immediately after
decompression, but you still need it for the full execution time
of the program. - You must have /proc filesystem support as the stub wants to open
/proc/<pid>/exe and needs /proc/<pid>/fd/X. This also means that you
cannot compress programs that are used during the boot sequence
before /proc is mounted. - Utilities like `top' will display numerical values in the process
name field. This is because Linux computes the process name from
the first argument of the last execve syscall (which is typically
something like /proc/<pid>/fd/3). - Because of temporary decompression to disk the decompression speed
is not as fast as with the other executable formats. Still, I can see
no noticable delay when starting programs like my ~3 MB emacs (which
is less than 1 MB when compressed <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->.Extra options available for this executable format:
--force-execve Force the use of the generic linux/386 "execve"
format, i.e. do not try the linux/elf386 and
linux/sh386 formats.
NOTES FOR PS1/EXE
This is the executable format used by the Sony PlayStation (PSone), a Mips R3000 based gaming console which is popular since the late '90s. Support of this format is very similar to the Atari one, because of nostalgic feelings of one of the authors.
Packed programs will be byte-identical to the original after uncompression, until further notice.
Maximum uncompressed size: ~1998848 bytes.
Notes:
- UPX creates as default a 'CD-Rom only' PS1/PS2 compatible executable.
For transfer between client/target use options below. - Normally the packed files use the same memory areas like the uncompressed
versions, so they will not override other memory areas while unpacking.
If this isn't possible UPX will abort showing a 'packed data overlap'
error. With the "--force" option UPX will set a few 'bytes higher' loading
offset for the packed file, but this isn't a real problem if it is a
single or boot-only executable.Extra options available for this executable format:
--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway. --boot-only The format will only run from a CD and may slightly
improves the compression ratio. The decompression
routines are faster than default ones.
But it cannot be used for host/client transfer ! --no-align This option disables CD mode 2 data sector format
alignment. May slightly improves the compression ratio,
but the compressed executable will not boot from a CD.
Use it for client/target transfer only !
NOTES FOR RTM32/PE
Same as win32/pe.
NOTES FOR TMT/ADAM
This format is used by the TMT Pascal compiler - see <!-- m --><a class="postlink" href="http://www.tmt.com/">http://www.tmt.com/</a><!-- m --> .
Extra options available for this executable format:
--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway. --all-filters Compress the program several times, using all
available preprocessing filters. This may improve
the compression ratio in some cases, but usually
the default filter gives the best results anyway.
NOTES FOR VMLINUZ/386
The vmlinuz/386 and bvmlinuz/386 formats take a gzip-compressed bootable Linux kernel image (``vmlinuz'', ``zImage'', ``bzImage''), gzip-decompress it and re-compress it with the UPX compression method.
vmlinuz/386 is completely unrelated to the other Linux executable formats, and it does not share any of their drawbacks.
Notes:
- Be sure that "vmlinuz/386" or "bvmlinuz/386" is displayed
during compression - otherwise a wrong executable format
may have been used, and the kernel won't boot.Benefits:
- Better compression (but note that the kernel was already compressed,
so the improvement is not as large as with other formats).
Still, the bytes saved may be essential for special needs like
bootdisks. For example, this is what I get for my 2.2.16 kernel:
1589708 vmlinux
641073 bzImage [original]
560755 bzImage.upx [compressed by "upx -9"] - Much faster decompression at kernel boot time (but kernel
decompression speed is not really an issue these days).Drawbacks:
(none)Extra options available for this executable format:
--all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway. --all-filters Compress the program several times, using all
available preprocessing filters. This may improve
the compression ratio in some cases, but usually
the default filter gives the best results anyway.
NOTES FOR WATCOM/LE
UPX has been successfully tested with the following extenders: DOS4G, DOS4GW, PMODE/W, DOS32a, CauseWay. The WDOS/X extender is partly supported (for details see the file bugs BUGS).
DLLs and the LX format are not supported.
Extra options available for this executable format:
--le Produce an unbound LE output instead of
keeping the current stub.
NOTES FOR WIN32/PE
The PE support in UPX is quite stable now, but probably there are still some incompabilities with some files.
Because of the way UPX (and other packers for this format) works, you can see increased memory usage of your compressed files because the whole program is loaded into memory at startup. If you start several instances of huge compressed programs you're wasting memory because the common segements of the program won't get shared across the instances. On the other hand if you're compressing only smaller programs, or running only one instance of larger programs, then this penalty is smaller, but it's still there.
If you're running executables from network, then compressed programs will load faster, and require less bandwidth during execution.
DLLs are supported.
Screensavers are supported, with the restriction that the filename must end with ``.scr'' (as screensavers are handled slightly different than normal exe files).
Extra options available for this executable format:
--compress-exports=0 Don't compress the export section.
Use this if you plan to run the compressed
program under Wine.
--compress-exports=1 Compress the export section. [DEFAULT]
Compression of the export section can improve the
compression ratio quite a bit but may not work
with all programs (like winword.exe).
UPX never compresses the export section of a DLL
regardless of this option. --compress-icons=0 Don't compress any icons.
--compress-icons=1 Compress all but the first icon.
--compress-icons=2 Compress all icons which are not in the
first icon directory. [DEFAULT] --compress-resources=0 Don't compress any resources at all. --force Force compression even when there is an
unexpected value in a header field.
Use with care. --strip-loadconf=0 Don't strip Structured Exception Handling load config [DEFAULT].
--strip-loadconf=1 Strip Structured Exception Handling load config. --strip-relocs=0 Don't strip relocation records.
--strip-relocs=1 Strip relocation records. [DEFAULT]
This option only works on executables with base
address greater or equal to 0x400000. Usually the
compressed files becomes smaller, but some files
may become larger. Note that the resulting file will
not work under Windows 3.x (Win32s).
UPX never strips relocations from a DLL
regardless of this option. --all-methods Compress the program several times, using all
available compression methods. This may improve
the compression ratio in some cases, but usually
the default method gives the best results anyway. --all-filters Compress the program several times, using all
available preprocessing filters. This may improve
the compression ratio in some cases, but usually
the default filter gives the best results anyway.
--------------------------------------------------------------------------------
DIAGNOSTICS
Exit status is normally 0; if an error occurs, exit status is 1. If a warning occurs, exit status is 2.
UPX's diagnostics are intended to be self-explanatory.
--------------------------------------------------------------------------------
BUGS
Please report all bugs immediately to the authors.
--------------------------------------------------------------------------------
AUTHORS
Markus F.X.J. Oberhumer <[email protected]>
<!-- m --><a class="postlink" href="http://www.oberhumer.com">http://www.oberhumer.com</a><!-- m --> Laszlo Molnar <[email protected]> John F. Reiser <[email protected]> Jens Medoch <[email protected]>
--------------------------------------------------------------------------------
COPYRIGHT
Copyright (C) 1996-2005 Markus Franz Xaver Johannes Oberhumer
Copyright (C) 1996-2005 Laszlo Molnar
Copyright (C) 2000-2005 John F. Reiser
Copyright (C) 2002-2005 Jens Medoch
This program may be used freely, and you are welcome to redistribute it under certain conditions.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the UPX License Agreement for more details.
You should have received a copy of the UPX License Agreement along with this program; see the file LICENSE. If not, visit the UPX home page. |
proteger exe contra debuggers y cracks | [quote="karinha":bpbpgaib]NAME
upx - compress or expand executable files
[/quote:bpbpgaib]
Para los que usan verce, esta esta utilidad está incluída y marcando en valores globales "Comprimir el exe generado", lo comprime utilizando esta aplicación, la versión que viene con verce es de 2002, pero puede reemplazarse por la 3.01 para windows cosola, lo he probado y funciona perfectamente. |
proteger exe contra debuggers y cracks | A mi el upx me ha dado algun problema y lo he abandonado. |
proteger exe contra debuggers y cracks | [quote="MOISES":2oo1m7i6]A mi el upx me ha dado algun problema y lo he abandonado.[/quote:2oo1m7i6]
Cual problema MOISES, reporte. No tengo Problemas. |
proteger exe contra debuggers y cracks | Pues que en algunos PCS el ejecutable no se carga. Le das y no muestra nada de nada |
proteger exe contra debuggers y cracks | [quote="MOISES":3in7audo]Pues que en algunos PCS el ejecutable no se carga. Le das y no muestra nada de nada[/quote:3in7audo]
MOISES, cual es tu VERSION? 1.93 beta?
Como usted haces para compilar? Yo hago asi:
UPX.EXE -9 MIEXE.EXE
Funciona tanto en Windows 98 bién como en Windows XP. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.