Last active
October 6, 2015 19:06
-
-
Save taddeimania/86803eb10d10b3e0ae44 to your computer and use it in GitHub Desktop.
Reading Home / Away team from Tecmo Super Bowl savestate in C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include<stdio.h> | |
int main() | |
{ | |
unsigned char buffer[10000]; | |
char home[2]; | |
FILE *ptr; | |
ptr = fopen("1.nst","rb"); | |
fseek(ptr, 0, SEEK_CUR); | |
fread(buffer, sizeof(buffer), 1, ptr); | |
/* home team name */ | |
for(int i = 0; i <= sizeof(home) ; i++) { | |
home[i] = buffer[3087 + i]; | |
} | |
printf("Home: %s\n", home); | |
/* away team name */ | |
char away[2]; | |
for(int i = 0; i <= sizeof(away) ; i++) { | |
away[i] = buffer[3087 + 32 + i]; | |
} | |
printf("Away: %s\n", away); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment