Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Coding Corner
You last visited: Today at 18:59

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Help] Get the Max HP ..

Discussion on [Help] Get the Max HP .. within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2010
Posts: 16
Received Thanks: 0
[Help] Get the Max HP ..

I'm trying to get the max hp based on the address ..
I got this in olly:

Code:
009D4B60   . 8B4424 04      MOV EAX,DWORD PTR SS:[ESP+4]
009D4B64   . 8981 58040000  MOV DWORD PTR DS:[ECX+458],EAX
009D4B6A   . A1 0CF81001    MOV EAX,DWORD PTR DS:[110F80C]
009D4B6F   . 85C0           TEST EAX,EAX
009D4B71   . 74 17          JE SHORT sro_clie.009D4B8A
009D4B73   . 8B88 FC060000  MOV ECX,DWORD PTR DS:[EAX+6FC]
009D4B79   . 85C9           TEST ECX,ECX
009D4B7B   . 74 0D          JE SHORT sro_clie.009D4B8A
009D4B7D   . C74424 04 0000>MOV DWORD PTR SS:[ESP+4],0
009D4B85   .^E9 2682E5FF    JMP sro_clie.0082CDB0
009D4B8A   > C2 0400        RETN 4
Now I tried codecave:

PHP Code:
DWORD Address 0;
DWORD dwEAX 0;

__declspec(naked)  void HPCodeCave(void)
{
    
printf("Getting the HP value .. \n");

    
__asm
    
{
        
pop Address
        mov dwEAX
EAX
        pushad
    
}

    if(
dwEAX >= 0)
        
printf("HP: %d"dwEAX);
    else
        
printf("Waiting..\n");

    
__asm
    
{
        
popad
        MOV DWORD PTR DS
:[ECX+0x458],EAX
        push Address
        ret
    
}

PHP Code:
Codecave(0x009D4B64HPCodeCave1); 
PHP Code:
VOID WriteBytesASM(DWORD destAddressLPVOID patchDWORD numBytes)
{
    
// Store old protection of the memory page
    
DWORD oldProtect 0;

    
// Store the source address
    
DWORD srcAddress PtrToUlong(patch);

    
// Make sure page is writeable
    
VirtualProtect((void*)(destAddress), numBytesPAGE_EXECUTE_READWRITE, &oldProtect);

    
// Do the patch (oldschool style to avoid memcpy)
    
__asm
    
{
        
nop                        // Filler
        
nop                        // Filler
        
nop                        // Filler

        
mov esisrcAddress        // Save the address
        
mov edidestAddress    // Save the destination address
        
mov ecxnumBytes        // Save the size of the patch
Start:
        
cmp ecx0                // Are we done yet?
        
jz Exit                    // If so, go to end of function

        
mov al, [esi]            // Move the byte at the patch into AL
        
mov [edi], al            // Move AL into the destination byte
        
dec ecx                    // 1 less byte to patch
        
inc esi                    // Next source byte
        
inc edi                    // Next destination byte
        
jmp Start                // Repeat the process
Exit:
        
nop                        // Filler
        
nop                        // Filler
        
nop                        // Filler
    
}

    
// Restore old page protection
    
VirtualProtect((void*)(destAddress), numBytesoldProtect, &oldProtect);
}

VOID Codecave(DWORD destAddressVOID (*func)(VOID), BYTE nopCount)
{
    
// Calculate the code cave for chat interception
    
DWORD offset = (PtrToUlong(func) - destAddress) - 5;

    
// Buffer of NOPs, static since we limit to 'UCHAR_MAX' NOPs
    
BYTE nopPatch[0xFF] = {0};

    
// Construct the patch to the function call
    
BYTE patch[5] = {0xE80x000x000x000x00};
    
memcpy(patch 1, &offsetsizeof(DWORD));
    
WriteBytesASM(destAddresspatch5);

    
// We are done if we do not have NOPs
    
if(nopCount == 0)
        return;

    
// Fill it with nops
    
memset(nopPatch0x90nopCount);

    
// Make the patch now
    
WriteBytesASM(destAddress 5nopPatchnopCount);

Console output:
Code:
Getting the HP value ..
HP: 24
And the max HP is 1519 and then the game crashing ..


Drew Benton's functions .. (Link: )

Any idea why the game crashing ?
and can I get the address of the Max HP ?
and if we are already here ^^ how we can also get the name address ?
Thanks ..
idohadar is offline  
Old 01/16/2013, 22:29   #2
 
elite*gold: 0
Join Date: Jan 2013
Posts: 74
Received Thanks: 12
good luck
SyncOnline is offline  
Old 01/16/2013, 22:40   #3
 
elite*gold: 0
Join Date: Jan 2010
Posts: 16
Received Thanks: 0
Quote:
Originally Posted by SyncOnline View Post
good luck
w00t ?!
Maybe help me ?
idohadar is offline  
Reply




All times are GMT +1. The time now is 19:00.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.