jeudi 30 janvier 2014

[Help] calling a fuction by address? topic




Hello Friends,

I want to call a function in a Process i injected my dll to from which I got the Address with the FindPattern function.
this is function head:

PHP Code:







void __cdecl draw_text(const char *strint leftint topint rint gint bint aint cursorint maxwidth









(this is what ida spits out)
I tried assigning the address to a function pointer but does not work

PHP Code:







void __cdecl *draw_text_t)(const char *strint leftint top,int,int,int,int,int,int) = draw_text









It says i can't initiallize a function by DWORD.

then I tried calling function manually

PHP Code:







void callDrawText(const char *strint leftint topDWORD drawText)
{
    
__asm
    
{
        
push 0xFFFFFFFF
        push 0xFFFFFFFF
        push 0xFF
        push 0xFF
        push 0xFF
        push 0xFF
        push top
        push left
        push str
        call drawText
    
}//where drawText holds the address of function










but it crashes and says ESP not got saved correctly???

Could you help me? Thanks in advance :yikes:





Aucun commentaire:

Enregistrer un commentaire