Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function Headers
#3
(12-23-2012, 03:37 AM)eliot Wrote: The 16 last bytes are two 32bit integers, the former one represents the bytecode size in memory(when loaded) and the latter the bytes written in the file.

You only have to modify the former integer when editing the bytecodes.
Every token that references an object counts an additional 4 bytes.

All the other data is not relevant, TextPos and Line just means the character position and line the function was declared before it was compiled.

Generated output:
Code:
0x00000000 : CharToCorpse                    :UFunction                        => CharToCorpse(72)
0x00000000 : ExportSize                      :Int32                            => 230
0x00000000 : NetIndex                        :UIntProperty                     => iChar(71)
0x00000004 : NameIndex                       :String                           => None
0x0000000C : NextField                       :UScriptStruct                    => XGUnitVisibilityInformation(69)
Super
ScriptText
0x00000018 : Children                        :UIntProperty                     => iChar(71)
CppText
0x00000020 : Line                            :UInt32                           => 1712
0x00000024 : TextPos                         :UInt32                           => 41209
0x00000028 : ByteScriptSize                  :Int32                            => 179
0x0000002C : DataScriptSize                  :Int32                            => 167
0x000000D7 : NativeToken                     :UInt16                           => 0
0x000000D7 : OperPrecedence                  :Byte                             => 0
0x000000DA : FunctionFlags                   :FunctionFlags                    => Defined, Static, Public
0x000000DE : FriendlyNameIndex               :UNameTableItem                   => CharToCorpse

I eventually came to this understanding! Thanks for the reply however as it confirms my current work.

When fixing the load size of a script do I have to account for this anywhere else in the upk other than the function itself? as I am having difficulty getting code to work when I change the load size. For now I am working around this by keeping the load size the same when rewriting bytes?

(12-23-2012, 03:34 PM)twinj Wrote:
(12-23-2012, 03:37 AM)eliot Wrote: The 16 last bytes are two 32bit integers, the former one represents the bytecode size in memory(when loaded) and the latter the bytes written in the file.

You only have to modify the former integer when editing the bytecodes.
Every token that references an object counts an additional 4 bytes.

All the other data is not relevant, TextPos and Line just means the character position and line the function was declared before it was compiled.

Generated output:
Code:
0x00000000 : CharToCorpse                    :UFunction                        => CharToCorpse(72)
0x00000000 : ExportSize                      :Int32                            => 230
0x00000000 : NetIndex                        :UIntProperty                     => iChar(71)
0x00000004 : NameIndex                       :String                           => None
0x0000000C : NextField                       :UScriptStruct                    => XGUnitVisibilityInformation(69)
Super
ScriptText
0x00000018 : Children                        :UIntProperty                     => iChar(71)
CppText
0x00000020 : Line                            :UInt32                           => 1712
0x00000024 : TextPos                         :UInt32                           => 41209
0x00000028 : ByteScriptSize                  :Int32                            => 179
0x0000002C : DataScriptSize                  :Int32                            => 167
0x000000D7 : NativeToken                     :UInt16                           => 0
0x000000D7 : OperPrecedence                  :Byte                             => 0
0x000000DA : FunctionFlags                   :FunctionFlags                    => Defined, Static, Public
0x000000DE : FriendlyNameIndex               :UNameTableItem                   => CharToCorpse

I eventually came to this understanding! Thanks for the reply however as it confirms my current work.

When fixing the load size of a script do I have to account for this anywhere else in the upk other than the function itself? as I am having difficulty getting code to work when I change the load size. For now I am working around this by keeping the load size the same when rewriting bytes?

Reply


Messages In This Thread
Function Headers - by twinj - 12-22-2012, 03:07 PM
RE: Function Headers - by eliot - 12-23-2012, 03:37 AM
RE: Function Headers - by twinj - 12-23-2012, 03:34 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)