| View previous topic :: View next topic   | 
	
	
	
		| Author | 
		Message | 
	
	
		Stylo Grandmaster Cheater Supreme
  Reputation: 3
  Joined: 16 May 2007 Posts: 1073 Location: Israel
  | 
		
			
				 Posted: Mon Apr 06, 2009 3:37 am    Post subject: hooking send api? | 
				       | 
			 
			
				
  | 
			 
			
				i'm having trouble with hooking send api through an executable file
 
through a dynamic library it's all good (using virtualprotect and you're done)
 
but i guess it should be different through exe's ?
 
cuz they have their own memory space and not injected to the process's memory space?!?!
 
so does any1 have an idea how to remove the memory protection?
 | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		Jani Grandmaster Cheater
  Reputation: 2
  Joined: 29 Dec 2006 Posts: 804
 
  | 
		
			
				 Posted: Mon Apr 06, 2009 4:16 am    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				| VirtualProtectEx()
 | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		Stylo Grandmaster Cheater Supreme
  Reputation: 3
  Joined: 16 May 2007 Posts: 1073 Location: Israel
  | 
		
			
				 Posted: Mon Apr 06, 2009 4:26 am    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				omg i'm so dumb XD
 
thx   
 
 
@edit: a little problem here
 
to what process do i need to change the memory?
 
i mean the function is in ws2_32.dll but what process load that file?
 | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		HolyBlah Master Cheater
  Reputation: 2
  Joined: 24 Aug 2007 Posts: 446
 
  | 
		
			
				 Posted: Mon Apr 06, 2009 8:52 am    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				| The same one that you usually inject dynamic library into.
 | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		&Vage Grandmaster Cheater Supreme
  Reputation: 0
  Joined: 25 Jul 2008 Posts: 1053
 
  | 
		
			
				 Posted: Mon Apr 06, 2009 8:46 pm    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				 	  | 1qaz wrote: | 	 		  omg i'm so dumb XD
 
thx   
 
 
@edit: a little problem here
 
to what process do i need to change the memory?
 
i mean the function is in ws2_32.dll but what process load that file? | 	  
 
You need to change the process that you are using. It'll only affect that process's memory space.
 | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		slippppppppp Grandmaster Cheater
  Reputation: 0
  Joined: 08 Aug 2006 Posts: 929
 
  | 
		
			
				 Posted: Mon Apr 06, 2009 9:52 pm    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				 	  | Quote: | 	 		  @edit: a little problem here
 
to what process do i need to change the memory?
 
i mean the function is in ws2_32.dll but what process load that file? | 	  
 
 
It depends. What process are you trying to intercept packets on?
 | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		Stylo Grandmaster Cheater Supreme
  Reputation: 3
  Joined: 16 May 2007 Posts: 1073 Location: Israel
  | 
		
			
				 Posted: Mon Apr 06, 2009 10:32 pm    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				i'm trying to capture msn or icq packets
 
it's possible i know since i succeded doing it using dll
 
btw how do i get the base address of process?
 
i was thinking about
 
 	  | Code: | 	 		  
 
MEMORY_BASIC_INFORMATION mbi;
 
VirtualQueryEx(hProc,NULL,&mbi,sizeof(mbi));
 
// then i'll just pop it up from mbi.BaseAddress
 
 | 	  
 
but it keeps returning me null :\ any ideas?
 | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		BanMe Master Cheater
  Reputation: 0
  Joined: 29 Nov 2005 Posts: 375 Location: Farmington NH, USA
  | 
		
			
				 Posted: Tue Apr 07, 2009 11:18 am    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				 	  | Code: | 	 		  
 
ULONG ModBase = (ULONG)GetModuleHandle(0);
 
 | 	  
 
 
regards BanMe
 _________________
 don't +rep me..i do not wish to have "status" or "recognition" from you or anyone.. thank you.  | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		Stylo Grandmaster Cheater Supreme
  Reputation: 3
  Joined: 16 May 2007 Posts: 1073 Location: Israel
  | 
		
			
				 Posted: Tue Apr 07, 2009 12:04 pm    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				oh   i think u miss understand me
 
i asked how to get the base address of any process that i want
 
not the current process of my program   
 | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		BanMe Master Cheater
  Reputation: 0
  Joined: 29 Nov 2005 Posts: 375 Location: Farmington NH, USA
  | 
		 | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		Stylo Grandmaster Cheater Supreme
  Reputation: 3
  Joined: 16 May 2007 Posts: 1073 Location: Israel
  | 
		
			
				 Posted: Tue Apr 07, 2009 12:58 pm    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				oh great that's awesome
 
never heard about memoryentry structure 
 
thanks :]
 
@edit:
 
how does it return dword when mobBaseAddress is actually byte* ?
 
i tried returning byte* with the function but it keeps returning me the same address for every process
 
i think i missed something here :s ?!
 | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		&Vage Grandmaster Cheater Supreme
  Reputation: 0
  Joined: 25 Jul 2008 Posts: 1053
 
  | 
		
			
				 Posted: Tue Apr 07, 2009 3:28 pm    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				 	  | BanMe wrote: | 	 		   	  | Code: | 	 		  
 
ULONG ModBase = (ULONG)GetModuleHandle(0);
 
 | 	  
 
 
regards BanMe | 	  
 
You should use ULONG_PTR;
 
 
You could also get the PEB base then access IMAGEBASEADDRESS.
 | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		BanMe Master Cheater
  Reputation: 0
  Joined: 29 Nov 2005 Posts: 375 Location: Farmington NH, USA
  | 
		 | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		&Vage Grandmaster Cheater Supreme
  Reputation: 0
  Joined: 25 Jul 2008 Posts: 1053
 
  | 
		
			
				 Posted: Tue Apr 07, 2009 4:52 pm    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				 	  | BanMe wrote: | 	 		  first off fuck ULONG_PTR ..32 bit debuggers don't track 64 bit variables.. if you want that crap annoying you fine, use find replace..dont bother me with your "you should code this way" crap..
 
and 2nd off the PEB is accessible from the current process where as 1gaz wanted remote process information..though i agree it is a usable idea within the current process  
 
 
and im sorry 1gaz i didnt look hard enough at all aspects of MODULEENTRY32.. but the simple fix is to change ME.modBaseAddress to (ULONG)ME.hModule..  :]
 
 
regards BanMe | 	  
 
 
Rofl you suggested using the PEB before from one of your post and now I can't, what are you a hypocrite. &Also I didn't see the OP wanted to debug, so stop your idiotic assumptions.
 
 
I didn't even read the thread fully, just go jump off a cliff please.
 | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		BanMe Master Cheater
  Reputation: 0
  Joined: 29 Nov 2005 Posts: 375 Location: Farmington NH, USA
  | 
		
			
				 Posted: Tue Apr 07, 2009 4:59 pm    Post subject:  | 
				       | 
			 
			
				
  | 
			 
			
				@irwin actually no the code was left with intentional errors and shortfalls to make the OP apply some effort to understanding the code and have a better understanding of logic analysis. thanks for your support in the matter of "pointing out the obvious" but next time try to keep it to yourself...
 
 
 
@:... LOL!!!!! i suggested using the PEB when the circumstances fit the requirements(ie accessing the PEB from the Current Process..) i agree with the you in accessing the PEB to obtain Current Process Info but to obtain Remote Process info, accessing the PEB is inpractical and adds more headaches then its worth..but yea good job reading what i said..
 
 
regards BanMe
 _________________
 don't +rep me..i do not wish to have "status" or "recognition" from you or anyone.. thank you. 
  Last edited by BanMe on Tue Apr 07, 2009 5:06 pm; edited 1 time in total | 
			 
		  | 
	
	
		| Back to top | 
		 | 
	
	
		  | 
	
	
		 |