360haven works best with JavaScript enabled
Editing a time value
Loading
Register
Results 1 to 8 of 8
  1. #1
    Junior Member
    sss4 is offline
    Join Date : Jan 2012
    Posts : 8
    Array

    Editing a time value

    how would i go about finding a total time played value in a save file? i want to change it so that I can unlock some things in the game, but i have to have played it for many hours. If, for example, the total time played is 16 hours 30 minutes and 25 seconds, would i search for these values individually and find the place where they all line up or would they be stored as a different value?



    sorry, i'm new to this and i thought that i had a pretty good understanding of hex, but this has me confused.

  2. #2
    Hoshikage


    pureIso is offline
    Join Date : Jan 2011
    Location : somewhere In Ireland
    Posts : 2,733
    Array

    Re: Editing a time value

    Convert the time you have using TimeSpan c# data type.
    Downloads : 69 || Uploads : 22 || Rep Power : 5870 || Posts : 2,733 || Thanks : 557 || Thanked 2,970 Times in 735 Posts



    ## If you don't Contribute || Help - Why should I Contribute || Help - Leechers Should not be helped ##

  3. The Following 2 Users Say Thank You to pureIso For This Useful Post:


  4. #3
    Junior Member
    sss4 is offline
    Join Date : Jan 2012
    Posts : 8
    Array

    Re: Editing a time value

    i read about the TimeSpan c# data type, but i'm not sure I get it. For the example of 16 hours 30 minutes and 25 seconds would it be (0,16,32,25,0)?

    And would I search for a string that looks like that in a hex editor (after converting to hex that is)?

  5. #4
    Administrator
    Rpg_Fan

    Sephiroth is offline
    Join Date : Nov 2010
    Location : Setagaya-ku, Tokyo, Japan
    Posts : 3,322
    Array
    Twitter: @

    Re: Editing a time value

    You mean something like this?

    -

    -
    Downloads : 151 || Uploads : 12 || Rep Power : 6872 || Posts : 3,322 || Thanks : 488 || Thanked 4,199 Times in 1,282 Posts




    What i have shown you is reality. What you remember... that is the illusion.




  6. The Following 2 Users Say Thank You to Sephiroth For This Useful Post:


  7. #5
    Wisdom Sold Seperately

    8Ball is offline
    Join Date : Dec 2010
    Location : UK
    Posts : 575
    Array

    Re: Editing a time value

    This might be of use, though its in VB it should convert easily.
    Code:
         'Playtime Handlers
        Public Sub timelord()
            Dim ts As New TimeSpan(0, 0, timeread.Text)
            timebox.Text = (ts.ToString)
            End Sub
    It was for reading total game time and displaying it in the form of HH:MM:SS, i deduced it was stored in seconds via an educated guess, timespan should work for you nicely assuming the values aren't just a string like seph is showing.

    i clearly wrote the editor this came from while drunk, its a mess, but this is how i then converted the format back into seconds:

    Code:
     Public Sub timeshift()
            Try
                Dim time2sec As TimeSpan = TimeSpan.Parse(timebox.Text)
                timeread.Text = time2sec.TotalSeconds
            Catch ex As Exception
                MsgBox("Time must be in the format HH:MM:SS")
            End Try
        End Sub
    Code:
    timeshift()
                    Writer.WriteInt32(timeread.Text) 'playtime
    Downloads : 101 || Uploads : 18 || Rep Power : 3320 || Posts : 575 || Thanks : 51 || Thanked 462 Times in 200 Posts



  8. The Following 2 Users Say Thank You to 8Ball For This Useful Post:


  9. #6
    Junior Member
    sss4 is offline
    Join Date : Jan 2012
    Posts : 8
    Array

    Re: Editing a time value

    Thank you everyone for the help. I finally figured it out. the problem was that i wasnt sure what the time value was because the game gave me total play time instead of campain play time and online play time seperately. 8Ball's post was on point when he said that the value he was looking for was stored in seconds. my value was too, so i compared 2 different saves and found the difference, stored in seconds.

  10. #7
    kartleyBecil

    Re: Editing a time value

    i read about the TimeSpan c# data type, but i'm not sure I get it.

  11. #8
    Hoshikage


    pureIso is offline
    Join Date : Jan 2011
    Location : somewhere In Ireland
    Posts : 2,733
    Array

    Re: Editing a time value

    Quote Originally Posted by kartleyBecil View Post
    i read about the TimeSpan c# data type, but i'm not sure I get it.
    Look at 8Balls example.


    TimeSpan interval = new TimeSpan(2, 14, 18);
    Console.WriteLine(interval.ToString());// Displays "02:14:18".


    TimeSpan also have various properties you can call e.g: TimeSpan.Seconds, TimeSpan.Minutes

    Another Alternative

    /// <summary>Converts an Int64 FileTime to a DateTime</summary>
    /// <param name="input">The long value to convert</param>
    public static DateTime ToDateTime(long input)
    {
    try
    {
    //Contains a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).
    //This is usually stored in 8 byte in files - hex
    return DateTime.FromFileTime(input);//Converts long(FileTime) to local time
    }
    catch
    {
    return DateTime.Now;
    }
    }
    /// <summary>Converts a DateTime to an Int64 FileTime</summary>
    /// <param name="input">The date time input</param>
    /// <returns></returns>
    public static long ToInt64(DateTime input)
    {
    try
    {
    return input.ToFileTime();
    }
    catch
    {
    return DateTime.Now.ToFileTime();
    }
    }


    I hope that helps you. If you still don't understand then copy the code, run it and try step through the codes till you understand.
    Downloads : 69 || Uploads : 22 || Rep Power : 5870 || Posts : 2,733 || Thanks : 557 || Thanked 2,970 Times in 735 Posts



    ## If you don't Contribute || Help - Why should I Contribute || Help - Leechers Should not be helped ##

 

 

Similar Threads

  1. [Release] Source Engine Real Time Editing Tool
    By CRACKbomber in forum Xbox 360 Modding Programs
    Replies: 1
    Last Post: 09-27-2012, 01:27 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.
     

About 360haven

    360haven is an Forum Devoted To Game modding Fans from all over the world.

    An Awesome Community of Xbox 360 Gamers, Modders and Developers who Create & Share Tutorials, Applications, Gfx, Trainers and Gamesaves.

    A haven for the l33t.
    A scarce paradise for modders.

Like this page

Google+