EMO Style ForumPro - Hos Geldiniz
Hooking address (GCC) Uyeols10

Join the forum, it's quick and easy

EMO Style ForumPro - Hos Geldiniz
Hooking address (GCC) Uyeols10
EMO Style ForumPro - Hos Geldiniz
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Giriş yap

Şifremi unuttum

Istatistikler
Toplam 203 kayıtlı kullanıcımız var
Son kaydolan kullanıcımız: crayzboy76

Kullanıcılarımız toplam 1186 mesaj attılar bunda 862 konu
Tarıyıcı
 Kapı
 Indeks
 Üye Listesi
 Profil
 SSS
 Arama
Arama
 
 

Sonuç :
 


Rechercher çıkıntı araştırma

RSS akısı


Yahoo! 
MSN 
AOL 
Netvibes 
Bloglines 


Anahtar-kelime

kutu  loot  pointer  

Kimler hatta?
Toplam 3 kullanıcı online :: 0 Kayıtlı, 0 Gizli ve 3 Misafir

Yok

[ Bütün listeye bak ]


Sitede bugüne kadar en çok 217 kişi C.tesi Tem. 29, 2017 1:46 am tarihinde online oldu.
En son konular
» İnternetten Para Kazandıran Oyun ! Ödeme Alt Limiti Yok ! DEV KONU
Hooking address (GCC) I_icon_minitimeCuma Ağus. 29, 2014 8:33 am tarafından Hello EMO

» goldenchase.net maden yaparak para kazanma
Hooking address (GCC) I_icon_minitimeCuma Ağus. 29, 2014 8:18 am tarafından Hello EMO

» etichal hacker görsel egitim seti
Hooking address (GCC) I_icon_minitimeÇarş. Ağus. 06, 2014 4:57 am tarafından Hello EMO

» KO TBL Source C#
Hooking address (GCC) I_icon_minitimePtsi Ara. 09, 2013 6:36 am tarafından Hello EMO

» x86 Registers
Hooking address (GCC) I_icon_minitimeC.tesi Ağus. 24, 2013 5:02 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de WYD
Hooking address (GCC) I_icon_minitimeÇarş. Tem. 10, 2013 7:25 am tarafından Hello EMO

» [Tutorial] Pegando Address, Pointers de CS Metodo²
Hooking address (GCC) I_icon_minitimeÇarş. Tem. 10, 2013 7:23 am tarafından Hello EMO

» [Tutorial] Aprendendo basico deASM OLLYDBG
Hooking address (GCC) I_icon_minitimeÇarş. Tem. 10, 2013 7:22 am tarafından Hello EMO

» Basic C# DLL injector
Hooking address (GCC) I_icon_minitimePtsi Tem. 08, 2013 7:48 am tarafından Hello EMO

Reklam

Hooking address (GCC)

Aşağa gitmek

Hooking address (GCC) Empty Hooking address (GCC)

Mesaj tarafından EMO Perş. Haz. 02, 2011 8:59 am

Hello,



I'm trying to hook a function, I know the address, but the problem is
I'm using GCC now, I used to be using VS and my method does not work
anymore,



Code:
void Hooks::EnableHooks ()

{

*(char*)ulSend = 0xE9;

*(long*)ulSend + 1 = NewSendFun - ulSend - 5; // error line

}





/* New functions for hooked Functions */

void Hooks::NewSendFun()

{

__asm__ (

"mov [ppSendPacket],%espnt"

"pushant"

"call SendPacketCallbacknt"

"popant"

"jmp *%ulSendRet]nt"

);

}



The error line gives this error:

invalid use of member(did you forget the '&'?)



Hope someone can help me.



-----------------------------------------------------------------------------------------------------


Jani wrote:
You
don't have to make the whole class static. Only the member receiving
the callback. This is because the compiler can't just run a method of a
class, which doesn't have an instance. The other way would be to tell
the compiler which instance of the object to use and then call the
member: ((class).*(member))(args). But seeing the case, using a static
member is much more easier.

I'm not sure what you mean by "((class).*(member))(args)", because dot
is used with class instance - objects, not class, you should've used ::
instead. and by member I assumed you meant the function, and then I
don't understand what's the dereference operator for... get the
function's... value? and the call it with the arguments?

I think you meant:

((return_type (call_convention*)(void*))class::member)(&object)

for example:

((int (__cdecl*)(void*, other_params))class::member)(&object, other_param)

because "this" pointer is passed as a paramater.



Unfortunatly, the compiler didn't like me converting a class method to a
pointer (int*, char*, void*, nothing...) even though it worked
perfectly fine with functions that didn't belong to a class, so I had to
write a warper, nothing too complicated, just a few lines of inline
assembly.

Here's an example:

Code:
#include



class Class

{

public:

void* __stdcall GetThisPointer() { return (void*)this; }

};



//This is how the compiler implements the function

//"this" pointer is passed as a paramater

void* GetThisPointer_Implementation(Class* object)

{

return (void*)object;

}



//Proof of Concept

int __declspec(naked) GetThisPointer_PoC(Class* object)

{

__asm

{

PUSH EBP //since we specified __declspec(naked)

MOV EBP, ESP //fix stack

//if GetThisPointer was __cdecl (by default) then

//you should've used "MOV ECX, object" instead of "PUSH object"

PUSH object //Pass "this" pointer as a parameter

LEA EAX, [Class::GetThisPointer]

CALL EAX

POP EBP

RETN 4

}

}



int main()

{

Class Object;



printf("Object (%p) = this (%p)n", &Object, Object.GetThisPointer());

printf("Implementation: %pn", GetThisPointer_Implementation(&Object));

printf("Proof of Concept: %pn", GetThisPointer_PoC(&Object));



return 0;

}
EMO
EMO
EMO Team
EMO Team

Cinsiyet : Erkek
Burçlar : Yay
Yılan
Mesaj Sayısı : 184
Puan : 236543
Rep Puanı : 5
Doğum tarihi : 28/11/89
Kayıt tarihi : 18/05/11
Yaş : 34
Nerden : EMO world
İş/Hobiler : RCE Student / Game Hacking / Learn Beginner C#,C++,Delphi
Lakap : EMO

Sayfa başına dön Aşağa gitmek

Sayfa başına dön

- Similar topics

 
Bu forumun müsaadesi var:
Bu forumdaki mesajlara cevap veremezsiniz