First of all,after many days Thanks for ccman32 explaining knife boost ,and I found it .thank you very much.
New problem about ue AVA sdk:
In the hookprocessEvent()
Code:
if (!strcmp(FunctionName, "Function avaGame.avaGameViewportClient.PostRender"))
{
UGameViewportClient* viewport = (UGameViewportClient*)pCallObject;
Logf("viewport = (UGameViewportClient*)pCallObject\n");
if (viewport)
{
UGameViewportClient_eventPostRender_Parms* parameters = (UGameViewportClient_eventPostRender_Parms*)pParms;
Logf("parameters = (UGameViewportClient_eventPostRender_Parms*)pParms\n");
if (parameters)
{
// PostRender(parameters->Canvas); // when do this game crashed
Logf("//PostRender(parameters->Canvas); // if don't do postRender ,logf success,and game not crash
}
}
}
Code:
void PostRender ( UCanvas* pCanvas ) //Hooked postrender, draw stuff here!
{
if (pCanvas)
{
Logf("=In the DrawCrossHair=");
DrawCossHair(pCanvas); // Crash here
}
}
Code:
void DrawCossHair(UCanvas* pCanvas)
{
Logf("=In CrossHair=\n");
FColor Green = MakeColor(0,255,0,255);
Logf("=Ready Draw2DLine=\n");
pCanvas->UCanvas::Draw2DLine(200, 200, 400, 400, Green);//Error
Logf("=After Draw2DLine=\n");
// pCanvas->Draw2DLine(pCanvas->ClipX/2 ,pCanvas->ClipY/2 -10, pCanvas->ClipX/2 ,pCanvas->ClipY/2 +10,Green);// Crashed Here
Logf("=End CrossHair=\n");
}
So the problem is why when Draw2DLine cause crash.
Since do this success,
hookProcess
{
...........
// postRender(); don't do this ,don't draw2Dline.
log() ;
..........
}
need master for help, so
@ccman32
@AVA PlaYe
@Riddick
@bollafa