Quantcast

Jump to content

» «
Photo

Hex

21 replies to this topic
Nahiyan
  • Nahiyan

    I'm awesome, and I'm a scripter

  • Members
  • Joined: 15 Oct 2010

#1

Posted 21 November 2010 - 10:27 AM

Well yeah, what do you do with hex? Put your name in it? I know it turns all letters into hexadecimal.. but what can you do with hex?

Silent
  • Silent

    Chief Vision™ Alterer

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#2

Posted 21 November 2010 - 11:27 AM

You can do everything with it. It just imports raw hex.

It is hard to explain, Sanny Builder help has it documented a bit (Help -> Coding -> HEX...END).

BnB
  • BnB

    return 0;

  • The Yardies
  • Joined: 28 Jun 2010
  • Saint-Vincent-and-the-Grenadines

#3

Posted 21 November 2010 - 02:03 PM Edited by BnB, 21 November 2010 - 02:18 PM.

Byte DataDecompiled Data
01 00 04 00 0001: wait 0 ms / 0001: 0
6A 01 04 00 04 00 016A: fade 0 time 0 / 016A: 0 0


0100 (First Part) Is the opcode number
04 (Second Part) Is the data type
00 (Third Part) Is the parameter(s) value(s)

Data Type tells to the game how much bytes to read next and what kind of data it is.

After an opcode number the data types and parameter values follow

The game does not know what the word wait means, but it knows what the opcode 0001 is.

If you want to code in hex you have to use HEX… END

Example:
CODE
hex  
[code in hex]
end


CODE
hex
0100 04 00
end


Is the same as
0001: wait 0 ms

Also in GTA Modding.

yair1221
  • yair1221

    Homie

  • Members
  • Joined: 18 Feb 2010

#4

Posted 21 November 2010 - 02:09 PM

how does hex help you?
i mean it seriously...is it better than normal opcodes by anyway?

BnB
  • BnB

    return 0;

  • The Yardies
  • Joined: 28 Jun 2010
  • Saint-Vincent-and-the-Grenadines

#5

Posted 21 November 2010 - 02:12 PM Edited by BnB, 21 November 2010 - 02:16 PM.

QUOTE (yair1221 @ Nov 21 2010, 16:09)
how does hex help you?
i mean it seriously...is it better than normal opcodes by anyway?

Most times hex is used to protect your code from stealing!

EUX adamant4
  • EUX adamant4

    Square Civilian

  • Members
  • Joined: 12 May 2009

#6

Posted 21 November 2010 - 02:51 PM Edited by EUX adamant4, 21 November 2010 - 02:57 PM.

hexadecimal is basically just an easier to read version of binary- there are a lot of uses to it that sometimes cant be done within the script, and requires reading from the memory (among other things xD).

saying that, i dont really see the point in using hex instead of traditional cleo scripting, but if you are really good at hex then it would make sense lol- harder for someone to modify your script smile.gif

Nahiyan
  • Nahiyan

    I'm awesome, and I'm a scripter

  • Members
  • Joined: 15 Oct 2010

#7

Posted 21 November 2010 - 04:02 PM Edited by Nahiyan, 21 November 2010 - 04:28 PM.

Hmm.. Looks easy..

So how do you use hex to make the game crash if.. nvm

EDIT : How do you use variables as a parameter in hex?

Deji
  • Deji

    Coding like a Rockstar!

  • Feroci
  • Joined: 24 Dec 2007
  • None
  • Contribution Award [Mods]

#8

Posted 21 November 2010 - 08:02 PM

But why code an opcode in hex yourself? That's what Sanny Builder is for!

The biggest use of the hex..end structure in Sanny Builder is to reserve thread memory, which can be written/read to/from. Another use is the ability to code raw ASM, which can be executed via the call_function opcodes.

Nahiyan
  • Nahiyan

    I'm awesome, and I'm a scripter

  • Members
  • Joined: 15 Oct 2010

#9

Posted 21 November 2010 - 08:28 PM

Because I don't want people to understand that the hex code is to prevent them modifying the script and if they don't know then they won't delete tounge.gif

toonskull
  • toonskull

    Necromancer

  • Members
  • Joined: 04 Aug 2009

#10

Posted 21 November 2010 - 10:10 PM

Programming code in HEX won't keep people from stealing. It is just a numbering system used by machines (base 16) that make programming a tad bit easier. If someone rips your code just expose them for the lame creep they are and let it go. Since SB can decompile code there is just no way to lock it up.

All programs can decompiled so I allow people to learn from any code I produce and hope they will give credit if they do a rebuild. Bottom line if you place a steal door on your house the thief will break a window to get inside.


Nahiyan
  • Nahiyan

    I'm awesome, and I'm a scripter

  • Members
  • Joined: 15 Oct 2010

#11

Posted 21 November 2010 - 10:32 PM Edited by Nahiyan, 22 November 2010 - 07:07 AM.

I put notes on my scripts and my name will appear during game-play so if they try to steal it...

Wait here what will happen -

CODE
{$CLEO .cs}

thread 'CHEK'

const
  Mod_Stolen
  Only_Copied
  People_Know_Its_Stolen
  How_They_Know
end  

while true
  if
     Mod_Stolen == 1
  then
     if
        Only_Copied == 1
     then
        0099: People_Know_its_Stolen = random_int_in_ranges_0_to_2
        if
           People_Know_Its_Stolen == 0
        then
           How_They_Know = "\"Author : Nahiyan\" written on the screen while playing GTA SA."
        end
        if
           People_Know_Its_Stolen == 1
        then
           How_They_Know = "I saw this mod on some other place before"
        end
        if
           People_Know_Its_Stolen == 2
        then
           How_They_Know = "I decompiled it and it had notes from the real author and his name"
        end    
     end

   { Game will crash because the stealer deleted the notes at the top/modified the script/whatever
     but did not know what the hex code at the bottom was and thought it was part of the script
     and it was needed. }  

  end  
end


Was too lazy to write the game crash part tounge.gif

Edit : Still looking for an answer... how do you use variables with hex?

TheSiggi
  • TheSiggi

    Surgeon

  • Members
  • Joined: 05 Jul 2009

#12

Posted 22 November 2010 - 12:30 PM

So if they steal it they'll change the name wow...whats the big differnce?

Deji
  • Deji

    Coding like a Rockstar!

  • Feroci
  • Joined: 24 Dec 2007
  • None
  • Contribution Award [Mods]

#13

Posted 22 November 2010 - 01:19 PM

It doesn't matter if you post it in hex.. it will still decompile as normal, plain opcodes (unless you mess something up.. and then the game wont work).

Nahiyan
  • Nahiyan

    I'm awesome, and I'm a scripter

  • Members
  • Joined: 15 Oct 2010

#14

Posted 22 November 2010 - 06:35 PM

Ahh nope.. Remember that option in sannybuilder? The "Add extra info to SCM"? If you check that then it will de-compile as hex, if not then it will de-compile as normal.

BnB
  • BnB

    return 0;

  • The Yardies
  • Joined: 28 Jun 2010
  • Saint-Vincent-and-the-Grenadines

#15

Posted 22 November 2010 - 06:50 PM Edited by BnB, 22 November 2010 - 06:58 PM.

QUOTE (Nahiyan @ Nov 22 2010, 20:35)
Ahh nope.. Remember that option in sannybuilder? The "Add extra info to SCM"? If you check that then it will de-compile as hex, if not then it will de-compile as normal.

Really? ... It doesn't work! Works only with previous SB versions!

TheSiggi
  • TheSiggi

    Surgeon

  • Members
  • Joined: 05 Jul 2009

#16

Posted 22 November 2010 - 06:52 PM

So what...think nobody has ever heared of something called a hex-editor? confused.gif

BnB
  • BnB

    return 0;

  • The Yardies
  • Joined: 28 Jun 2010
  • Saint-Vincent-and-the-Grenadines

#17

Posted 22 November 2010 - 06:59 PM

QUOTE (The_Siggi @ Nov 22 2010, 20:52)
So what...think nobody has ever heared of something called a hex-editor? confused.gif

I have it but wtf it does is a mystery!

Adler
  • Adler

    Hello, Smith. ( ´-`)ノ

  • Leone Family Mafia
  • Joined: 25 Jul 2009
  • None

#18

Posted 22 November 2010 - 07:27 PM

QUOTE (Nahiyan @ Nov 21 2010, 14:32)
I put notes on my scripts and my name will appear during game-play so if they try to steal it...

Wait here what will happen -

CODE
{$CLEO .cs}

thread 'CHEK'

const
  Mod_Stolen
  Only_Copied
  People_Know_Its_Stolen
  How_They_Know
end  

while true
  if
     Mod_Stolen == 1
  then
     if
        Only_Copied == 1
     then
        0099: People_Know_its_Stolen = random_int_in_ranges_0_to_2
        if
           People_Know_Its_Stolen == 0
        then
           How_They_Know = "\"Author : Nahiyan\" written on the screen while playing GTA SA."
        end
        if
           People_Know_Its_Stolen == 1
        then
           How_They_Know = "I saw this mod on some other place before"
        end
        if
           People_Know_Its_Stolen == 2
        then
           How_They_Know = "I decompiled it and it had notes from the real author and his name"
        end    
     end

   { Game will crash because the stealer deleted the notes at the top/modified the script/whatever
     but did not know what the hex code at the bottom was and thought it was part of the script
     and it was needed. }  

  end  
end


Was too lazy to write the game crash part tounge.gif

I'm not even gonna go into how pointless that script is. confused.gif

Nahiyan
  • Nahiyan

    I'm awesome, and I'm a scripter

  • Members
  • Joined: 15 Oct 2010

#19

Posted 22 November 2010 - 07:32 PM

QUOTE (Adler @ Nov 22 2010, 19:27)
QUOTE (Nahiyan @ Nov 21 2010, 14:32)
I put notes on my scripts and my name will appear during game-play so if they try to steal it...

Wait here what will happen -

CODE
{$CLEO .cs}

thread 'CHEK'

const
  Mod_Stolen
  Only_Copied
  People_Know_Its_Stolen
  How_They_Know
end  

while true
  if
     Mod_Stolen == 1
  then
     if
        Only_Copied == 1
     then
        0099: People_Know_its_Stolen = random_int_in_ranges_0_to_2
        if
           People_Know_Its_Stolen == 0
        then
           How_They_Know = "\"Author : Nahiyan\" written on the screen while playing GTA SA."
        end
        if
           People_Know_Its_Stolen == 1
        then
           How_They_Know = "I saw this mod on some other place before"
        end
        if
           People_Know_Its_Stolen == 2
        then
           How_They_Know = "I decompiled it and it had notes from the real author and his name"
        end    
     end

   { Game will crash because the stealer deleted the notes at the top/modified the script/whatever
     but did not know what the hex code at the bottom was and thought it was part of the script
     and it was needed. }  

  end  
end


Was too lazy to write the game crash part tounge.gif

I'm not even gonna go into how pointless that script is. confused.gif

Lol I made it only to explain to you guys what will happen if they try to steal it. smile.gif

and dontgetit.gif

coin-god
  • coin-god

    High Roller

  • $outh $ide Hoodz
  • Joined: 18 Mar 2007
  • None

#20

Posted 22 November 2010 - 07:56 PM

Nothing would happen, they would edit that.

Deji
  • Deji

    Coding like a Rockstar!

  • Feroci
  • Joined: 24 Dec 2007
  • None
  • Contribution Award [Mods]

#21

Posted 22 November 2010 - 08:54 PM

0099 generates a number between 0 and 32767.

Nahiyan
  • Nahiyan

    I'm awesome, and I'm a scripter

  • Members
  • Joined: 15 Oct 2010

#22

Posted 22 November 2010 - 08:59 PM

Oh thanks smile.gif




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users