Raised This Month: $ Target: $400
 0% 

Please help to fix throwing of "Access violation writing location" exception (C++)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Immortal_BLG
Member
Join Date: Feb 2010
Location: RUSSIA
Old 03-05-2010 , 04:38   Please help to fix throwing of "Access violation writing location" exception (C++)
Reply With Quote #1

Here below is attached source code of function set_hook, which works, but after performance of the callback function and transfer control back to function __common_hook_proc, on a line 80 (mov byte ptr [edi], 0E9h) is throwing exception "Access violation writing location". Help fix please!

P.S. Sorry for BAD english, but please help to me!!
Attached Files
File Type: zip misc_hook.zip (1.3 KB, 108 views)

Last edited by Immortal_BLG; 03-05-2010 at 04:42.
Immortal_BLG is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 03-05-2010 , 05:07   Re: Please help to fix throwing of "Access violation writing location" exception (C++
Reply With Quote #2

Quote:
Originally Posted by Immortal_BLG View Post
Here below is attached source code of function set_hook, which works, but after performance of the callback function and transfer control back to function __common_hook_proc, on a line 80 (mov byte ptr [edi], 0E9h) is throwing exception "Access violation writing location". Help fix please!

P.S. Sorry for BAD english, but please help to me!!
What you want __common_hook_proc to do? I mean, what all that inline assembly is supposed to do?
__________________
joaquimandrade is offline
Immortal_BLG
Member
Join Date: Feb 2010
Location: RUSSIA
Old 03-05-2010 , 05:21   Re: Please help to fix throwing of "Access violation writing location" exception (C++
Reply With Quote #3

This is not my code, I only want to adapt it for my bot without crashes
Immortal_BLG is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 03-05-2010 , 05:52   Re: Please help to fix throwing of "Access violation writing location" exception (C++
Reply With Quote #4

(mov byte ptr [edi], 0E9h) + Join Date: Feb 2010
*sigh*

I'll give a look.
Seta00 is offline
Immortal_BLG
Member
Join Date: Feb 2010
Location: RUSSIA
Old 03-05-2010 , 06:07   Re: Please help to fix throwing of "Access violation writing location" exception (C++
Reply With Quote #5

Quote:
Originally Posted by Seta00
(mov byte ptr [edi], 0E9h) + Join Date: Feb 2010
What do you mean?

P.S. Link to hook page (IN RUSSIAN :{D) http://awin.spb.ru/articles/hook1.html
Immortal_BLG is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 03-05-2010 , 06:09   Re: Please help to fix throwing of "Access violation writing location" exception (C++
Reply With Quote #6

Quote:
Originally Posted by Immortal_BLG View Post
What do you mean?

P.S. Link to hook page (IN RUSSIAN :{D) http://awin.spb.ru/articles/hook1.html
What you need is a generic hooker. Try here. I haven't used it but that sourcemod extension contains a class for detouring.

http://forums.alliedmods.net/showthread.php?t=72322
__________________
joaquimandrade is offline
Immortal_BLG
Member
Join Date: Feb 2010
Location: RUSSIA
Old 03-05-2010 , 06:18   Re: Please help to fix throwing of "Access violation writing location" exception (C++
Reply With Quote #7

I already have it, but I do not like. (too much code)

P.S. Please do not offer other ways to hook - I need only this!
Immortal_BLG is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-05-2010 , 13:50   Re: Please help to fix throwing of "Access violation writing location" exception (C++
Reply With Quote #8

Quote:
Originally Posted by Seta00
[...] + Join Date: Feb 2010
*sigh*
Not for nothing, but you have only a few days/weeks 'tenure' on the guy. And what's with the sigh? Its not like he's holding a gun to your head to help him. Just saying.
__________________
Bugsy is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 03-05-2010 , 14:41   Re: Please help to fix throwing of "Access violation writing location" exception (C++
Reply With Quote #9

He's doing some really advanced stuff, will be faster if he learns the AMXx structure in detail before trying some ASM hax.
Seta00 is offline
Immortal_BLG
Member
Join Date: Feb 2010
Location: RUSSIA
Old 03-05-2010 , 22:40   Re: Please help to fix throwing of "Access violation writing location" exception (C++
Reply With Quote #10

What I am doing has nothing to do with AMXX mod. But I think that because of this nobody will blame me.

Well, somebody help me?
Immortal_BLG is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:48.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode