fastman92 Posted August 2, 2010 Share Posted August 2, 2010 On this page I read this information: "The game calculates the CRC32-value out of a given string and checks if they exist in the GXT." But something doesn`t match to me. Let`s explain. For example I chose Lanstalker text. Car 400 uses Game Name: LANDSTK CRC32 I calculated of LANDSTK is so: 7855A059 But you won`t find such GXT Entry in american.gxt. In this file Landstalker uses 87AA5FA6 entry in MAIN table. So, my question is - how hash of GXT Entry is calculated in GTA SA, because alone method with CRC32 isn`t proper. And do not refer me to tutorials how to name cars in GTA SA, but to informations how GTA SA hashes GXT Entries. Link to comment Share on other sites More sharing options...
iLiR Posted August 2, 2010 Share Posted August 2, 2010 Go ask R* Link to comment Share on other sites More sharing options...
Wesser Posted August 2, 2010 Share Posted August 2, 2010 Go ask R* Couldn't you make a worse reply? I had the same problem but no one has answered me yet. I posted it here (look at the end). 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
fastman92 Posted August 2, 2010 Author Share Posted August 2, 2010 (edited) Probably Seeman knows, how does hashing work. Else, how would he be able to create FXT plugin for SA? I guess that his FXT support adds calculated hashes of GXT entries to memory, Edited August 2, 2010 by fastman92 Link to comment Share on other sites More sharing options...
Wesser Posted August 2, 2010 Share Posted August 2, 2010 I don't think so. He probably used some internal game routines by keeping those external GXT Entries into the memory. 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
spaceeinstein Posted August 2, 2010 Share Posted August 2, 2010 Seemann got the list from someone else. This early topic on SA GXT might be helpful. http://www.gtaforums.com/index.php?showtopic=195106 Link to comment Share on other sites More sharing options...
Wesser Posted August 2, 2010 Share Posted August 2, 2010 Wow, thanks spaceeinstein! It has been posted here but there's no luck on how to get the GXT Entry from hash string directly. 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
Deji Posted August 3, 2010 Share Posted August 3, 2010 I'm pretty sure a standard online converter should be able to translate it... Try using different bit modes. But, if you wanna be sure to get the same result Rockstar got, I think opcode 09A9 is a safe bet. Just display the number stored to the variable on-screen... I perfer to use CLEO 4's opcodes since they let me display stuff in HEX. Link to comment Share on other sites More sharing options...
Silent Posted August 3, 2010 Share Posted August 3, 2010 But, if you wanna be sure to get the same result Rockstar got, I think opcode 09A9 is a safe bet. Wesser tried that opcode too, but without success Link to comment Share on other sites More sharing options...
Wesser Posted August 3, 2010 Share Posted August 3, 2010 However, it's pretty useless using 09A9. GTA uses signed integer in global/local vars and it's able to store only 0xFFFFFFFF / 2 as max, so they can contain a value within -2147483648 to 2147483647 (-0x80000000 to 0x7FFFFFFF), which is not enough. 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
Deji Posted August 4, 2010 Share Posted August 4, 2010 Obviously you've not explored CLEO 4 deeply enogh Link to comment Share on other sites More sharing options...
fastman92 Posted August 4, 2010 Author Share Posted August 4, 2010 I will test 09A9 tommorow. But in Sanny Builder when you see e.g this code (while editing main.scm): 0512: show_permanent_text_box 'DUAL_A' Beside this text it`s written value of this GXT Entry. Effect is so: 0512: show_permanent_text_box 'DUAL_A' // ~k~~VEHICLE_ENTER_EXIT~ Use Videogame This is read from american.gxt, because it`s doesn`t work after removing this file from GTA SA\text directory. So, if Seeman as creator of Sanny Bilder hadn`t known how does hashing work, how could he build GXT value reading otherwise? Link to comment Share on other sites More sharing options...
Deji Posted August 4, 2010 Share Posted August 4, 2010 Hashing is a one-way operation... You can't get text out of a hash, but you can turn text into a hash... If you were searching for a particular piece of text, you could hash that text and compare it to all the other hashes. If the hash matches, that text exists. What's more, GXT Editors use the same method when searching for a particular entry. The hashing probably just uses a basic method. I'll see if I can figure it out. Link to comment Share on other sites More sharing options...
fastman92 Posted August 4, 2010 Author Share Posted August 4, 2010 Yes, I know that I can`t get out text from hash. But I want hash text and know which hash in american.gxt will use GTA SA for example to CUSTOM. Sanny Builder must after reading GXT entry be able to make name of GXT entry into hash (just like GTA SA). After Sanny Builder has known already hash, then simply reads value of this hash from american.gxt About getting out text from hash I know, but creator of such program must just know hashing algorithm. But I not about it in this topic. Link to comment Share on other sites More sharing options...
Deji Posted August 4, 2010 Share Posted August 4, 2010 {$CLEO}0000:09A9: get_string "STRING" CRC32_to [email protected]: show_formatted_text_highpriority "%X" time 12000 [email protected]: end_custom_thread Link to comment Share on other sites More sharing options...
Wesser Posted August 4, 2010 Share Posted August 4, 2010 Deji, I've already tried it but it gives the same result as a normal CRC32 calculator. 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
Deji Posted August 4, 2010 Share Posted August 4, 2010 Really? I got a completely different result... One that matched the GXT Entries shown in the GXT Editor. Link to comment Share on other sites More sharing options...
Wesser Posted August 5, 2010 Share Posted August 5, 2010 Look at this script: {$CLEO}0000: NOP03F0: enable_text_draw 1 while true wait 0 09A9: get_string "LANDSTK" CRC32_to [email protected] 0341: unknown_text_draw_flag 0 0342: enable_text_draw_centered 1 045A: draw_text_1number 320.0 300.0 GXT 'NUMBER' number [email protected] // ~1~end This retrieves a value which matches with a normal CRC32 result. Although, there's something weird: I got -2018877530 (0x87AA5FA6) but if I add 1 to that value and make it as an absolute integer, I get 2018877529 (0x7855A059). I believe there's nothing wrong. 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
fastman92 Posted August 5, 2010 Author Share Posted August 5, 2010 -2018877530 (0x87AA5FA6) How did you convert this hex number to decimal? When I convert this number by myself I get 2276089766. I want to know it. Link to comment Share on other sites More sharing options...
Wesser Posted August 5, 2010 Share Posted August 5, 2010 This does that little trick: GXT Entry : "LANDSTK"CRC32 : 0x7855A059Hash = 0xFFFFFFFF - 0x7855A059 Now Hash will contain 0x87AA5FA6. Unfortunately, GTA variables don't support unsigned integers but I think the game converts every hash string automatically into the effective hexes. 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
Silent Posted August 5, 2010 Share Posted August 5, 2010 However, it's pretty useless using 09A9. GTA uses signed integer in global/local vars and it's able to store only 0xFFFFFFFF / 2 as max, so they can contain a value within -2147483648 to 2147483647 (-0x80000000 to 0x7FFFFFFF), which is not enough. So maybe writing that value to allocated memory space would help? Link to comment Share on other sites More sharing options...
fastman92 Posted August 5, 2010 Author Share Posted August 5, 2010 Thanks very much! So algorithm in PHP to fast calculate is: <?phpecho strtoupper(base_convert(4294967295-crc32( 'LANDSTK' ), 10, 16));?> Now it`s no problem to add new text according to current language. Link to comment Share on other sites More sharing options...
Wesser Posted August 5, 2010 Share Posted August 5, 2010 Hopefully, it'd work for each hash string. SilentPL, only CLEO4 allows to show formatted string in whetever type without those sh*tty byte limitations. 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
Silent Posted August 5, 2010 Share Posted August 5, 2010 SilentPL, only CLEO4 allows to show formatted string in whetever type without those sh*tty byte limitations. Silent* But if you write that value to mamory, and add some unique text above that, then you can read that values by Cheat Engine Link to comment Share on other sites More sharing options...
Wesser Posted August 5, 2010 Share Posted August 5, 2010 I figured out 09A9 works like a charm but GTA cannot handle unsigned integers. This helps us to know more: { FUNCTIONS INCLUDED:- getLabelOffset Type: GET Description: Get a label offset.}{$CLEO}0000: NOP03F0: enable_text_draw 1 while true wait 0 //09A9: get_string "LANDSTK" CRC32_to [email protected] 0AB1: call_scm_func @getLabelOffset 1 label @hashString store_to [email protected] 0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 0341: unknown_text_draw_flag 0 0342: enable_text_draw_centered 1 045A: draw_text_1number 320.0 300.0 GXT 'NUMBER' number [email protected] // ~1~end:hashStringhex A65FAA87 // LANDSTKend:getLabelOffset{ Parameters: Passed: [email protected] - label name Result: [email protected] - label offset Example: 0AB1: call_scm_func @getLabelOffset 1 label @LABEL store_to [email protected] }if [email protected] <> 0 then 0A9F: [email protected] = current_thread_pointer [email protected] += 0x10 0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0 0062: [email protected] -= [email protected] else [email protected] = 0 end0AB2: ret 1 [email protected] It returns the same negative value. 012 345 678 9A BCD EFG HIJK LMN OPQR STUV WX YZ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now