Last active
November 26, 2024 04:08
-
-
Save CallocGD/72dc775107ed2ab34c137c7836899f20 to your computer and use it in GitHub Desktop.
Geometry Dash C++ Maps, Unorderedmaps And Vectors in ghidra on Andriod gcc 4.4.3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* This should be used for GNU 4.4.3 C++. Meant to attempt to match C++ std objects | |
| * in geometry dash to the best of our abilities */ | |
| // TODO: (Calloc) Accurate Class member names for std::map... | |
| typedef struct _rb_tree_base { | |
| bool m_isback; | |
| _rb_tree_base *m_parent; | |
| _rb_tree_base *m_left; | |
| _rb_tree_base *m_right; | |
| } _rb_tree_base; | |
| typedef sturct map { | |
| unsigned char compare; | |
| _rb_treebase m_header; | |
| size_t m_nodecount; | |
| } map; | |
| /* 8 bits */ | |
| typdef struct _Hash_node { | |
| void *_M_v; /* Value/Pair... */ | |
| struct _Hash_node *_M_next; | |
| } _Hash_node; | |
| /* Has Vtable like behaviors... */ | |
| /* 12 bits */ | |
| typedef struct _RehashPolicy { | |
| void *_M_next_bkt; | |
| void *_M_bkt_for_elements; | |
| void *_M_needs_rehash; | |
| } _RehashPolicy; | |
| /* 28 bits */ | |
| typedef struct unordered_map { | |
| void *_M_node_allocator; | |
| _Hash_node **_M_buckets; | |
| size_t _M_bucket_count; | |
| size_t _M_element_count; | |
| _RehashPolicy _M_rehash_policy; | |
| } unordered_map; | |
| /* 12 bits */ | |
| typedef struct Vector_Impl{ | |
| void* _M_start; | |
| void* _M_finish; | |
| void* _M_end_of_storage; | |
| } Vector_Impl; | |
| typedef struct vector{ | |
| Vector_Impl _M_impl; | |
| } vector; | |
| /* 12 bits */ | |
| typedef struct _Rep { | |
| void * _M_length; // I think I set it as void incase the decompiler gets confused, Don't remember my exact reasons of why I did this though... | |
| size_t _M_capacity; | |
| size_t _M_refcount; | |
| char * _S_terminal; | |
| } _Rep; | |
| // I call it basic_string and not string or std::string because | |
| // it would screw with Ghidra's datatype objects | |
| // if I did that | |
| /* 4 bits */ | |
| typedef struct basic_string { | |
| // because std::string is 4 bits, a pointer should go here instead of _Rep by itself | |
| _M_data* _Rep; | |
| } basic_string; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment