Hex Editing Rosters

Patchmaking tutorials for NBA 2K13.

Hex Editing Rosters

Postby Leftos on Sat Oct 06, 2012 11:06 pm

All my offsets are decimals.

Signature Skills
UPDATE #1: Signature Skills, just like everything else it seems, are not byte-aligned. They're 6-bit enums (which makes sense, since there's 33 of them), and I've verified this. I was able to copy Defensive Anchor from Signature Skill 5 to Signature Skill 4 (and give a player 2 defensive anchors :P) by copying 011111 to the 6 bits right to their left.

UPDATE #2: Think I've cracked the Signature Skills format. For each player, the format is as follows:
6 bits (SS1) + 6 bits (SS2) + 14 bits set to 0 (???) + 6 bits (SS3) + 6 bits (SS4) + 6 bits (SS5).

It's too bad you have to find out the alignment for yourself, but setting Signature Skill 1 to Defensive Anchor which makes it 011111 should help you find the start of the sig skills for that player. Just the same way, setting Signature Skill 5 to Defensive Anchor and counting 44 bits backwards from the end of the 011111 should lead you to the start of the sig skills entry for that player.

Maybe if we figure out the length in bits of each player entry, we could automate this, but for that I would need to know two players that are in consecutive entries in the roster, so that I could measure the distance between their signature skills entries, which should be the player entry length.


UPDATE #3: The Signature Skills enum follows the order of the signature skills in the selection menu in-game. So it's as follows:
Code: Select all
000001: Posterizer
000010: Highlight Film
000011: Finisher
000100: Acrobat
000101: Spot Up Shooter
000110: Shot Creator
000111: Deadeye
001000: Corner Specialist
001001: Post Proficiency
001010: Ankle Breaker
001011: Post Playmaker
001100: Dimer
001101: Break Starter
001110: Alley-Ooper
001111: Brick Wall
010000: Lockdown Defender
010001: Charge Card
010010: Interceptor
010011: Pick Pocket
010100: Active Hands
010101: Eraser
010110: Chasedown Artist
010111: Bruiser
011000: Hustle Points
011001: Scraper
011010: Anti-Freeze
011011: Microwave
011100: Heat Retention
011101: Closer
011110: Floor General
011111: Defensive Anchor


1. Save a roster before the changes. Save it a second time under a different name, so that Autosave doesn't replace your original after the edits.
2. Change all 5 signature skills. Even if the player has only 1, assign all 5 of them, and make sure to change any existing ones to ones he didn't have before.
3. Let the game autosave the new roster.
4. Open both rosters in Hex Workshop.
5. Do a Tools > Compare > Resynchronizing Compare.
6. You'll see 4 bytes changed at offset 0, (maybe) 4 bytes changed at offset 863052, and maybe about 54000 bytes changed at the bottom of the file. Ignore them. What you care about is the 5 or 6 bytes that were changed that aren't at those 3 offsets/ranges.
7. Now comes the hard part. In the bytes that you've tracked down, there's a 44-bit long piece of information that is the Signature Skills part of the player's entry. I recommend setting either the first or last signature as Defensive Anchor in-game, which has a binary representation of 011111, so you'll be able to know which 4 bits of the 6 bytes that were changed are not part of the SS entry by following the information in Update #2 above. Once you know which 44 bits are the ones you want, you can change any of the signature skills to 000000 (no signature skill set) or to anything between 000001 (1) and 011111 (31) which are the 31 signature skills available (without the 2 MyCareer exclusive ones).
8. Recalculate the roster's CRC32, save, load in-game.
Example: Andrew Bynum's range seems to be 42826-42832

Recalculating Roster Checksums
1. Select the whole file except the first 4 bytes.
2. Go to Tools > Generate Checksum > Selection & CRC32 > OK.
3. The checksum will appear at the bottom-right.
4. Select the first 4 bytes and type in the checksum as you see it on the bottom-right. Copy-pasting could paste the values in the opposite order, so just type them in.
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 JaoSming on Sat Oct 06, 2012 11:14 pm

For those using the CRC32 program from years past, you want to use the top option in the drop down, the C++ Assembly, and again, just copy the checksum into the front of the file without reversing the bytes like we had to in years past.
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 - Last Updated 10/6

Postby Leftos on Sun Oct 07, 2012 7:53 pm

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.
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 JaoSming on Sun Oct 07, 2012 8:08 pm

wouldnt it be 479 and 1 bit?
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 - Last Updated 10/6

Postby Leftos on Sun Oct 07, 2012 11:13 pm

Huh? Why?
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 JaoSming on Sun Oct 07, 2012 11:18 pm

because it was 5am and I understood what you were talking about completely.

disregard that, 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 - Last Updated 10/6

Postby Leftos on Mon Oct 08, 2012 8:10 am

TeamID & IsFA (in progress)
Okay, so I've been trying to assign FA players to the Bobcats to see what values get changed, to maybe find TeamID & IsFA so that we can later on find hidden players.

307-308 bytes before first signature skill:
The following bit pattern appears:
10000101
with zeros left and right, whereas when the player is a free agent, this pattern is all zeros.

2-3 bytes after that (or 17 bits, if you will):
Here's the Team ID. Again, this is not the Team ID used in sXXX and fXXX and uhXXX and so on, it's the team's order in the roster, which is alphabetical for the current teams as always. 00 76ers, 01 Bobcats, 02 Bucks, 03 bulls, etc. This information isn't byte aligned, but its last bit is always 17 bits to the right of the last 1 of the above pattern.

EDIT:
Actually, the above value, although it changes, didn't seem to control anything. I've found another value that adjusts to the TeamID, and it's 263 bytes after the byte pattern mentioned above.

EDIT 2: Sure enough, this second value changed the logo behind the player. We won't be able to reassign players until we found the teams part of the roster, along with PlNum and the Roster spots, but we're making progress! :D

30-31 bytes after that:
There's another bit that always changes from 0 to 1 when the player is signed to a team from free agency.

I've been programming and researching for 17 hours straight, so I'm about to hit the bed. If anyone can help with this, be my guest.

To see what I'm seeing, start with a default roster and sign the same player to different teams. Keep a different roster save each time and compare them in Hex Workshop or however you like. You can also sign other players to the same team to notice the similarities, or check out players that are already signed with that team.

To find the offset of a player's signature skill (and go back 307 bytes from that), load a roster in my Roster Editor, enter the player's ID, click Refresh, and the tool should show you the decimal offset in bytes and bits.

Image
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 Leftos on Mon Oct 08, 2012 7:48 pm

Skills (Ratings) (in progress)
In roster.iff, skills are offset 352 bytes from the start of a player entry, at least Shot Inside is, if it is the first one. For example, Jrue Holiday's Shot Inside rating is at offset 20984.

Skills are saved as one byte each, and their value is calculated as follows:
Value = (Skill - 25) * 3

In roster.ros, skills are offset 14 bytes and 3 bits from the first signature skill of the player. For example, Jrue Holiday's first signature skill is offset 40916 bytes and 2 bits from the start of the file. His Shot Inside rating is offset 40930 bytes and 5 bits from the start of the file.
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 eda on Tue Oct 09, 2012 3:43 am

Any chances of a tool that could let us assign cfs for CAPs?
Last edited by eda on Tue Oct 09, 2012 6:11 am, edited 1 time in total.
User avatar
eda
FIBA 2k FatheR
 
Posts: 1079
Joined: Thu Dec 16, 2004 5:17 am
Location: Lithuania,Vilnius

Re: Hex Editing Rosters - Last Updated 10/6

Postby Leftos on Tue Oct 09, 2012 3:45 am

That would require finding the GenericF and CFID values, which without a trainer I don't think I'll be able to find.
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 JaoSming on Tue Oct 09, 2012 4:09 am

afaik that turbo trainer does 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 - Last Updated 10/6

Postby eda on Tue Oct 09, 2012 6:11 am

But it has not yet been translated,right?
User avatar
eda
FIBA 2k FatheR
 
Posts: 1079
Joined: Thu Dec 16, 2004 5:17 am
Location: Lithuania,Vilnius

Re: Hex Editing Rosters - Last Updated 10/6

Postby Jarus on Tue Oct 09, 2012 6:23 am

no one here knows BOTH chinese and english??
Image
User avatar
Jarus
 
Posts: 401
Joined: Thu Apr 30, 2009 3:50 am
Location: Behind the Arc

Re: Hex Editing Rosters - Last Updated 10/6

Postby Leftos on Tue Oct 09, 2012 12:35 pm

Portrait ID: SignatureSkill1Offset - 300 bytes - 2 bits (unsigned 16-bit integer)
CF ID: PortraitIDOffset + 30 bytes (unsigned 16-bit integer)
GenericF: CFIDOffset + 96 bytes + 1 bit (1 bit boolean)

Whoever finds PlType gets a thousand cookies.
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 JaoSming on Tue Oct 09, 2012 1:34 pm

heeeeeeeeeeey sexy Leeeeeftos, hope you slept good, this took me all of 2 minutes, lol.


1A "up" the file from the beginning of the CFID. Same exact format as 2k12 in the iff file, you can figure out the ROS files.

IFF FILE
Image


ROS FILES
Image
You do not have the required permissions to view the files attached to this post.
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 - Last Updated 10/6

Postby Leftos on Tue Oct 09, 2012 6:22 pm

Thanks Jao. Will implement this as soon as I can open my eyes more than half a centimeter.
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 Tue Oct 09, 2012 10:31 pm

Next in the menu, TeamID and IsFA, so that we can hide retired and overseas players. If you think you can help Jao, feel free, otherwise I'll try to do some more research on them.

Here's what I got from my previous research:
viewtopic.php?p=1552460#p1552460
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 Wed Oct 10, 2012 8:30 am

The offset for HEx Workshop for birthday is this:

0000A621

I'm gonna use this pic to explain myself:

Image

The first two hex numbers (C3) are for the year. I don't know if that 7 is related but 7C3 is 1987, Bynum's Birth year.

The next hex number is for the month (1 is january and C is December).

And the last 3 hex numbers are for the day. 0B0 is 1 and then you have to add 80 (130 is 2, 1B0 is 3, etc).
Image
User avatar
daninoz
 
Posts: 783
Joined: Tue Feb 06, 2007 6:32 am
Location: Tucuman, Argentina

Re: Hex Editing Rosters

Postby JaoSming on Wed Oct 10, 2012 1:56 pm

my time has run out for the day,

here are my 2k12 rosters ready to be compared though. all Jrue holiday edits, if it was 0, it turned to 1 for those specific values/rosters.

what I've done is edit in reditor, load/save in 2k12 to uniform the file up, see what changed, make change in the .iff, and then reset roster in 2k13.

included are body(type), isFA, shirt (yes, for me, I didnt mean to rar it), skintone, then teamID (although I dont see the point for teamID, it only changes the background logo for the portrait)
You do not have the required permissions to view the files attached to this post.
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 Wed Oct 10, 2012 7:52 pm

Thanks for the research solovoy and Jao. Some new things to implement today it seems! Now if I could only find why some players don't show up correctly in the tool when using 360 rosters, and I'm ready to take my 3-day holiday come Friday.

Keep researching whatever you think is worth editing, and I'll get it in the tool.
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 12:26 am

What if we make two different players CAP, then we edit one to be exactly the same as the other player and then we search for differences.

Yesterday, I tried that but i had a problem with the name. I tried to change Jrue Holiday name to Jason Richardson, but it changes the name to 'on RichardsonJas' or something like that, don't know why.
Image
User avatar
daninoz
 
Posts: 783
Joined: Tue Feb 06, 2007 6:32 am
Location: Tucuman, Argentina

Re: Hex Editing Rosters

Postby homicide1550 on Thu Oct 11, 2012 12:28 am

can we still change the team colors, collars & socks color just like how we could do it in 2K12?
Visit my Facebook page: Kicksfix: homicide1550

Image
Click image to view the thread!

KicksFix 2K12 2K13
(Live08) RISE UP! A Cleveland Cavaliers Dynasty

Ranked 7th, Top 10 Dynasty Hall of Fame


Image
User avatar
homicide1550
Quality Over Quantity
 
Posts: 2078
Joined: Sat Oct 06, 2007 10:11 pm
Location: Las Islas Filipinas

Re: Hex Editing Rosters

Postby Leftos on Thu Oct 11, 2012 7:22 am

Anybody want to bother researching player ratings and tendencies so that if a nice roster comes for 360 for example, we can copy those values over to our PC rosters?

What I need is:
- Start and end of ratings table, start and end of tendencies table (should be easy to do, just edit all the ratings and tendencies of a player (say add 1 point to everything) and give me the before and after rosters; one with no changes, one with all the ratings and tendencies a point up).
- Numeric type (although I think we know that already due to the trainer).
- Order in which ratings are saved. This will require a bit more work, as you need to edit each rating one at a time. Although, this is optional. We can just see how a player's skills are stored after we have the above two pieces of information and match his ratings in the roster to the ones in-game, and see which rating in the roster is which in-game.

Hot zones, hot spots and animations would be nice to have as well, so that we can copy-paste them easily from roster to 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 Mazzocchi on Thu Oct 11, 2012 8:55 am

Don't mind me being dumb, but what's the easiest way to find a players Player ID so I can change their cyberface by using Leftos roster editor? And can I use this method to give a CAP a cyberface?
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 9:13 am

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.
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

Next

Return to NBA 2K13 Tutorials & FAQs

Who is online

Users browsing this forum: No registered users and 1 guest