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 4:29 am

All times are UTC - 8 hours [ DST ]


Forum rules


Discussion of illegal hacking/cracking is prohibited. (No virus/trojans/cracks/warez/etc allowed.)



Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sat Jun 06, 2009 12:10 pm 
Offline
Komrade
Komrade
User avatar

Joined: Tue Mar 27, 2007 6:23 pm
Posts: 1354
Location: Mario Raceway, 1509.831, 217.198, -564.429
Title: Mario Kart 64 Hacker
Just wondering if anyone knows what specifically to look for. The only things I can think of are "look for a series of incrementing floats" or "find some code that uses them and try to track them down", neither of which sound appealing. Just looking for the values of sin(1), sin(2), etc may not work due to varying precision and even varying degrees (at least on NDS, it's common to divide circles into 512 pieces instead of 360). Since my code is already over 200 lines and these already must exist in the game, I don't exactly feel like sticking a sin table into the code. V_v

_________________
Image 143
HyperNova Software is now live (but may take a few tries to load) currently down; check out my PSP/DS/Game Boy/Windows/Linux homebrew, ROM hacks, and Gameshark codes!


Top
 Profile  
Reply with quote  
PostPosted: Sat Jun 06, 2009 8:05 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.
Looking through the PsyQ libraries in IDA Pro might help (although I recommend ignoring IDA Pro as best you can)

_________________
I have to return some video tapes.

Feed me a stray cat.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 07, 2009 1:01 am 
Offline
Komrade
Komrade

Joined: Tue Mar 27, 2007 10:18 am
Posts: 1328
HyperHacker wrote:
Just looking for the values of sin(1), sin(2), etc may not work due to varying precision

For that case, can't you just ignore a few bits?

I'm eager to see what this looks like, too. I'm surprised I haven't ran into it yet.

_________________
Image


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 08, 2009 10:19 pm 
Offline
Kommunist
Kommunist

Joined: Mon Jun 08, 2009 7:07 pm
Posts: 9
Title: Tyler
Zeld wrote:
HyperHacker wrote:
Just looking for the values of sin(1), sin(2), etc may not work due to varying precision

For that case, can't you just ignore a few bits?

I'm eager to see what this looks like, too. I'm surprised I haven't ran into it yet.


You could have a look up table. However, this would produce somewhat inaccurate results. And for that reason, a series of values might be calculated... n=0, to n=?, where the series is [(-1)n * x^(2n+1)]/(2n+1)! for sin, and [(-1)n * x^(2n)]/(2n)! for cosine. Sin and cosine converge very quickly (as long as it is restricted to +/- 180 degrees)... it doesn't take many calculations to achieve a relatively accurate value... accurate enough for graphics calculations on a decade old console, anyways.

I would expect to see a for loop, where the author already calculated the number of loops that have to be done in order to achieve a certain accuracy, where sum+= the series for that n, again from n=0 to n=?.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jun 09, 2009 6:58 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.
Considering almost (?) all commercial N64 games were written with the PsyQ development kit, they use the "libultra" standard library. libultra (like most standard libs) contains its own math suite. If sin(), cos(), and relatives are not in libultra, developing 3D games on N64 would have been infeasible.

Again, I suggest looking there.

_________________
I have to return some video tapes.

Feed me a stray cat.


Top
 Profile  
Reply with quote  
PostPosted: Sat Jun 20, 2009 4:33 pm 
Offline
Komrade
Komrade
User avatar

Joined: Tue Mar 27, 2007 6:23 pm
Posts: 1354
Location: Mario Raceway, 1509.831, 217.198, -564.429
Title: Mario Kart 64 Hacker
So what would I be looking for? Would there be some convenient map file that tells the name and address of each function?

_________________
Image 143
HyperNova Software is now live (but may take a few tries to load) currently down; check out my PSP/DS/Game Boy/Windows/Linux homebrew, ROM hacks, and Gameshark codes!


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 21, 2009 7:44 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.
How do you imagine a compiler "knows" where to find the sin() and cos() functions in your standard math library when it attempts to link the objects into a usable executable?

Hint: Symbol tables.

IDA Pro, much to my chagrin, is 'decent' at combining the provided symbol tables along side the disassembly output of unlinked library object files.

Ergo: Just disassemble the lib and look for "sin", "cos", ... ?

_________________
I have to return some video tapes.

Feed me a stray cat.


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 109 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:  
cron
Powered by phpBB® Forum Software © phpBB Group