View previous topic :: View next topic |
Author |
Message |
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8516 Location: 127.0.0.1
|
Posted: Sun Jan 16, 2011 2:19 pm Post subject: |
|
|
Demolish wrote: | Wiccaan wrote: | Use showMessage(msg) then.
Example:
Code: | showMessage("Hello world!"); |
|
this isn't that easy, I'd like to know how to hook functions, not only ShowMessage, but send,recv functions of winsock |
You asked how to show a message box as soon as you click execute, using showMessage() as the first thing in your script will accomplish that.
Heres a small example of hooking send:
Code: |
--[[
Send Hook Example
by atom0s [Wiccaan]
]]--
local Hook_Example = {}
function Hook_Example.Main( )
-- Obtain original send pointer.
Hook_Example.sendPointer = getAddress( "send" );
-- Error checking..
if( Hook_Example.sendPointer == nil ) or ( Hook_Example.sendPointer == 0 ) then
showMessage( "Failed to hook send, possibly not imported by process." );
return false;
end
-- Set debugger callback.
debugger_onBreakpoint = Hook_Example.OnBreakpoint;
-- Apply breakpoint.
debug_setBreakpoint( "send" );
return true;
end
function Hook_Example.OnBreakpoint( )
-- Skip if not send breakpoint.
if( EIP ~= Hook_Example.sendPointer ) then
return 1;
end
-- Obtain information from call stack.
local retaddr = readInteger( ESP );
local socket = readInteger( ESP + 4 );
local buffer = readInteger( ESP + 8 );
local length = readInteger( ESP + 12 );
local flags = readInteger( ESP + 16 );
-- Remove hook after first break.
debug_removeBreakpoint( "send" );
-- Display param info.
showMessage( string.format(
"Socket: %d\nBuffer: %d\nLength: %d\nFlags: %d", socket, buffer, length, flags
) );
return 1;
end
Hook_Example.Main(); |
_________________
- Retired. |
|
Back to top |
|
|
Demolish Cheater Reputation: 0
Joined: 27 Dec 2010 Posts: 32
|
Posted: Sun Jan 16, 2011 2:44 pm Post subject: |
|
|
Ok, this is still not that what I wish to do ;p
For example: Your code is like a function of filter in a WPE PRO, I want to send packet like in WPE PRO. I want to call function from another process.
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8516 Location: 127.0.0.1
|
Posted: Sun Jan 16, 2011 3:05 pm Post subject: |
|
|
Demolish wrote: | Ok, this is still not that what I wish to do ;p
For example: Your code is like a function of filter in a WPE PRO, I want to send packet like in WPE PRO. I want to call function from another process. |
You'll need to hook send like above to obtain the current socket being used for the overall connection. (Or locate a pointer that holds the socket in memory.)
Once you have the socket, you can use the CreateThread method of calling functions / API.
_________________
- Retired. |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Sun Jan 16, 2011 3:56 pm Post subject: |
|
|
as I said before, combine it with a dll
let the dll create a gui and let ce hook the api
That way it's a lot easier to show and modify stuff
e.g: See the packet editor plugin in ce 5.6.1: what it does is inject the dll that shows a gui and hook the winsock api so that whenm it's called it goes through the dll's function instead
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Demolish Cheater Reputation: 0
Joined: 27 Dec 2010 Posts: 32
|
Posted: Mon Jan 17, 2011 10:06 am Post subject: |
|
|
I've learned much from you both This will help not only me but others
Wiccaan wrote: | Demolish wrote: | Ok, this is still not that what I wish to do ;p
For example: Your code is like a function of filter in a WPE PRO, I want to send packet like in WPE PRO. I want to call function from another process. |
You'll need to hook send like above to obtain the current socket being used for the overall connection. (Or locate a pointer that holds the socket in memory.)
Once you have the socket, you can use the CreateThread method of calling functions / API. |
Shouldn't I use CreateRemoteThread? And can you tell me more about this function?
Dark Byte wrote: | as I said before, combine it with a dll
let the dll create a gui and let ce hook the api
That way it's a lot easier to show and modify stuff
e.g: See the packet editor plugin in ce 5.6.1: what it does is inject the dll that shows a gui and hook the winsock api so that whenm it's called it goes through the dll's function instead |
It isn't Open Source for my bad ;/
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8516 Location: 127.0.0.1
|
|
Back to top |
|
|
Demolish Cheater Reputation: 0
Joined: 27 Dec 2010 Posts: 32
|
Posted: Wed Jan 26, 2011 5:47 am Post subject: |
|
|
So, I have 1 more question and the question is on the picture:
Code: | img683.imageshack.us/f/questionc.png/ |
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8516 Location: 127.0.0.1
|
Posted: Wed Jan 26, 2011 4:50 pm Post subject: |
|
|
Jumps are calculated. They are the relative position to either a jump table or the actual function itself.
_________________
- Retired. |
|
Back to top |
|
|
Demolish Cheater Reputation: 0
Joined: 27 Dec 2010 Posts: 32
|
Posted: Thu Jan 27, 2011 3:05 pm Post subject: |
|
|
Wiccaan wrote: | Jumps are calculated. They are the relative position to either a jump table or the actual function itself. |
ohh i forgot about it, thanks for remind me, that was very usefull for my project, i've wrote class in vb6 that calls functions in other processes like send, MessageBoxA, and alot more I can hook every function to call it
;D
|
|
Back to top |
|
|
SEVENS How do I cheat? Reputation: 0
Joined: 20 Nov 2012 Posts: 1
|
Posted: Tue Nov 20, 2012 5:41 am Post subject: ... |
|
|
Guys,
Someone help me transcribe this code to work with autoit?
I got the idea of making a script to hook ws32_2.dll send function in order to customize and send packets ..
I can already hook "send" and "recv" func. to read packets sent and received, works like a charm.. but modify them is more difficult. :- )
If anyone want to help me in this project I post my partial script.
Cheers!! From Brazil.
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8516 Location: 127.0.0.1
|
Posted: Tue Nov 20, 2012 7:37 am Post subject: |
|
|
This site is for Cheat Engine, not AutoIt.
If you wish to receive support for AutoIt you are better off asking on their forums instead.
_________________
- Retired. |
|
Back to top |
|
|
|