Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * @ Author: Bruno da Silva
- * @ Site: www.ips-team.blogspot.com
- * @ Date Hour: 17/08/2011 - 10:30
- */
- main()
- {
- return print(hexDecode("48656c6c6f576f726c644272756e6f"));
- }
- hexDecode(s[])
- {
- new
- stringTexto[500],
- stringTemp[4],
- alocarNumerosInts;
- for (new i; s[i]; i++)
- {
- format(stringTemp, 4, "%s%s", s[i++], s[i]);
- switch (stringTemp[1])
- {
- case 0x58 , 0x78: alocarNumerosInts = 0;
- case 0x30 .. 0x39: alocarNumerosInts = (stringTemp[0] << 4) | (stringTemp[1] - 0x30);
- case 0x61 .. 0x66: alocarNumerosInts = (stringTemp[0] << 4) | (stringTemp[1] - (0x61 - 0xA));
- case 0x40 .. 0x46: alocarNumerosInts = (stringTemp[0] << 4) | (stringTemp[1] - (0x41 - 0xA));
- }
- format(stringTexto, 500, "%s%c", stringTexto, alocarNumerosInts);
- }
- return stringTexto;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement