Danganronpa: Trigger Happy Havoc/Disassembly: Difference between revisions
Jump to navigation
Jump to search
(Add Global Security Cookie) |
|||
(12 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
This is a community page for the disassembly of Trigger Happy Havoc, to assist in community projects. | This is a community page for the disassembly of Trigger Happy Havoc, to assist in community projects. | ||
All addresses are calculated with an image base of 0, in hexadecimal. | All addresses are calculated with an image base of 0, in hexadecimal. | ||
== DR1_us.exe == | |||
=== Variables === | === Variables === | ||
Line 13: | Line 13: | ||
!Purpose | !Purpose | ||
!Notes | !Notes | ||
|- | |- | ||
|00359e74 | |00359e74 | ||
| | |Direct3DInit | ||
| | |[[Danganronpa: Trigger Happy Havoc/Disassembly/Direct3DInit|Direct3DInit]] | ||
| | |Structure containing information for Direct3D initialisation | ||
|Pointer returned by 00120080, checked in 001193a0; seems to actually contain some extra data, will update soon | |Pointer returned by 00120080, checked in 001193a0; seems to actually contain some extra data, will update soon | ||
|} | |} | ||
Line 41: | Line 35: | ||
|- | |- | ||
|001193a0 | |001193a0 | ||
| | |SetupDirect3DInit | ||
| | | | ||
| | | | ||
|int* | |int* | ||
| | |Sets up the Direct3DInit struct if it hasn't been set up. | ||
|- | |- | ||
|00120080 | |00120080 | ||
| | |GetDirect3DInitPtr | ||
| | | | ||
| | | | ||
Line 54: | Line 48: | ||
|Returns a pointer to 00359e74 | |Returns a pointer to 00359e74 | ||
|Checked in 001193a0 | |Checked in 001193a0 | ||
|} | |||
== Artefacts == | |||
These are functions and variables related to internal functionality, and aren't likely to be relevant or important, but are noted for the sake of completion and sanity. | |||
=== Variables === | |||
{| class="wikitable" | |||
!colspan="5"|Variables | |||
|- | |||
!Offset | |||
!Name | |||
!Data Type | |||
!Purpose | |||
!Notes | |||
|- | |||
|00299590 | |||
|MersenneTwisterIndex | |||
|unsigned int | |||
|Index of the generator for random number generation. | |||
|Initialised to 0x271 | |||
|- | |||
|002a2588 | |||
|GlobalSecurityCookie | |||
|int | |||
|Used to detect buffer overflows | |||
|Initialised in [https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/security-init-cookie __security_init_cookie] | |||
|- | |||
|0033f690 | |||
|MersenneTwisterState | |||
|unsigned int[624] | |||
|State of the generator for random number generation. | |||
| | |||
|} | |||
=== Functions === | |||
{| class="wikitable" | |||
!colspan="7"|Functions | |||
|- | |||
!Offset | |||
!Name | |||
!Calling Type | |||
!Arguments | |||
!Return Type | |||
!Purpose | |||
!Notes | |||
|- | |||
|000bc7f0 | |||
|[https://cplusplus.com/reference/random/mersenne_twister_engine/operator()/ RandomMT] | |||
| | |||
| | |||
|unsigned int | |||
|Returns a new random number | |||
|Mersenne Twister | |||
|- | |||
|000bc990 | |||
|[https://cplusplus.com/reference/random/mersenne_twister_engine/seed/ SeedMT] | |||
| | |||
|unsigned int seed | |||
| | |||
|(Re)seeds the generator | |||
|Mersenne Twister, default seed is 0x1571 | |||
|- | |||
|000fd320 | |||
|WrapInNetstring | |||
|__thiscall | |||
|SuffixedNetstring* dest, char* src | |||
|SuffixedNetstring* | |||
|Wraps a char* string in a [[Danganronpa: Trigger Happy Havoc/Disassembly/Netstring|Suffixed Netstring]] struct. | |||
|- | |||
|000fd530 | |||
|CopyPrefixedNetstring | |||
|__thiscall | |||
|PrefixedNetstring* dest, PrefixedNetstring* src | |||
|PrefixedNetstring* | |||
|Copies a [[Danganronpa: Trigger Happy Havoc/Disassembly/Netstring|Prefixed Netstring]] struct. | |||
| | |||
|- | |||
|000fd890 | |||
|FreePrefixedNetstring | |||
|__fastcall | |||
|PrefixedNetstring* string | |||
| | |||
| | |||
| | |||
|- | |||
|000fd6a0 | |||
|CopyToNetstring | |||
|__thiscall | |||
|PrefixedNetstring* dest, char* src, size_t n | |||
|PrefixedNetstring* | |||
|Copies a char* string into a [[Danganronpa: Trigger Happy Havoc/Disassembly/Netstring|Prefixed Netstring]] struct, detecting the length if <syntaxhighlight inline lang="c">n < 0</syntaxhighlight>. | |||
| | |||
|- | |||
|000fda70 | |||
|PrefixedNetstringRawSubstring | |||
|__thiscall | |||
|PrefixedNetstring* this, int index | |||
|char* | |||
|Get a substring of the underlying char* pointer | |||
| | |||
|- | |||
|00116660 | |||
|GetPrefixedNetstringLength | |||
|__fastcall | |||
|PrefixedString* str | |||
|size_t | |||
|Get the length of a PrefixedString | |||
|- | |||
|00125a10 | |||
|AreStringsEqual | |||
| | |||
|char* string1, size_t size1, char* string2, size_t size2 | |||
|bool | |||
|Checks if strings are equal | |||
|Calls <syntaxhighlight inline lang="c">_strncmp(string1,string2,size1)</syntaxhighlight> | |||
|- | |- | ||
|001c6ff4 | |001c6ff4 | ||
Line 61: | Line 172: | ||
| | | | ||
|Checks the provided cookie value against the Global Security Cookie, and exits if it doesn't match | |Checks the provided cookie value against the Global Security Cookie, and exits if it doesn't match | ||
| | |||
|- | |||
|001c7f10 | |001c7f10 | ||
|[https://cplusplus.com/reference/cstring/memset memset] | |[https://cplusplus.com/reference/cstring/memset memset] | ||
Line 67: | Line 180: | ||
|void* | |void* | ||
|Sets the first num bytes of the block of memory pointed by ptr to the specified value (interpreted as an unsigned char). | |Sets the first num bytes of the block of memory pointed by ptr to the specified value (interpreted as an unsigned char). | ||
| | |||
|} | |} |
Latest revision as of 10:07, 15 February 2023
This is a community page for the disassembly of Trigger Happy Havoc, to assist in community projects. All addresses are calculated with an image base of 0, in hexadecimal.
DR1_us.exe
Variables
Variables | ||||
---|---|---|---|---|
Offset | Name | Data Type | Purpose | Notes |
00359e74 | Direct3DInit | Direct3DInit | Structure containing information for Direct3D initialisation | Pointer returned by 00120080, checked in 001193a0; seems to actually contain some extra data, will update soon |
Functions
Functions | ||||||
---|---|---|---|---|---|---|
Offset | Name | Calling Type | Arguments | Return Type | Purpose | Notes |
001193a0 | SetupDirect3DInit | int* | Sets up the Direct3DInit struct if it hasn't been set up. | |||
00120080 | GetDirect3DInitPtr | int* | Returns a pointer to 00359e74 | Checked in 001193a0 |
Artefacts
These are functions and variables related to internal functionality, and aren't likely to be relevant or important, but are noted for the sake of completion and sanity.
Variables
Variables | ||||
---|---|---|---|---|
Offset | Name | Data Type | Purpose | Notes |
00299590 | MersenneTwisterIndex | unsigned int | Index of the generator for random number generation. | Initialised to 0x271 |
002a2588 | GlobalSecurityCookie | int | Used to detect buffer overflows | Initialised in __security_init_cookie |
0033f690 | MersenneTwisterState | unsigned int[624] | State of the generator for random number generation. |
Functions
Functions | ||||||
---|---|---|---|---|---|---|
Offset | Name | Calling Type | Arguments | Return Type | Purpose | Notes |
000bc7f0 | RandomMT | unsigned int | Returns a new random number | Mersenne Twister | ||
000bc990 | SeedMT | unsigned int seed | (Re)seeds the generator | Mersenne Twister, default seed is 0x1571 | ||
000fd320 | WrapInNetstring | __thiscall | SuffixedNetstring* dest, char* src | SuffixedNetstring* | Wraps a char* string in a Suffixed Netstring struct. | |
000fd530 | CopyPrefixedNetstring | __thiscall | PrefixedNetstring* dest, PrefixedNetstring* src | PrefixedNetstring* | Copies a Prefixed Netstring struct. | |
000fd890 | FreePrefixedNetstring | __fastcall | PrefixedNetstring* string | |||
000fd6a0 | CopyToNetstring | __thiscall | PrefixedNetstring* dest, char* src, size_t n | PrefixedNetstring* | Copies a char* string into a Prefixed Netstring struct, detecting the length if n < 0 .
|
|
000fda70 | PrefixedNetstringRawSubstring | __thiscall | PrefixedNetstring* this, int index | char* | Get a substring of the underlying char* pointer | |
00116660 | GetPrefixedNetstringLength | __fastcall | PrefixedString* str | size_t | Get the length of a PrefixedString | |
00125a10 | AreStringsEqual | char* string1, size_t size1, char* string2, size_t size2 | bool | Checks if strings are equal | Calls _strncmp(string1,string2,size1)
| |
001c6ff4 | CheckSecurityCookie | __fastcall | int cookieValue | Checks the provided cookie value against the Global Security Cookie, and exits if it doesn't match | ||
001c7f10 | memset | void * ptr, int value, size_t num | void* | Sets the first num bytes of the block of memory pointed by ptr to the specified value (interpreted as an unsigned char). |