Hacking I'd like to learn how to analyze files

Pikachuk

Well-Known Member
OP
Member
Joined
Mar 19, 2016
Messages
767
Trophies
0
Age
23
Location
Bordeaux
XP
745
Country
France
Hello, i'm currently interested by the research of new ways to modify files and things like this but i don't find documentation to learn how to analyze files on hex editor to recognize header/ blank parts (all the parts) and how to modify from the informations obtained
I'm really interested even if it requires work, i'd just like to find documentation to learn
 

Pikachuk

Well-Known Member
OP
Member
Joined
Mar 19, 2016
Messages
767
Trophies
0
Age
23
Location
Bordeaux
XP
745
Country
France
Yes that's why i'm searching basic documentation that would help to recognize different parts of files
I know the basics of C# i would just have to learn the rest to create tools but to create tools i've need to understand the structure of the files i want to modify
 

Hikari06

Well-Known Member
Member
Joined
Nov 20, 2012
Messages
999
Trophies
0
XP
936
Country
Ecuador
Yes that's why i'm searching basic documentation that would help to recognize different parts of files,
I know the basics of C# i would just have to learn the rest to create tools but to create tools i've need to understand the structure of the files i want to modify
There is no magical way, each format is different.
Either you have a proper documentation with offsets and all and that's just a matter a properly parsing it.
Otherwise you have to r.e the structure yourself. Usually it's done by comparing several versions of the file with one or more variables which you know. Depending on the complexity of the format it may be very easy or quite hard if you have to deal with compression, checksums etc...
 
Last edited by Hikari06,

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
It might be better to look at a more documented system, like the DS, but if the wii u is what will retain your interest it is not so bad.

Even without that there are loads of people that pulled apart file formats before, some of it might not apply to your systems (though things rarely go completely out of fashion) but more info in your head is not a bad thing.
http://wiki.xentax.com/index.php/Game_File_Format_Central
https://wiki.multimedia.cx/index.php?title=Category:Game_Formats

In my case there are three things I would look at

1) Pointers. They are something of a boogeyman for C family programmers, and most courses don't teach them in the best way. They do much like they say though and indicate the location of something within a file or memory. Sometimes they will start counting from the start of the file, sometimes it will be a little way in (usually from the end of the given section or start of the one you want), sometimes they will be relative (take the location you are at and add the data from the pointer) and sometimes they will have some kind of crazy maths done to it (a few times I have had pointer contents need to be shifted to display the proper data)
2) The hardware. Hardware is rather limited and only displays things in certain formats and converting on the fly is a pain. To that end many formats will mirror the hardware they are going to go into at some level, or at the very least play to it -- if your system does 16 bit reads especially well you might well have a format aligned to 16 bits rather than everything packed end to end. I don't know what I can point you at for a summary of wii u hardware, however it is very similar to the wii and gamecube so it can be worth learning what goes there
http://wiibrew.org/wiki/Main_Page
http://hitmen.c02.at/files/yagcd/yagcd/frames.html
3) High level formats. Despite what I said above about hardware there are many that will use known, be it in general world or in game specifically (or in whatever other field you are using), formats for their things as said formats may well have existing conversion code, and have solved all the problems likely to come up which saves a lot of effort.

I could go on and talk about text specifics, 2d graphics, 3d graphics, wave music, sample music, level designs, general game code, assembly and whatever else but I won't do it here, mainly as I have done it before with pictures and worked examples http://gbatemp.net/threads/gbatemp-rom-hacking-documentation-project-new-2016-edition-out.73394/
 
  • Like
Reactions: VinsCool

Pikachuk

Well-Known Member
OP
Member
Joined
Mar 19, 2016
Messages
767
Trophies
0
Age
23
Location
Bordeaux
XP
745
Country
France
There is no magical way, each format is different.
Either you have a proper documentation with offsets and all and that's just a matter a properly parsing it.
Otherwise you have to r.e the structure yourself. Usually it's done by comparing several versions of the file with one or more variables which you know. Depending on the complexity of the format it may be very easy or quite hard if you have to deal with compression, checksums etc...
I know, each file is special i don't search to have all the job done i search more something that could help me get started for example i'm not able to add bytes to a file without making it crashing and things like this
 

Hikari06

Well-Known Member
Member
Joined
Nov 20, 2012
Messages
999
Trophies
0
XP
936
Country
Ecuador
I know, each file is special i don't search to have all the job done i search more something that could help me get started for example i'm not able to add bytes to a file without making it crashing and things like this
Well that's because you can't just append data to a file without knowing the structure first.
I believe you really should start with easy file formats and try to understand how they work, then code a parser to handle them.
For instance, try writing a tmd parser :https://3dbrew.org/wiki/Title_metadata.
It's already been done but practice makes perfect as they say.
 

Hikari06

Well-Known Member
Member
Joined
Nov 20, 2012
Messages
999
Trophies
0
XP
936
Country
Ecuador

Pikachuk

Well-Known Member
OP
Member
Joined
Mar 19, 2016
Messages
767
Trophies
0
Age
23
Location
Bordeaux
XP
745
Country
France
It might be better to look at a more documented system, like the DS, but if the wii u is what will retain your interest it is not so bad.

Even without that there are loads of people that pulled apart file formats before, some of it might not apply to your systems (though things rarely go completely out of fashion) but more info in your head is not a bad thing.
http://wiki.xentax.com/index.php/Game_File_Format_Central
https://wiki.multimedia.cx/index.php?title=Category:Game_Formats

In my case there are three things I would look at

1) Pointers. They are something of a boogeyman for C family programmers, and most courses don't teach them in the best way. They do much like they say though and indicate the location of something within a file or memory. Sometimes they will start counting from the start of the file, sometimes it will be a little way in (usually from the end of the given section or start of the one you want), sometimes they will be relative (take the location you are at and add the data from the pointer) and sometimes they will have some kind of crazy maths done to it (a few times I have had pointer contents need to be shifted to display the proper data)
2) The hardware. Hardware is rather limited and only displays things in certain formats and converting on the fly is a pain. To that end many formats will mirror the hardware they are going to go into at some level, or at the very least play to it -- if your system does 16 bit reads especially well you might well have a format aligned to 16 bits rather than everything packed end to end. I don't know what I can point you at for a summary of wii u hardware, however it is very similar to the wii and gamecube so it can be worth learning what goes there
http://wiibrew.org/wiki/Main_Page
http://hitmen.c02.at/files/yagcd/yagcd/frames.html
3) High level formats. Despite what I said above about hardware there are many that will use known, be it in general world or in game specifically (or in whatever other field you are using), formats for their things as said formats may well have existing conversion code, and have solved all the problems likely to come up which saves a lot of effort.

I could go on and talk about text specifics, 2d graphics, 3d graphics, wave music, sample music, level designs, general game code, assembly and whatever else but I won't do it here, mainly as I have done it before with pictures and worked examples http://gbatemp.net/threads/gbatemp-rom-hacking-documentation-project-new-2016-edition-out.73394/
Thanks for the links it's really useful

--------------------- MERGED ---------------------------

Thank you too
 
  • Like
Reactions: Hikari06

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Veho @ Veho: The cybertruck is a death trap.