Kodewerx

Our culture has advanced beyond all that you could possibly comprehend with one hundred percent of your brain.
It is currently Thu Mar 28, 2024 7:11 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 17 posts ] 
Author Message
PostPosted: Sat Jul 31, 2010 2:23 pm 
Offline
Kommunist
Kommunist

Joined: Sat Jul 31, 2010 12:19 pm
Posts: 5
Hi,

I am new to nds hacking but i can code things like gold/money/etc
i have 2 questions:

1. How to make a value freeze? i mean like in dbz you have energy there and how do i freeze it so it never gets down?
2. How can i make codes like "Unlock all cards" in yugioh?

Thx for the help


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 31, 2010 6:04 pm 
Offline
Krew (Admin)
Krew (Admin)
User avatar

Joined: Sun Oct 01, 2006 9:26 pm
Posts: 3768
Title: All in a day's work.
1) The same way you make all codes: most are made of a single 'continuous write' which will write a specific value to memory about 30 times per second. In effect, the value "freezes".

2) When starting your search (you have zero cards unlocked) you will want to find the value 0. Do this several times to weed out the flukes. Then after unlocking your first card, do a "greater than" search. If at this point you still have too many possibilities, you can start doing "equal to" searches immediately afterward. The idea is that having zero cards unlocked is ... well, zero. And having only one card unlocked is some number greater than zero (it could be practically anything. Usually one, or a part of a bit flag). And that this "number greater than zero" will not change again.

This should really be covered in EnHacklopedia.

_________________
I have to return some video tapes.

Feed me a stray cat.


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 01, 2010 7:08 am 
Offline
Kommunist
Kommunist

Joined: Sat Jul 31, 2010 12:19 pm
Posts: 5
ok i didnt try this yet but what i i have 1 address then? how to i need to change the value then?

YYYYYYYY XXXXXXXX

XXXXXXXX = ??


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 01, 2010 9:25 am 
Offline
Kommunist
Kommunist
User avatar

Joined: Mon May 21, 2007 1:04 pm
Posts: 441
Location: Down the Street
Title: Mr. Mime
Answer to First question
When you want it so that your energy doesn't go down this is what you do.

If you can, search for a known value. Keep doing that till you narrow down where the energy is located.
You don't exactly "freeze" the value in this case. You just make it so that the energy is always at a certain number.

If it is an 8 bit address, you would put
22YYYYYY where Y's = the address.

For the X's you would put 000000XX and the XX are your value. So say you want the energy to always stay at 99, you would have the XX's be 63 (99 in hex). For 16 bit, just do 12 instead of 22, and for 32 bit, replace 12 or 22 with 02.

Now, in the case that you don't know that value, do an initial dump. Then go back to the game, let your energy go down. Search "less than". Let your energy go down again. Search "less than". Repeat till narrowed down. Then, if there is anyway you can make your energy go up, do that and then search "greater than" just so you can narrow it down perfectly. Add the address to your table and try modifying the value of your energy.

For 8 bit, the highest value would be FF (255 in decimal)
For 16 bit, the highest value would be FFFF (65,535 in decimal)
For 32 bit, the highest value would be (4,294,967,295 in decimal) <-You won't use this very often.

To make it so your energy never goes down, just follow those steps.
Recap:

For 8 bit:
22YYYYYY 000000XX

For 16 bit:
12YYYYYY 0000XXXX

For 32 bit:
02YYYYYY XXXXXXXX

In your case:

Energy never goes down
8 bit = FF
16 bit = FFFF
32 bit = FFFFFFFF

If you have multiple addresses that modify the energy, just line them up. Here is an example of an 8 bit code.

Code:
22012345 000000FF
22678901 000000FF


I hope that explains your first question.

Answer to Second Question

To add on to Para: In Yu-Gi-Oh games you usually start out with about 50 cards (40 main deck, 8 side deck, 2 extra deck). You will have to start your search from 50 and keep unlocking from there. Try finding out how many cards are in the game first, multiply that by the amount of copies you want of each card. That number will be the number it should come out with if you do the code right.

_________________
Image
Image
Image
NDS Hacker


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 01, 2010 10:27 am 
Offline
Kommunist
Kommunist

Joined: Sat Jul 31, 2010 12:19 pm
Posts: 5
wow thanks for this!! i can have 3 copies of every card and lets say there are 200 cards in the game so i need to set the value to 600? :)


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 01, 2010 1:38 pm 
Offline
Komrade
Komrade

Joined: Tue Mar 27, 2007 10:18 am
Posts: 1328
:D

No, not even close.

Read what he said, not what you hope he said.

_________________
Image


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 01, 2010 5:55 pm 
Offline
Krew (Admin)
Krew (Admin)
User avatar

Joined: Sun Oct 01, 2006 9:26 pm
Posts: 3768
Title: All in a day's work.
I don't know anything about the Yu-Gi-Oh card games (I really hate card and board games in video game form. How ridiculous can you get?) but anyway, that may be better advice, depending on how the "unlockables" in the game work. The most common is the bit flag approach, and can be spotted easily when unlocking items is a nonlinear process. For example:

In Super Mario 64, you can "unlock" 120 stars by collecting them throughout the game. But this collection process is nonlinear, meaning you can [practically] collect any star in any order you want. This is opposed to a linear unlock system that would require you to unlock the stars in a specific order.

Now, I only assumed that unlocking cards in Yu-Gi-Oh was a nonlinear process. But perhaps it is linear ... in which case, Ben's tip would be more valuable (since it would actually work).

To finish:

A nonlinear unlock system involves bit flags (or sometimes byte/word flags, which is a waste of memory, but I digress!) which means an item could potentially be unlocked by any bit in any location of memory; 0x01 unlocks the first card, 0x02 unlocks the second, 0x04 for the third, 0x08 for the fifth, 0x10 for the sixth, etc. For all six of those, you bitwise OR (or simply, add) the values together: 0x1F unlocks cards 1 - 6.

On the other hand, a linear unlock system would probably be a counter: 0x01 unlocks the first card, 0x02 unlocks cards 1 & 2, 0x03 unlocks cards 1 - 3, etc. To unlock the first 6 cards, the value will be 0x06.

Of course, these two methods of activating "unlockables" are very different, so they much be searched for using different methods.

_________________
I have to return some video tapes.

Feed me a stray cat.


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 01, 2010 11:24 pm 
Offline
Kommunist
Kommunist
User avatar

Joined: Mon May 21, 2007 1:04 pm
Posts: 441
Location: Down the Street
Title: Mr. Mime
What you say about the two systems makes things more clear for me. I've only attempted this code once, and it didn't work very well. But you've given me some insight in how to make such a code, so thanks Para. I tested it out and I got this.

I got a couple of addresses, and I was able to unlock some cards that I didn't have before..I'm wondering what I did. I am looking at the real All Cards Code right now:

120CC782 00009990
120CCE90 00009999
220CCE92 00000099
C0000000 000001C2
020CC784 99999999
DC000000 00000004

I play the game and can confirm that it works. But I just don't understand it. What is with the random "C0000000 000001C2" line? And why make the value 9990? If you could maybe break it down for me, I could get a better understanding of linear and nonlinear unlock systems.

_________________
Image
Image
Image
NDS Hacker


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 02, 2010 1:29 am 
Offline
Kommunist
Kommunist

Joined: Sat Jul 31, 2010 12:19 pm
Posts: 5
Yes now i am getting it too abit :) gogo para ^^


thanks :)


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 02, 2010 3:02 am 
Offline
Komrade
Komrade

Joined: Tue Mar 27, 2007 10:18 am
Posts: 1328
It's writing a bunch of 9s all over, using the C line to write 0x1C2 x4 bytes of 0x99 to speed things up.

If I had to guess, it's giving you 9 of every card?

If you can hold multiple cards, just search for 1 when you have 1 of a card and 2 when you get a second of it, then 3 when you get a third until you find the address of that card. Of course, since each byte holds the count of 2 cards apparently, it'd be wise to ensure you get no other cards in the interim when searching for cards in similar card games in the future.

_________________
Image


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 02, 2010 11:47 am 
Offline
Kommunist
Kommunist
User avatar

Joined: Mon May 21, 2007 1:04 pm
Posts: 441
Location: Down the Street
Title: Mr. Mime
Zeld wrote:
It's writing a bunch of 9s all over, using the C line to write 0x1C2 x4 bytes of 0x99 to speed things up.

If I had to guess, it's giving you 9 of every card?

If you can hold multiple cards, just search for 1 when you have 1 of a card and 2 when you get a second of it, then 3 when you get a third until you find the address of that card. Of course, since each byte holds the count of 2 cards apparently, it'd be wise to ensure you get no other cards in the interim when searching for cards in similar card games in the future.


Yes. So, if you replace all those 9's with 3, it will give you 3 cards, i assume?

So for the 0x0C line, you have the original write (in this case 0x1C2), then to set the offset in the 0xDC line, you put 4 because you are writing the C line x4 bytes of 0x99 which is what we had before.

I don't see how I would have ever learned this in the EnHacklopedia. It really needs some work.

_________________
Image
Image
Image
NDS Hacker


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 02, 2010 2:06 pm 
Offline
Komrade
Komrade

Joined: Tue Mar 27, 2007 10:18 am
Posts: 1328
That is not the original write. If you read what I said, you'd see it's a count of how many times to do the 4 byte write.

Zeld wrote:
using the C line to write 0x1C2 x4 bytes

All of this information is clearly in the 'pedia.

Quote:
Type 0x0C
C0000000 YYYYYYYY This sets the 'Dx repeat value' to YYYYYYYY and saves the 'Dx nextcode to be executed' and the 'Dx execution status'. Repeat will be executed when a D1/D2 code is encountered.
When repeat is executed, the AR reloads the 'next code to be executed' and the 'execution status' from the Dx registers.

As I've said, focus more on reading things and less on guessing what they mean in a way that you're comfortable with. It really feels like you're making assumptions that make you feel more secure about your grasp of the knowledge instead of considering that maybe what is intuitive to you is not necessarily the most efficient way of doing things.

Ben wrote:
120CC782 00009990
120CCE90 00009999
220CCE92 00000099
C0000000 000001C2
020CC784 99999999
DC000000 00000004

Write 2 bytes.
Write another 2 bytes.
Write 1 byte.
Repeat the next few lines 0x1C2 times.
Write 4 bytes. Will be repeated 0x1C2 times.
Add 4 to offset. Allows the next 4 bytes written by the previous line to be written to the next 4 bytes rather than the same 4 bytes that were just written to.

There should be a D1 line after the DC line to terminate the loop started by the C line. However, as it is the end of the code, and the offset needs to be reset as it was modified by DC, a D2 line should be used instead.

The correct code would be

Code:
120CC782 00009990
120CCE90 00009999
220CCE92 00000099
C0000000 000001C2
020CC784 99999999
DC000000 00000004
D2000000 00000000

Note that the EnHacklopedia does not have complete information on the code types because the manual that comes with the system does not. Thus information documenting the DC code type's offset summation capability is absent.

However, there is a pinned topic exactly where it should be - Game Hacking Development - entitled "NDS AR Code Type Information".

Directly from the first post in that topic:

Quote:
Add to Offset Code :
--------------------

Type DC : adds the offset 'data' to the current offset.
(some kind of dual offset)
DC000000 XXXXXXXX : offset = (offset + XXXXXXXX).

Do not waste Para's time with excuses. He wastes enough time as it is.

_________________
Image


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 02, 2010 3:49 pm 
Offline
Kommunist
Kommunist
User avatar

Joined: Mon May 21, 2007 1:04 pm
Posts: 441
Location: Down the Street
Title: Mr. Mime
This makes so much more sense, so thanks.

And I didn't even realize there was that topic in Game Hacking Development. My fault.

By the way, the D2 line is there, I just accidentally forgot to copy the last line.

_________________
Image
Image
Image
NDS Hacker


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 02, 2010 4:40 pm 
Offline
Krew (Admin)
Krew (Admin)
User avatar

Joined: Sun Oct 01, 2006 9:26 pm
Posts: 3768
Title: All in a day's work.
Zeld wrote:
It's writing a bunch of 9s all over, using the C line to write 0x1C2 x4 bytes of 0x99 to speed things up.

If I had to guess, it's giving you 9 of every card?

If you can hold multiple cards, just search for 1 when you have 1 of a card and 2 when you get a second of it, then 3 when you get a third until you find the address of that card. Of course, since each byte holds the count of 2 cards apparently, it'd be wise to ensure you get no other cards in the interim when searching for cards in similar card games in the future.

Folks, we have a winner!

It appears to be using storing the card counts in a nybble array ... which is interesting, to say the very least. Searching for the number of "duplicate" cards you hold will only work for about 25% of the cards, since some cards may count in the upper nybble of a byte: 0x10, 0x20, 0x30, etc. A known value search could work (the odds of finding a match are greater than 25%. Just the _potential_ is 25% ... I never claimed to be a statistician). A totally unknown-driven search would have found it relatively quickly enough, as well.

_________________
I have to return some video tapes.

Feed me a stray cat.


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 03, 2010 1:20 am 
Offline
Komrade
Komrade

Joined: Tue Mar 27, 2007 10:18 am
Posts: 1328
And in such a scenario that's exactly what I would have used...gotta be as pragmatic as possible, without overdoing it such that you miss out on search optimization.

It'd go just as quickly however.

_________________
Image


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 03, 2010 3:00 am 
Offline
Kommunist
Kommunist

Joined: Sat Jul 31, 2010 12:19 pm
Posts: 5
aaaaaaaaaaaaah this is too much for me -.- ^^ i will learn abit more and then try this ^^


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 03, 2010 10:04 am 
Offline
Kommunist
Kommunist
User avatar

Joined: Mon May 21, 2007 1:04 pm
Posts: 441
Location: Down the Street
Title: Mr. Mime
Parasyte wrote:
Zeld wrote:
It's writing a bunch of 9s all over, using the C line to write 0x1C2 x4 bytes of 0x99 to speed things up.

If I had to guess, it's giving you 9 of every card?

If you can hold multiple cards, just search for 1 when you have 1 of a card and 2 when you get a second of it, then 3 when you get a third until you find the address of that card. Of course, since each byte holds the count of 2 cards apparently, it'd be wise to ensure you get no other cards in the interim when searching for cards in similar card games in the future.

Folks, we have a winner!

It appears to be using storing the card counts in a nybble array ... which is interesting, to say the very least. Searching for the number of "duplicate" cards you hold will only work for about 25% of the cards, since some cards may count in the upper nybble of a byte: 0x10, 0x20, 0x30, etc. A known value search could work (the odds of finding a match are greater than 25%. Just the _potential_ is 25% ... I never claimed to be a statistician). A totally unknown-driven search would have found it relatively quickly enough, as well.


You're right. I made a code based on what Zeld said and only got about 3000 cards (put it at x3 per card, therefore there should be somewhere around 10,000 cards which is correct). I did a known value search by the way.

_________________
Image
Image
Image
NDS Hacker


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 131 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group