Hex Editing Rosters

Patchmaking tutorials for NBA 2K13.

Re: Hex Editing Rosters

Postby daninoz on Thu Oct 11, 2012 9:44 am

Players rating (Jrue Holiday):

Overall - 40771.5

Individual Ratings - 40930.5 to 40967.5

40936.5 to 40937.5 did not changed.

I tried to change ratings one by one but it works weird. Changes in differents ratings, modified the same offset.

Tendencies (Holiday)

40967.5 to 41036.5

Hot Spots (Holiday)

41036.5 to 41067

Animations

Start at 40794 - 32 bytes

And 40893 - 31 bytes
Last edited by daninoz on Thu Oct 11, 2012 10:23 am, edited 3 times in total.
Image
User avatar
daninoz
 
Posts: 783
Joined: Tue Feb 06, 2007 6:32 am
Location: Tucuman, Argentina

Re: Hex Editing Rosters

Postby Mazzocchi on Thu Oct 11, 2012 9:47 am

Leftos wrote:http://forums.nba-live.com/viewtopic.php?f=149&t=88245

A lot of information to help you there. In short, Cheat Engine using the Player ID address will let you get the Player ID of any player as soon as you get them in the Edit Player screen.

Thanks for guiding me (Y)
User avatar
Mazzocchi
Resident Mavericks Fan (Since 1994)
 
Posts: 3132
Joined: Sat Oct 25, 2003 6:00 am
Location: The Darkside Of The Moon

Re: Hex Editing Rosters

Postby Leftos on Thu Oct 11, 2012 11:19 am

Wow, thanks for all the research solovoy! Don't know if I'll be able to implement all that before I leave on Friday for 5 days, but I'll surely get to it by the end of next week.

Amazing stuff. As to why different ratings may have changed the same byte, it's due to the fact that information in the rosters isn't necessarily byte-aligned this year. Which means that one rating may start somewhere inside a byte and end somewhere inside the next one, for example using the last 3 bits of one byte and first 5 bits of the next one to make for 8 bits, a byte, that is not aligned properly.

I have an eye for reading the ones and zeros behind the hex though, so I should be able to figure it out.

Here's the post I wrote on OS explaining this issue this year: http://www.operationsports.com/forums/n ... 2044285600

Again, big ups for your research. I'll make sure to implement everything you've researched and mention you in the credits. You guys make it so much easier for me.
Eleftherios "Leftos" Aslanoglou
NBA 2K AI Software Engineer
Visual Concepts Entertainment / 2K Sports

Used to be "That Tools Guy" around here during the good ol' days. Although you probably remember me as your favorite Podcast host.
User avatar
Leftos
I'm The Pipeline, The Pipeline Is Me
NBA 2K Developer
 
Posts: 5223
Joined: Sun Jun 07, 2009 7:44 am
Location: Novato, CA, USA

Re: Hex Editing Rosters

Postby JaoSming on Thu Oct 11, 2012 11:30 am

just to confirm, he killed it and I can get back to my midterms right?
Opinions are my own.

JaoSming
2KTV Producer
NBA 2K Developer
 
Posts: 29904
Joined: Tue Sep 13, 2005 12:45 am
Location: 2K

Re: Hex Editing Rosters

Postby Leftos on Thu Oct 11, 2012 11:49 am

Seems to be pretty much all I need. Falling asleep right now so I'll verify in 10 hours or so, if I do get around to programming Roster Editor tomorrow. I may focus mostly on preparing for the TOEFL and continuing my thesis' paper, so no promises there. Development should resume next Wed/Thu.
Eleftherios "Leftos" Aslanoglou
NBA 2K AI Software Engineer
Visual Concepts Entertainment / 2K Sports

Used to be "That Tools Guy" around here during the good ol' days. Although you probably remember me as your favorite Podcast host.
User avatar
Leftos
I'm The Pipeline, The Pipeline Is Me
NBA 2K Developer
 
Posts: 5223
Joined: Sun Jun 07, 2009 7:44 am
Location: Novato, CA, USA

Re: Hex Editing Rosters - Last Updated 10/6

Postby Patr1ck on Thu Oct 11, 2012 12:06 pm

Leftos wrote:Player Entry Length
Player entries, for whatever reason (to save size, most probably), aren't byte-aligned, which will be a bitch for people looking to hex-edit, as they'll have to take this into account. You can't just type byte values and be done with it, you'll have to edit the binary data starting at a certain point inside a byte and ending at another point at another byte.

However, with a hint from hyperballer21 about the player order in the roster, I've managed to find that player entries have a consistent size of 477 bytes and 5 bits. Just 3 damn bits away from being byte-aligned. Wouldn't imagine 2K would make it easy for us to hex-edit... But with this information in mind, we can break down the player table portion of the roster down in player entries, and try to crack more information in them.


So basically, when creating a program that can edit the roster, you can turn the roster into an editable format by adding 3 bits to each player entry which would align them byte-wise, and then removing the 3 bits upon saving?
Patr1ck
Administrator
Administrator
 
Posts: 13336
Joined: Thu May 19, 2005 5:54 pm
Location: Pasadena, California, US

Re: Hex Editing Rosters

Postby Leftos on Thu Oct 11, 2012 6:15 pm

It is possible, yeah. If we find the first piece of information (i.e. the first byte) of the player entries, then it should be doable to temporarily convert it to a byte-aligned format. Roster Editor doesn't do that, it works with the information as is (it was a nice test of my knowledge to see if I could implement that!), but it should be doable for people who just want to do regular hex-editing.

However, as I said, that requires knowledge of the first byte of one of the player entries, so that I can calculate the start-end offsets and realign properly so that you can hex-edit, and then be able to import these edits into Roster Editor which will then reset the alignment.

Also, if we want to be able to do byte-align other sections, they'll need separate research on entry length and starting offset. But for each section that we do that, I should be able to give you byte-aligned versions which should be easy to edit in a hex editor.
Eleftherios "Leftos" Aslanoglou
NBA 2K AI Software Engineer
Visual Concepts Entertainment / 2K Sports

Used to be "That Tools Guy" around here during the good ol' days. Although you probably remember me as your favorite Podcast host.
User avatar
Leftos
I'm The Pipeline, The Pipeline Is Me
NBA 2K Developer
 
Posts: 5223
Joined: Sun Jun 07, 2009 7:44 am
Location: Novato, CA, USA

Re: Hex Editing Rosters

Postby daninoz on Thu Oct 11, 2012 11:24 pm

I'm at work right now, so I don't have the hex editor. So, my question is: there is a bit mode view in Hex Workshop?

In case there isn't, I can translate the hex code to binary code and search for the changed bits. Then search for the start and finish of each 'byte' to get the order of the values.

Do you already work in some of the values, so I don't do duplicate work. When i get home, I'm gonna send you a PM to know where I can start.
Image
User avatar
daninoz
 
Posts: 783
Joined: Tue Feb 06, 2007 6:32 am
Location: Tucuman, Argentina

Re: Hex Editing Rosters

Postby Leftos on Thu Oct 11, 2012 11:50 pm

Just select any bytes and the data inspector on the right has a binary view as well.

I've finished work on ratings and tendencies (except which one is which, so ratings in the editor don't have names yet). Ratings are 0 to 255 and can be converted to real ratings by ((value / 3) + 25), while tendencies seem to be 0 to 99. Didn't see any tendency above 99.

Won't have time to work on your research on Hot Spots, Hot Zones and Animations until before Wednesday, so if you work on those a bit more until then, you'll make my life even easier.
Eleftherios "Leftos" Aslanoglou
NBA 2K AI Software Engineer
Visual Concepts Entertainment / 2K Sports

Used to be "That Tools Guy" around here during the good ol' days. Although you probably remember me as your favorite Podcast host.
User avatar
Leftos
I'm The Pipeline, The Pipeline Is Me
NBA 2K Developer
 
Posts: 5223
Joined: Sun Jun 07, 2009 7:44 am
Location: Novato, CA, USA

Re: Hex Editing Rosters

Postby Leftos on Fri Oct 12, 2012 12:57 am

NBA 2K13 Roster Hex Editing Research Tutorial

It's on Vimeo, so I can't embed unfortunately. YouTube took away my long video rights for whatever reason. Maybe the clip from an episode of Louie I uploaded got them mad.
Eleftherios "Leftos" Aslanoglou
NBA 2K AI Software Engineer
Visual Concepts Entertainment / 2K Sports

Used to be "That Tools Guy" around here during the good ol' days. Although you probably remember me as your favorite Podcast host.
User avatar
Leftos
I'm The Pipeline, The Pipeline Is Me
NBA 2K Developer
 
Posts: 5223
Joined: Sun Jun 07, 2009 7:44 am
Location: Novato, CA, USA

Re: Hex Editing Rosters

Postby daninoz on Fri Oct 12, 2012 6:27 am

Do you guys find anything related to Blacktop mode?

I was thinking about a tool that can make the research for us, but it only can work if there is a byte that it's the same for unlocked players and different for locked players.

The idea of the tool is very simple. It starts in any bit, and take a byte, then skip the size of a player data (477 bytes and 5 bits, i guess) and take another byte. It make this another 8-9 times and compare the results.

All the values must be the same, except for the first one and the fifth (Holiday and Bynum). If it's the case, it shows the address for every player. If not, the tool start with the next bit.
Image
User avatar
daninoz
 
Posts: 783
Joined: Tue Feb 06, 2007 6:32 am
Location: Tucuman, Argentina

Re: Hex Editing Rosters

Postby Leftos on Fri Oct 12, 2012 6:33 am

I could program this, come next Wednesday. Should take an hour tops.
Eleftherios "Leftos" Aslanoglou
NBA 2K AI Software Engineer
Visual Concepts Entertainment / 2K Sports

Used to be "That Tools Guy" around here during the good ol' days. Although you probably remember me as your favorite Podcast host.
User avatar
Leftos
I'm The Pipeline, The Pipeline Is Me
NBA 2K Developer
 
Posts: 5223
Joined: Sun Jun 07, 2009 7:44 am
Location: Novato, CA, USA

Re: Hex Editing Rosters

Postby daninoz on Fri Oct 12, 2012 6:43 am

Ok, great. I also will try to make a tool this weekend. I don't know much about desktop programming, I'm work with websites, but I will take a look to your code.
Image
User avatar
daninoz
 
Posts: 783
Joined: Tue Feb 06, 2007 6:32 am
Location: Tucuman, Argentina

Re: Hex Editing Rosters

Postby Leftos on Fri Oct 12, 2012 6:45 am

Sure, feel free. The libraries for reading and writing bytes and bits that aren't byte-aligned are already in there in the Roster Editor source code, so you shouldn't have to do a lot of work.
Eleftherios "Leftos" Aslanoglou
NBA 2K AI Software Engineer
Visual Concepts Entertainment / 2K Sports

Used to be "That Tools Guy" around here during the good ol' days. Although you probably remember me as your favorite Podcast host.
User avatar
Leftos
I'm The Pipeline, The Pipeline Is Me
NBA 2K Developer
 
Posts: 5223
Joined: Sun Jun 07, 2009 7:44 am
Location: Novato, CA, USA

Re: Hex Editing Rosters

Postby daninoz on Fri Oct 12, 2012 9:08 am

Ok. I made a code in PHP and I'm not anything sure but I may found something. I'm going to make some more tests.

EDIT:

With my tool, I couldn't found anything. I tried from 1 bit to 32 bytes, but nothing.

solovoy is sad.

EDIT2: The code I made was this:

Code: Select all
<?php
       
$data = file_get_contents('binary_data.txt');
// The hex from the roster already converted to binary base.
// I start in offset 40271 (500 before the a know data  from Holiday) and 15500 bytes after that. 
for ($cont_b = 1; $cont_b <= 256; $cont_b++) {
   $could = 0;
   for ($cont_a = 0;$cont_a < 1000;$cont_a++) {
      $datum = substr($data,$cont_a);
      
      
      for ($i=0;$i<30;$i++) {
         $address[$i] = substr($datum, 3821*$i,$cont_b);
      }
      
      //Array with locked  id players in the range 0 - 30.
      $locked_array = array(0,4,25,26);
      $unlocked = $address[1];
      
      // If the id is from a locked players, check that the value is the same as the other unlocked player. If not, check that is different. $could is only a flag var.
      foreach ($address as $id => $valor) {
         if (!in_array($id,$locked_array)) {
            if ($valor == $unlocked) {
               $could = $could;
            } else {
               $could++;
            }
         } else {
            if ($valor != $unlocked) {
               $could = $could;
            } else {
               $could++;
            }
         }
      }
      
      // If the tool found something, show the lenght of the code, the relative address and the values
      if ($could == 0) {
         echo $cont_b;
         echo '<br />';      
         echo $cont_a;
         echo '<br />';
         foreach ($address as $add) {
            echo $add.'<br />';
         }
      }
      
      $could = 0;
      
   }
}
Image
User avatar
daninoz
 
Posts: 783
Joined: Tue Feb 06, 2007 6:32 am
Location: Tucuman, Argentina

Re: Hex Editing Rosters

Postby daninoz on Sun Oct 14, 2012 2:43 am

The new Turbo Trainer include a value named Player ID, it's not the player ID that Leftos search for, but a Player ID wich is the same as the Portrait ID.

Apparently, 2K check the locked players with that ID, if you change that ID for any other, the player is Unlocked.

In the roster, there are three different address that changed, besides the CRC32 one.

Both rosters, the original and the one with Holiday unlocked are attached.
You do not have the required permissions to view the files attached to this post.
Image
User avatar
daninoz
 
Posts: 783
Joined: Tue Feb 06, 2007 6:32 am
Location: Tucuman, Argentina

Re: Hex Editing Rosters

Postby Leftos on Sun Oct 14, 2012 3:12 am

Hmmm, interesting. Are we sure that ID doesn't affect anything else player-wise? Well, even if it does, we can just make a roster that has all the players unlocked for Blacktop and be done with it.
Eleftherios "Leftos" Aslanoglou
NBA 2K AI Software Engineer
Visual Concepts Entertainment / 2K Sports

Used to be "That Tools Guy" around here during the good ol' days. Although you probably remember me as your favorite Podcast host.
User avatar
Leftos
I'm The Pipeline, The Pipeline Is Me
NBA 2K Developer
 
Posts: 5223
Joined: Sun Jun 07, 2009 7:44 am
Location: Novato, CA, USA

Re: Hex Editing Rosters

Postby daninoz on Sun Oct 14, 2012 3:36 am

Leftos wrote:Hmmm, interesting. Are we sure that ID doesn't affect anything else player-wise? Well, even if it does, we can just make a roster that has all the players unlocked for Blacktop and be done with it.


Not sure about anything. If I make the roster with all the players unlocked, I will use it for blacktop mode only.
Image
User avatar
daninoz
 
Posts: 783
Joined: Tue Feb 06, 2007 6:32 am
Location: Tucuman, Argentina

Re: Hex Editing Rosters

Postby JaoSming on Sun Oct 14, 2012 3:45 am

iirc, the audioID in the REDitor (same as portrait and cf id) in 2K11 and previous games were what limited players from entering the Dunk Contest. So, not too surprising, even if I forgot about it.
Opinions are my own.

JaoSming
2KTV Producer
NBA 2K Developer
 
Posts: 29904
Joined: Tue Sep 13, 2005 12:45 am
Location: 2K

Re: Hex Editing Rosters

Postby Leftos on Sun Oct 14, 2012 3:52 am

Well, another parameter to add to the Roster Editor then! solovoy, big props.
Eleftherios "Leftos" Aslanoglou
NBA 2K AI Software Engineer
Visual Concepts Entertainment / 2K Sports

Used to be "That Tools Guy" around here during the good ol' days. Although you probably remember me as your favorite Podcast host.
User avatar
Leftos
I'm The Pipeline, The Pipeline Is Me
NBA 2K Developer
 
Posts: 5223
Joined: Sun Jun 07, 2009 7:44 am
Location: Novato, CA, USA

Re: Hex Editing Rosters

Postby daninoz on Sun Oct 14, 2012 3:57 am

I played a game between DRose and Dwade, but the audio was there. If it doens't change anything in Blacktop mode, there is no reason to not use it. Blacktop mode only.
Image
User avatar
daninoz
 
Posts: 783
Joined: Tue Feb 06, 2007 6:32 am
Location: Tucuman, Argentina

Re: Hex Editing Rosters

Postby Leftos on Sun Oct 14, 2012 3:59 am

It could be connected to the various pre-recorded non-dynamic stories that are told about each player, like about how they did last season. Still, should help anyone make a Blacktop only roster.
Eleftherios "Leftos" Aslanoglou
NBA 2K AI Software Engineer
Visual Concepts Entertainment / 2K Sports

Used to be "That Tools Guy" around here during the good ol' days. Although you probably remember me as your favorite Podcast host.
User avatar
Leftos
I'm The Pipeline, The Pipeline Is Me
NBA 2K Developer
 
Posts: 5223
Joined: Sun Jun 07, 2009 7:44 am
Location: Novato, CA, USA

Re: Hex Editing Rosters

Postby JaoSming on Sun Oct 14, 2012 4:56 am

which would be very worth it, lol
Opinions are my own.

JaoSming
2KTV Producer
NBA 2K Developer
 
Posts: 29904
Joined: Tue Sep 13, 2005 12:45 am
Location: 2K

Re: Hex Editing Rosters

Postby Leftos on Tue Oct 16, 2012 1:26 am

What did we do to fix black arms last year? Seems to be one of the most asked for things right now. Is it something we can change in the roster, or is it in the cyberface IFF files?
Eleftherios "Leftos" Aslanoglou
NBA 2K AI Software Engineer
Visual Concepts Entertainment / 2K Sports

Used to be "That Tools Guy" around here during the good ol' days. Although you probably remember me as your favorite Podcast host.
User avatar
Leftos
I'm The Pipeline, The Pipeline Is Me
NBA 2K Developer
 
Posts: 5223
Joined: Sun Jun 07, 2009 7:44 am
Location: Novato, CA, USA

Re: Hex Editing Rosters

Postby JaoSming on Tue Oct 16, 2012 1:32 am

last year using a portrait ID of 2203 overrode the arm textures

this year that doesnt work, which isnt surprising since 2K doesn't need to update rookies. So editing the iff files is the way to do.
Opinions are my own.

JaoSming
2KTV Producer
NBA 2K Developer
 
Posts: 29904
Joined: Tue Sep 13, 2005 12:45 am
Location: 2K

PreviousNext

Return to NBA 2K13 Tutorials & FAQs

Who is online

Users browsing this forum: No registered users and 0 guests