Is there any Program or any tutorial that can help me patch Roms by using cheats? I have some codes that can fix new AP Games. So my question is how to use these codes to patch roms
Game fix codes are usually used like other cheat codes, except they have to be on everytime we play the games. If you have some Game fix codes you can submit them here http://cheats.gbatemp.net/forum/nds/
I assume this is a request from a person wanting to be a hacker rather than someone without a decent flash card or something similar (my reply will certain be geared towards the former).
Cheats are little more than lists of memory locations and what you want done to said locations, later hacking tools added a few methods to this list like if greater/less than but the general idea remains the same: http://doc.kodewerx.org/hacking_nds.html#action_replay (the document is called enhacklopedia and has many mirrors/forks in various places so if it is down do search for it).
"Traditionally" this means finding the location of the money/health/ammo in a game and holding that value at a given value. As the game binary is held/available in memory for most modern consoles including the DS you can target this memory that the console sees and as data in a game binary is the same as regular data in memory as far as cheats are concerned you can do interesting things including defeating anti piracy/anti cheat protection (in the case of the DS they can operate in the same way although the DS does also feature games with more traditional anti cheat methods like mirrored and game level encrypted memory).
AP defeating cheats almost always target the rom binaries and/or overlays* with the aim of writing out the AP code sections with either a jump, a NOP or whatever else to bypass the code section (this is what the cheat payload is and why it is not necessarily just a bunch of random numbers) when they are in memory and this is where it can tricky:
You could use something like NDSATM to hardpatch the cheats in but the way the later versions of the app work (using interrupts and the like rather than memory location searching/replacement/injection which makes it far better for "general" cheats will not be ideal for AP defeating cheats especially if the AP is loaded at game start and before your interrupts can be triggered).
Still http://nocash.emubase.de/gbatek.htm#dsmemorymaps tells us what to look for in the ram (desmume has a memory viewer if you lack the developers/hackers version of no$gba or your rom will not work in it- these AP methods can also target emulators with no$gba usually falling prey) which you can relate back to the binaries (the arm7.bin, the arm9.bin and the overlays you see when you pull a rom apart) as necessary.
Edited in from post below and my reply:
NDSTS should tell you the arm7 and arm9 execute location and thus give you pretty much everything you need.
Alas it may not be the case that the ARM9 or ARM7 binaries starts at the start of the 02000000h memory location.
I suggest you load the roms in an emulator dump the memory from 02000000h to 023FFFFFh (there is only 4 megs of ram for it to be in) and do a couple of simple finds using the first few bytes to try and suss out where the binary is in the ram
Now all you have to do is take the offset from the locations you already have*. From there you appear to have all the data you should need to sort this.
*for the sake of example you find CS3E - 4743 - Sonic & SEGA All-Stars Racing starts the ARM9 binary at 020c0000h so you just take c0000 from the memory locations you just listed
0x020c9edc
00 06 09 0A 08 43 00 21
This would mean at 9edc in the ARM9 binary you pluck out from the rom (as you should not be changing the size I would use something like NDSTS for this rather than ndstool) you change whatever is there to 00 06 09 0A 08 43 00 21
The enhacklopedia link tells you how to decode cheats, the ram viewer and cheat itself will help you locate the relevant data and your hex editor should be able to change things (search and replace, finding nearby data and so on) while again the cheat provides the payload you want to change the data with. Modern games has been seen to have many AP sections (even to the point of noticeably slowing the game down) so this search and replace can take a while (probably not as long as it took the hacker(s) to initially track them all down mind).
Problem 2 is that the game binaries can be compressed in various methods when they are stored in the rom image but that is veering into more traditional rom hacking not to mention if you just porting cheats it can be bypassed in various more interesting ways than the initial hacker would have (you can cancel compression at some level (sometimes that is not necessary) or just recompress from a binary snatched from the ram viewer of an emulator).
*overlays are an older computing method used by the DS to extend the binaries while saving memory, as such they are usually only loaded when necessary and the basic cheats might cause trouble if they patch over another overlay's memory. However AP code has been seen several times sitting in overlays so be aware of this, this is more of a problem to the would be cheat maker though.
Below you will see the locations the rom patches in the NDS memory
I hope someone can make into an AR code for it work out to offset in the rom memory to make a patch but i don't know how to do that
My apologies the rest of that sentence should have read [without a decent flash card or something similar] looking for a quick fix.
Edit: Here I go embarrassing myself- NDSTS should tell you the arm7 and arm9 execute location and thus give you everything you need.
Alas it may not be the case that the ARM9 or ARM7 binaries starts at the start of the 02000000h memory location.
I suggest you load the roms in an emulator dump the memory from 02000000h to 023FFFFFh (there is only 4 megs of ram for it to be in) and do a couple of simple finds using the first few bytes to try and suss out where the binary is in the ram
Now all you have to do is take the offset from the locations you already have*. From there you appear to have all the data you should need to sort this.
*for the sake of example you find CS3E - 4743 - Sonic & SEGA All-Stars Racing starts the ARM9 binary at 020c0000h so you just take c0000 from the memory locations you just listed
0x020c9edc
00 06 09 0A 08 43 00 21
This would mean at 9edc in the ARM9 binary you pluck out from the rom (as you should not be changing the size I would use something like NDSTS for this rather than ndstool) you change whatever is there to 00 06 09 0A 08 43 00 21
It's the first Nintendo Switch firmware update of 2024. Made available as of today is system software version 18.0.0, marking a new milestone. According to the patch...
After a couple days of Nintendo releasing their 18.0.0 firmware update, @SciresM releases a brand new update to his Atmosphere NX custom firmware for the Nintendo...
Today, April 8th, 2024, at 4PM PT, marks the day in which Nintendo permanently ends support for both the 3DS and the Wii U online services, which include co-op play...
Hello, GBAtemp members! After a prolonged absence, I am delighted to announce my return and upgraded form to you today...
Introducing tempBOT AI 🤖
As the embodiment...
Yet another casualty goes down in the never-ending battle of copyright enforcement, and this time, it hit a big website which was the host for many fangames based and...
With Apple having recently updated their guidelines for the App Store, iOS users have been left to speculate on specific wording and whether retro emulators as we...
The highly popular and accurate FPGA hardware, MisterFGPA, has received today a brand new update with a long-awaited feature, or rather, a new core for hardcore...
The time has finally come, and after many, many years (if not decades) of Apple users having to side load emulator apps into their iOS devices through unofficial...
The romhacking community is always a source for new ways to play retro games, from completely new levels or stages, characters, quality of life improvements, to flat...
Retro handheld manufacturer Anbernic is releasing a refreshed model of its RG35XX handheld line. This new model, named RG35XX 2024 Edition, features the same...
It's the first Nintendo Switch firmware update of 2024. Made available as of today is system software version 18.0.0, marking a new milestone. According to the patch...
Today, April 8th, 2024, at 4PM PT, marks the day in which Nintendo permanently ends support for both the 3DS and the Wii U online services, which include co-op play...
Hello, GBAtemp members! After a prolonged absence, I am delighted to announce my return and upgraded form to you today...
Introducing tempBOT AI 🤖
As the embodiment...
With Apple having recently updated their guidelines for the App Store, iOS users have been left to speculate on specific wording and whether retro emulators as we...
The time has finally come, and after many, many years (if not decades) of Apple users having to side load emulator apps into their iOS devices through unofficial...
After a couple days of Nintendo releasing their 18.0.0 firmware update, @SciresM releases a brand new update to his Atmosphere NX custom firmware for the Nintendo...
Yet another casualty goes down in the never-ending battle of copyright enforcement, and this time, it hit a big website which was the host for many fangames based and...
A new Nintendo Switch firmware update is here. System software version 18.0.1 has been released. This update offers the typical stability features as all other...
The highly popular and accurate FPGA hardware, MisterFGPA, has received today a brand new update with a long-awaited feature, or rather, a new core for hardcore...
Nintendo has recently announced through their social media accounts that a new Indie World stream will be airing tomorrow, scheduled for April 17th, 2024 at 7 a.m. PT...