#HOW DOES JAR2EXE WORK CODE#
With that said I:=$51 would be a simple way to put a hex numerical value in your code without having to convert it to decimal. You are able to easily embed hexadecimal values in your code by simply adding a '$' sign before the value.
#HOW DOES JAR2EXE WORK HOW TO#
Working with hexadecimal values in delphi is quite simple once you know how to do it. Question 2: How do I work with hexadecimal values? How do I convert HexToInt? How do I convert an integer to a hex string? MyStr:=myStr+chr(myVals) //Loops through myVals and converts the bytes to characters. If we execute m圜har:=chr($41) this will set m圜har = 'A' Here is a code example.ĬONST myVals: Array of byte=($41,$42,$43,$44) This allows us to pass a byte value to the function and get the character representation of it. In order to get a character value of a number, we will use the chr() function. In Delphi, the first character is always character '1' unlike C++ where the first character is '0' In this example, we loop through the entire string and use 'name' to get the character of the name at the current loop value.
If you want to loop through an entire string and add all of the characters together we can do this: In this case we can implement myByte:=ord('A') This sets myByte to 65 or $41 in hex. When a character is passed to this function, it will return the numerical value of the character. In order to do this in delphi, we can use the ord() function. Question 1: How do I get the numerical value of a character and a character value of a number?Ī lot of licensing algorithms like to manipulate the numerical value of each character in a name individually in a mathematical operation. In this tutorial, I will try to cover many of the things that were confusing to me and give you some tips on how to accomplish some of these tasks in a simple and effective manner. A lot of beginners who are trying to learn keygenning often get stuck with questions about how to implement certain things or manipulate strings or characters in certain ways.
Hello and welcome to this short tutorial for keygenning in Delphi.