Post: How To Use Engine Text and Other Functions
01-18-2015, 11:29 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); READ THE ENTIRE THREAD BEFORE REPLYING!



I'm going to tell you all how to do this because well I don't care having this to myself or whatever anymore. It's really simple to do and Xbox has had this for a few years. So I DON'T see the point in having this.

In this thread I will teach how to use Engine text and stuff

What is engine text?
Engine text is text that is called by the call of duty game engine. You maybe familiar with my offhost menu, this uses engine text and another thing that uses engine text is the "FPS" function.

What do I use this for?
You can use engine text for a lot of things. Mainly it is used for making nonhost mods such as: ESP, nonhost menus, etc.

How Do I Start Using This?

For starters you need to know how to hook functions. This basically means you need to hook a function that runs every frame of the game such as R_FrameSetFog (Or whatever it's called) or "FPS" function. This being said, you cannot hook functions like this with any external program, so sorry TMAPI and CCAPI users this must be done in a plugin either system or a game plugin (.SPRX)

Here is the function I use to hook my functions. Credits to Theriftboy for his help on Ps3hax and a few xbox modders.

PatchInJump
    
int32_t write_process(uint64_t ea, const void * data, uint32_t size)
{
system_call_4(905, (uint64_t)sys_process_getpid(), ea, size, (uint64_t)data);
return_to_user_prog(int32_t);
}
int Memcpy(PVOID destination, const PVOID source, size_t size)
{
system_call_4(905, (uint64_t)sys_process_getpid(), (uint64_t)destination, size, (uint64_t)source);
__dcbst(destination);
__sync();
__isync();
return_to_user_prog(int);
}
void PatchInJump(int Address, int Destination, bool Linked) {

// use this data to copy over the address
int FuncBytes[4];

// Get the actual destination address
Destination = *(int *)Destination;

FuncBytes[0] = 0x3D600000 + ((Destination >> 16) & 0xFFFF); // lis %r11, dest>>16
if (Destination & 0x8000) // If bit 16 is 1
FuncBytes[0] += 1;

FuncBytes[1] = 0x396B0000 + (Destination & 0xFFFF); // addi %r11, %r11, dest&0xFFFF
FuncBytes[2] = 0x7D6903A6; // mtctr %r11

FuncBytes[3] = 0x4E800420; // bctr

if (Linked)
FuncBytes[3] += 1; // bctrl

Memcpy((void*)Address, FuncBytes, 4 * 4);
}


If this code gives you errors, make sure to add the following additional dependencies and header files


    
#pragma comment(lib, "sysmodule_stub")
#include <cell/pad.h>
#include <string>
#include <sys/random_number.h>
#pragma comment(lib, "c")
#include <sys/memory.h>
#include <fastmath.h>
#include <ppu_intrinsics.h>

$(SCE_PS3_ROOT)\target\ppu\lib\libc.a
$(SCE_PS3_ROOT)\target\ppu\lib\libc_stub.a
$(SN_PS3_PATH)\ppu\lib\sn\libsn.a
$(SCE_PS3_ROOT)\target\ppu\lib\libm.a
$(SCE_PS3_ROOT)\target\ppu\lib\libio_stub.a
$(SCE_PS3_ROOT)\target\ppu\lib\libsysutil_stub.a
$(SCE_PS3_ROOT)\target\ppu\lib\libsysmodule_stub.a
$(SCE_PS3_ROOT)\target\ppu\lib\libsyscall.a
$(SCE_PS3_ROOT)\target\ppu\lib\libstdc++_stub.a
$(SCE_PS3_ROOT)\target\ppu\lib\fno-exceptions\libstdc++_stub.a
$(SCE_PS3_ROOT)\target\ppu\lib\fno-exceptions\fno-rtti\libstdc++_stub.a
$(SCE_PS3_ROOT)\target\ppu\lib\libgcm_sys_stub.a



Next, what you want to do is go to your prx entry function and add your patchinjump code like I do here
You must login or register to view this content.

    
- The 0x4A5508is AW's "FPS" function
-(int)CL_DrawTextHook is my function that I'm using to display the engine functions
-false is an argument that you put


Next you want to create your function like I made mine "CL_DrawTextHook"

In my menu I'm using R_AddCmdDrawText and R_AddCmdDrawStretchPic for Text and Material

Some Engine Functions for Advanced Warfare 1.06
    
opd_s R_AddCmdDrawStretchPic_t = { 0x5D59D8, TOC };//Maybe 0x5D5980
opd_s R_AddCmdDrawText_t = { 0x5D5F28, TOC };
opd_s Material_RegisterHandle_t = { 0x5C9900, TOC };
opd_s R_RegisterFont_t = { 0x22B938, TOC };

void*(*R_RegisterShader)(const char * material, int imageTrack) = (void*(*)(const char *, int))&Material_RegisterHandle_t;
void*(*R_RegisterFont)(const char * font, int imageTrack) = (void*(*)(const char *, int))&R_RegisterFont_t;
typedef void(*R_DSI)(float x, float y, float w, float h, float xScale, float yScale, float xay, float yay, const float *color, void * material);
R_DSI R_AddCmdDrawStretchPic = (R_DSI)(opd_s*)&R_AddCmdDrawStretchPic_t;
void(*R_AddCmdDrawText)(const char *text, int maxChars, void *font, float x, float y, float xScale, float yScale, float rotation, const float *color, int style) = (void(*)(const char*, int, void*, float, float, float, float, float, const float*, int))&R_AddCmdDrawText_t;


Here is what each function does
    
-R_RegisterShader/Material_RegisterHandle = Returns address or pointer for your material you want to use. R_RegisterShader("white", 0);

-R_RegisterFont = Returns address or font_s * pointer for font you want to use. R_RegisterFont("fonts/consoleFont", 0);

-R_AddCmdDrawStretchPic = Draw Material On Screen.
-R_AddCmdDrawText = Draw Text On Screen


Here are some functions I use as well as font types for AW
    
float RED[4] = {1, 0, 0, 1};
float WHITE[4] = {1,1,1,1};
void DrawText(const char *xtext, float xx, float xy, const char *xfont, float xfontSize)
{
R_AddCmdDrawText(xtext, 0x7FFFFFFF, R_RegisterFont(xfont, 0), xx, xy, xfontSize, xfontSize, 0, WHITE, 0);
}
void DrawShader(float x, float y, float width, float height, const float * color, const char * material)
{
R_AddCmdDrawStretchPic(x, y, width, height, 1, 1, 1, 1, color, R_RegisterShader(material, 0));
}
#define titleFontBold24px "fonts/titleFontBold24px"
#define titleFontBold50px "fonts/titleFontBold50px"
#define titleFontBold30px "fonts/titleFontBold30px"
#define titleFontBold36px "fonts/titleFontBold36px"
#define titleFontBold18px "fonts/titleFontBold18px"
#define titleFontBolder24px "fonts/titleFontBolder24px"
#define titleFontBolder50px "fonts/titleFontBolder50px"
#define titleFontBolder30px "fonts/titleFontBolder30px"
#define titleFontBolder36px "fonts/titleFontBolder36px"
#define titleFontBolder18px "fonts/titleFontBolder18px"
#define bodyFontBold "fonts/bodyFontBold"
#define consoleFont "fonts/consoleFont"
#define titleFont "fonts/titleFont"
#define titleFontBold "fonts/titleFontBold"



And here is a simple CL_DrawTextHook function to display a shader and text

    

void CL_DrawTextHook()
{
DrawShader(300, 0, 400, 400, RED, "white");
DrawText("This is a text example", 400, 200, consoleFont, 1);
}


This isn't the best tutorial but if you read and understand it will be easy. If not just google "How to use engine text"

This can be used for All CODS and even more games you just have to find the right functions. I've done this with MW3 as well, it's pretty much the same just use the correct addresses. Those can be found here You must login or register to view this content.

If you need more help you can use my open source MW3 Engine text menu base as an example, it's not the best coding but it will help all the noobs it's pretty much the same as AW just different addresses

You must login or register to view this content.

Credits
    
SC58
Teh1337
Theriftboy
OSM
+More


Please do not post this tutorial in any other site, also please do not just convert this to other games and release that's kind of a dick move.

The following 15 users say thank you to Black Panther for this useful post:

Boliberrys, flynhigh09, Geo, hacking247, HiddenHour, JLM, LBK, MrToxlcBooty, OLDSCHOOLMODZHD, RatchetBooty, RGaming, RTE, Swaqq, SyGnUs, xProvXKiller
01-19-2015, 04:17 AM #11
Originally posted by hacking247 View Post
Trying to make a video of your base but unable to open in the game.


Do you have an EBOOT that loads MW3.sprx
01-19-2015, 05:01 AM #12
Originally posted by cl
Do you have an EBOOT that loads MW3.sprx

yea i made it with the ingame_loader Binary
01-19-2015, 05:24 AM #13
RGaming
Do a barrel roll!
Thanks a lot, usefull
01-19-2015, 11:29 AM #14
iTпDM
Vault dweller
Nice Release , but you can use this with PowerPc Happy
01-19-2015, 11:53 AM #15
Swaqq
Professional Thanker
Originally posted by cl
READ THE ENTIRE THREAD BEFORE REPLYING!



I'm going to tell you all how to do this because well I don't care having this to myself or whatever anymore. It's really simple to do and Xbox has had this for a few years. So I DON'T see the point in having this.

In this thread I will teach how to use Engine text and stuff

What is engine text?
Engine text is text that is called by the call of duty game engine. You maybe familiar with my offhost menu, this uses engine text and another thing that uses engine text is the "FPS" function.

What do I use this for?
You can use engine text for a lot of things. Mainly it is used for making nonhost mods such as: ESP, nonhost menus, etc.

How Do I Start Using This?

For starters you need to know how to hook functions. This basically means you need to hook a function that runs every frame of the game such as R_FrameSetFog (Or whatever it's called) or "FPS" function. This being said, you cannot hook functions like this with any external program, so sorry TMAPI and CCAPI users this must be done in a plugin either system or a game plugin (.SPRX)

Here is the function I use to hook my functions. Credits to Theriftboy for his help on Ps3hax and a few xbox modders.

PatchInJump
    
int32_t write_process(uint64_t ea, const void * data, uint32_t size)
{
system_call_4(905, (uint64_t)sys_process_getpid(), ea, size, (uint64_t)data);
return_to_user_prog(int32_t);
}
int Memcpy(PVOID destination, const PVOID source, size_t size)
{
system_call_4(905, (uint64_t)sys_process_getpid(), (uint64_t)destination, size, (uint64_t)source);
__dcbst(destination);
__sync();
__isync();
return_to_user_prog(int);
}
void PatchInJump(int Address, int Destination, bool Linked) {

// use this data to copy over the address
int FuncBytes[4];

// Get the actual destination address
Destination = *(int *)Destination;

FuncBytes[0] = 0x3D600000 + ((Destination >> 16) & 0xFFFF); // lis %r11, dest>>16
if (Destination & 0x8000) // If bit 16 is 1
FuncBytes[0] += 1;

FuncBytes[1] = 0x396B0000 + (Destination & 0xFFFF); // addi %r11, %r11, dest&0xFFFF
FuncBytes[2] = 0x7D6903A6; // mtctr %r11

FuncBytes[3] = 0x4E800420; // bctr

if (Linked)
FuncBytes[3] += 1; // bctrl

Memcpy((void*)Address, FuncBytes, 4 * 4);
}


If this code gives you errors, make sure to add the following additional dependencies and header files


    
#pragma comment(lib, "sysmodule_stub")
#include <cell/pad.h>
#include <string>
#include <sys/random_number.h>
#pragma comment(lib, "c")
#include <sys/memory.h>
#include <fastmath.h>
#include <ppu_intrinsics.h>

$(SCE_PS3_ROOT)\target\ppu\lib\libc.a
$(SCE_PS3_ROOT)\target\ppu\lib\libc_stub.a
$(SN_PS3_PATH)\ppu\lib\sn\libsn.a
$(SCE_PS3_ROOT)\target\ppu\lib\libm.a
$(SCE_PS3_ROOT)\target\ppu\lib\libio_stub.a
$(SCE_PS3_ROOT)\target\ppu\lib\libsysutil_stub.a
$(SCE_PS3_ROOT)\target\ppu\lib\libsysmodule_stub.a
$(SCE_PS3_ROOT)\target\ppu\lib\libsyscall.a
$(SCE_PS3_ROOT)\target\ppu\lib\libstdc++_stub.a
$(SCE_PS3_ROOT)\target\ppu\lib\fno-exceptions\libstdc++_stub.a
$(SCE_PS3_ROOT)\target\ppu\lib\fno-exceptions\fno-rtti\libstdc++_stub.a
$(SCE_PS3_ROOT)\target\ppu\lib\libgcm_sys_stub.a



Next, what you want to do is go to your prx entry function and add your patchinjump code like I do here
You must login or register to view this content.

    
- The 0x4A5508is AW's "FPS" function
-(int)CL_DrawTextHook is my function that I'm using to display the engine functions
-false is an argument that you put


Next you want to create your function like I made mine "CL_DrawTextHook"

In my menu I'm using R_AddCmdDrawText and R_AddCmdDrawStretchPic for Text and Material

Some Engine Functions for Advanced Warfare 1.06
    
opd_s R_AddCmdDrawStretchPic_t = { 0x5D59D8, TOC };//Maybe 0x5D5980
opd_s R_AddCmdDrawText_t = { 0x5D5F28, TOC };
opd_s Material_RegisterHandle_t = { 0x5C9900, TOC };
opd_s R_RegisterFont_t = { 0x22B938, TOC };

void*(*R_RegisterShader)(const char * material, int imageTrack) = (void*(*)(const char *, int))&Material_RegisterHandle_t;
void*(*R_RegisterFont)(const char * font, int imageTrack) = (void*(*)(const char *, int))&R_RegisterFont_t;
typedef void(*R_DSI)(float x, float y, float w, float h, float xScale, float yScale, float xay, float yay, const float *color, void * material);
R_DSI R_AddCmdDrawStretchPic = (R_DSI)(opd_s*)&R_AddCmdDrawStretchPic_t;
void(*R_AddCmdDrawText)(const char *text, int maxChars, void *font, float x, float y, float xScale, float yScale, float rotation, const float *color, int style) = (void(*)(const char*, int, void*, float, float, float, float, float, const float*, int))&R_AddCmdDrawText_t;


Here is what each function does
    
-R_RegisterShader/Material_RegisterHandle = Returns address or pointer for your material you want to use. R_RegisterShader("white", 0);

-R_RegisterFont = Returns address or font_s * pointer for font you want to use. R_RegisterFont("fonts/consoleFont", 0);

-R_AddCmdDrawStretchPic = Draw Material On Screen.
-R_AddCmdDrawText = Draw Text On Screen


Here are some functions I use as well as font types for AW
    
float RED[4] = {1, 0, 0, 1};
float WHITE[4] = {1,1,1,1};
void DrawText(const char *xtext, float xx, float xy, const char *xfont, float xfontSize)
{
R_AddCmdDrawText(xtext, 0x7FFFFFFF, R_RegisterFont(xfont, 0), xx, xy, xfontSize, xfontSize, 0, WHITE, 0);
}
void DrawShader(float x, float y, float width, float height, const float * color, const char * material)
{
R_AddCmdDrawStretchPic(x, y, width, height, 1, 1, 1, 1, color, R_RegisterShader(material, 0));
}
#define titleFontBold24px"fonts/titleFontBold24px"
#define titleFontBold50px"fonts/titleFontBold50px"
#define titleFontBold30px"fonts/titleFontBold30px"
#define titleFontBold36px"fonts/titleFontBold36px"
#define titleFontBold18px"fonts/titleFontBold18px"
#define titleFontBolder24px"fonts/titleFontBolder24px"
#define titleFontBolder50px"fonts/titleFontBolder50px"
#define titleFontBolder30px"fonts/titleFontBolder30px"
#define titleFontBolder36px"fonts/titleFontBolder36px"
#define titleFontBolder18px"fonts/titleFontBolder18px"
#define bodyFontBold"fonts/bodyFontBold"
#define consoleFont"fonts/consoleFont"
#define titleFont"fonts/titleFont"
#define titleFontBold"fonts/titleFontBold"



And here is a simple CL_DrawTextHook function to display a shader and text

    

void CL_DrawTextHook()
{
DrawShader(300, 0, 400, 400, RED, "white");
DrawText("This is a text example", 400, 200, consoleFont, 1);
}


This isn't the best tutorial but if you read and understand it will be easy. If not just google "How to use engine text"

This can be used for All CODS and even more games you just have to find the right functions. I've done this with MW3 as well, it's pretty much the same just use the correct addresses. Those can be found here You must login or register to view this content.

If you need more help you can use my open source MW3 Engine text menu base as an example, it's not the best coding but it will help all the noobs it's pretty much the same as AW just different addresses

You must login or register to view this content.

Credits
    
SC58
Teh1337
Theriftboy
OSM
+More


Please do not post this tutorial in any other site, also please do not just convert this to other games and release that's kind of a dick move.


I've had this for a while on mw3, nice release Winky Winky
01-19-2015, 12:52 PM #16
lutsch1234
Bounty hunter
Its not working i put the eboot in the mw3 game Directory and the sprx in dev_hdd0/tmp and yes the eboot should load the sprx
01-19-2015, 02:37 PM #17
Originally posted by DM View Post
Nice Release , but you can use this with PowerPc Happy


Why would you do that...
01-19-2015, 02:38 PM #18
Originally posted by lutsch1234 View Post
Its not working i put the eboot in the mw3 game Directory and the sprx in dev_hdd0/tmp and yes the eboot should load the sprx


Yeah MW3 is weird sometimes it works sometimes it doesn't. It's just an example
01-19-2015, 02:38 PM #19
Originally posted by Swaqq View Post
I've had this for a while on mw3, nice release Winky Winky


Oh yeah I bet

The following user thanked Black Panther for this useful post:

Joren

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo