Raised This Month: $ Target: $400
 0% 

Orpheu replace variable


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarkGL
Senior Member
Join Date: Aug 2010
Location: Warsaw, Poland
Old 08-05-2011 , 07:54   Orpheu replace variable
Reply With Quote #1

I want to replace variable value in function for example
Code:
signed int __cdecl SV_CheckKeyInfo(int a1, int a2, int a3, int a4, int a5, char *s)
{
  int v6; // edi@1
  int v7; // eax@1
  signed int result; // eax@2
  int v9; // esi@3

  v7 = Info_ValueForKey(a2, "prot");
  v6 = Q_atoi(v7);
  if ( (unsigned int)(v6 - 1) <= 3 )
  {
    v9 = Info_ValueForKey(a2, "raw");
    if ( Q_strlen(v9) > 0 && (v6 != 2 || Q_strlen(v9) == 32) )
    {
      Q_strcpy(a5, v9);
      if ( v6 == 2 || (v9 = Info_ValueForKey(a2, "cdkey"), Q_strlen(v9) == 32) )
      {
        snprintf(s, 0x40u, "%s", v9);
        *(_WORD *)a3 = Q_atoi("27005");
        *(_DWORD *)a4 = v6;
        result = 1;
      }
      else
      {
        SV_RejectConnection(a1, "Invalid hashed CD key.\n");
        result = 0;
      }
    }
    else
    {
      SV_RejectConnection(a1, "Invalid authentication certificate length.\n");
      result = 0;
    }
  }
  else
  {
    SV_RejectConnection(a1, "Invalid connection.\n");
    result = 0;
  }
  return result;
}
and I want to set v6 to 2 and result to 5 it's possible ?
DarkGL is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-05-2011 , 08:06   Re: Orpheu replace variable
Reply With Quote #2

- Hook Q_atoi and change the returned value.
- Why 5 ? Returning 5 whatever the checks, I guess, hooking SV_CheckKeyInfo and returning such value would work. If hookable.
__________________
Arkshine is offline
DarkGL
Senior Member
Join Date: Aug 2010
Location: Warsaw, Poland
Old 08-05-2011 , 08:08   Re: Orpheu replace variable
Reply With Quote #3

- how ?
- it's just for example
DarkGL is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-05-2011 , 08:11   Re: Orpheu replace variable
Reply With Quote #4

How ? You don't know how to make signature file ?
__________________
Arkshine is offline
DarkGL
Senior Member
Join Date: Aug 2010
Location: Warsaw, Poland
Old 08-05-2011 , 08:15   Re: Orpheu replace variable
Reply With Quote #5

but Q_atoi is not function on engine or mod , or maybe I'm blind
DarkGL is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-05-2011 , 08:20   Re: Orpheu replace variable
Reply With Quote #6

If it's used into the engine library, it means, it's referenced there and it is, just checked.
__________________
Arkshine is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 08-05-2011 , 08:25   Re: Orpheu replace variable
Reply With Quote #7

change value is easy, but could u tell what exactly you are going to do?
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
DarkGL
Senior Member
Join Date: Aug 2010
Location: Warsaw, Poland
Old 08-05-2011 , 08:39   Re: Orpheu replace variable
Reply With Quote #8

I wana just learn how to do that.
how to change code in function no just return but set that some of the code is skipped , changing values of variables and others that give us a powerful capabilities
DarkGL is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 08-05-2011 , 08:53   Re: Orpheu replace variable
Reply With Quote #9

so, this is not a particular hacking demand. You just want to know how to patch memory?
well, then you need to know at least some asm operation first.
changing value is the easiest thing of patching memory, espeically a const.
sorry can't give u example with orpheu, cause I never use that module before.
I suggest u coding a module for hacking memory, that's an easy way to do that.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
DarkGL
Senior Member
Join Date: Aug 2010
Location: Warsaw, Poland
Old 08-05-2011 , 09:04   Re: Orpheu replace variable
Reply With Quote #10

Ok I will read about it
maybe someone give example in orpheu , also how to check variable address in IDA if I have address I could use OrpheuMemoryReplaceAtAddress
some of the code is skipped - it can be done with memory patch ? or with orpheu ?
DarkGL 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 03:26.


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