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: 5285
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.
Right Click Loop
phpBB [video]

https://www.youtube.com/playlist?list=PL8ozxhwwmz4LJzpGAj22T5qa0ZVFBJ3yw

User avatar
JaoSming
2KTV Producer
NBA 2K Developer
 
Posts: 29831
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: 5285
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?
Right Click Loop
phpBB [video]

https://www.youtube.com/playlist?list=PL8ozxhwwmz4LJzpGAj22T5qa0ZVFBJ3yw

User avatar
JaoSming
2KTV Producer
NBA 2K Developer
 
Posts: 29831
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: 5285
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
Right Click Loop
phpBB [video]

https://www.youtube.com/playlist?list=PL8ozxhwwmz4LJzpGAj22T5qa0ZVFBJ3yw

User avatar
JaoSming
2KTV Producer
NBA 2K Developer
 
Posts: 29831
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: 5285
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: 5285
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
Lives happily ever after.
 
Posts: 922
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: 5285
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
Right Click Loop
phpBB [video]

https://www.youtube.com/playlist?list=PL8ozxhwwmz4LJzpGAj22T5qa0ZVFBJ3yw

User avatar
JaoSming
2KTV Producer
NBA 2K Developer
 
Posts: 29831
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
Lives happily ever after.
 
Posts: 922
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: 5285
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.
Right Click Loop
phpBB [video]

https://www.youtube.com/playlist?list=PL8ozxhwwmz4LJzpGAj22T5qa0ZVFBJ3yw

User avatar
JaoSming
2KTV Producer
NBA 2K Developer
 
Posts: 29831
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: 5285
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: 5285
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: 784
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.
Right Click Loop
phpBB [video]

https://www.youtube.com/playlist?list=PL8ozxhwwmz4LJzpGAj22T5qa0ZVFBJ3yw

User avatar
JaoSming
2KTV Producer
NBA 2K Developer
 
Posts: 29831
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: 5285
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: 784
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: 2075
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: 5285
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: 3130
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: 5285
Joined: Sun Jun 07, 2009 7:44 am
Location: Novato, CA, USA

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: 784
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: 3130
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: 5285
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?
Right Click Loop
phpBB [video]

https://www.youtube.com/playlist?list=PL8ozxhwwmz4LJzpGAj22T5qa0ZVFBJ3yw

User avatar
JaoSming
2KTV Producer
NBA 2K Developer
 
Posts: 29831
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: 5285
Joined: Sun Jun 07, 2009 7:44 am
Location: Novato, CA, USA

Re: Hex Editing Rosters - Last Updated 10/6

Postby Pdub 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?
Pdub
Administrator
Administrator
 
Posts: 13182
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: 5285
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: 784
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: 5285
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: 5285
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: 784
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: 5285
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: 784
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: 5285
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: 784
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: 784
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: 5285
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: 784
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.
Right Click Loop
phpBB [video]

https://www.youtube.com/playlist?list=PL8ozxhwwmz4LJzpGAj22T5qa0ZVFBJ3yw

User avatar
JaoSming
2KTV Producer
NBA 2K Developer
 
Posts: 29831
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: 5285
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: 784
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: 5285
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
Right Click Loop
phpBB [video]

https://www.youtube.com/playlist?list=PL8ozxhwwmz4LJzpGAj22T5qa0ZVFBJ3yw

User avatar
JaoSming
2KTV Producer
NBA 2K Developer
 
Posts: 29831
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: 5285
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.
Right Click Loop
phpBB [video]

https://www.youtube.com/playlist?list=PL8ozxhwwmz4LJzpGAj22T5qa0ZVFBJ3yw

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

Next

Return to NBA 2K13 Tutorials & FAQs

Who is online

Users browsing this forum: No registered users and 1 guest