Jump to content
Sign in to follow this  

Print Text Function

Recommended Posts

I'm trying to find BroodWar's print text function.

 

So far what I've done is I typed a message in during a LAN game and scanned the memory for the message. Then, in Olly, I followed the address of the message's text in the dump and set a hardware breakpoint on write several lines down (approximately where the next message will be written). After typing in another message, Olly stopped at the offset 15021B57 (just below the memory write). Then I "executed till return" several times, eventually landing at the offset 00485F5F. This is where I got lost. Is the print function called somewhere inside StarCraf.00485D10 or have I not returned far enough? I would greatly appreciate any tips on what to look for or how to go about finding this function (please don't tell me the offset... yet :P ). I'm a complete noob!

 

Thanks and awesome site!

:thumbsup:

 

UPDATE:

I just found a topic related to this problem, I apologize for not having used the search function - I did quite a bit of googling though! From what I read I should follow a client side message such as "Not enough minerals..." I did this and I think I may have found the function (or at least something very close to the function...)! I've landed at the offset 00420201 in Olly. When I NOP this call no text appears ingame. Can anyone verify this as the text function? Thanks again!

Edited by s1ck

Share this post


Link to post
Share on other sites

Do you mean you're trying to print an in-game message on the screen, or print text anywhere on the screen? :3

 

420201 = BWFXN_PrintXY

Share this post


Link to post
Share on other sites

I'm trying to print text anywhere on the screen. I managed to change the "MENU" text to "s1ck" by a jmp patch :biggrin: ; Now I just need to figure out where the x and y coordinates are stored. Thanks for the replies and the verification!

Edited by s1ck

Share this post


Link to post
Share on other sites

Well, printing text anywhere is pretty sensitive. You have to hook a spot in starcraft that is constantly called by other printxy functions, and the font size has to be set to something. Otherwise the text will either crash or not be displayed at all. I'd suggest joining a starcraft single player game, breakpoint starcraft's printxy function, and when it breaks step out and then jmppatch somewhere in there. The higher the better. I can spoon feed you a bit if you want with examples later if you still cant figure it out.

 

As for co-ordinates, ummm.. I guess I'd look at the function that calls printxy, and fiddle around with the arguments or something. -.-'

Share this post


Link to post
Share on other sites

Sorry for the late reply, I've been busy lately. I'm still having troubles getting text to print, but I think I've found the entry point of the printxy function at 004202B0. I've been messing with the registers and the stack trying to find where the x and y coordinates of the text are located but have only been able to crash the game. >.< I'd appreciate any more tips and thanks again for the help Jiggie.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×