I need your help in this... I don't know much about C++, and a friend gave me a source, but I dont understand it completely :sad:

The most important part for me is the account parameters, so if anyone can help me becoming this source code to ASM I appreciate so much your help ;)

/* Uses the exported function in Engine.dll "CEntity::GetPlayerEntity", all it requires is the number of the character in your current room */
PVOID getPlayer(DWORD roomNumber)
{
PVOID getPlayerEntity = GetProcAddress(GetModuleHandle("Engine.dll"), "?GetPlayerEntity@CEntity@@SAPAV1@J@Z");
__asm push roomNumber
__asm mov eax, getPlayerEntity
__asm call eax
__asm mov getPlayerEntity, eax
return getPlayerEntity;
}

/* Returns a Non-Zero Value if true, an a zero value if false (Determines if the Object is the current CPlayer using CEntity::IsLocalEntity)*/
bool isCurrentEntity(PVOID entity)
{
PVOID isCurrentEntity = GetProcAddress(GetModuleHandle("Engine.dll"), "?IsLocalEntity@CEntity@@QAEHXZ");
__asm mov ecx, entity
__asm mov eax, isCurrentEntity
__asm call eax
__asm mov isCurrentEntity, eax
return (bool)isCurrentEntity;
}

/* Calls the two functions above and uses a loop to return the current CPlayer Object if there even is a current cplayer */
PVOID getCurrentPlayer()
{
PVOID currentPlayer;
char msg;
DWORD returnVal;

for(int i = 0; i < 20; i++)
{
currentPlayer = getPlayer(i);
if(currentPlayer != 0)
{
returnVal = isCurrentEntity(currentPlayer);
if(returnVal)
{
return currentPlayer;
}
}
}
return 0;
}


This is for Rakion ;)

And I'm sorry for my bad english >.<
Posted on 2008-11-12 11:27:26 by GermainR27
Why don't you compile it and send the .exe file through a disassembler or a debugger like OllyDbg
Posted on 2008-11-12 17:06:40 by Grich
So, what are you trying to do? Making a trainer for Serious Sam?
Posted on 2008-11-13 18:27:08 by f0dder
I just wanna make a MultiHack, but I only need the Account Parameters... and that is the code I have posted recently
Posted on 2008-11-14 15:06:04 by GermainR27
i try to translate it to masm32, but i study masm32 little time so just for reference to you.(but i have very good c++ 8))


.386
.model flat, stdcall
option casemap:none

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;headfiles and lib reference
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
include windows.inc
include user32.inc
include gdi32.inc
include kernel32.inc

includelib user32.lib
includelib gdi32.lib
includelib kernel32.lib

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;data seg
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

.const

DllName db 'Engine.dll', 0
FunName1 db '?GetPlayerEntity@CEntity@@SAPAV1@J@Z', 0
FunName2 db '?IsLocalEntity@CEntity@@QAEHXZ', 0

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;code seg
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

.code

getPlayer proc uses ebx roomNumber:DWORD

invoke GetModuleHandle, addr DllName
mov ebx, eax
invoke GetProcAddress, ebx, addr FunName1
push roomNumber
call eax

ret
getPlayer endp

isCurrentEntity proc uses ebx ecx entity:PVOID

invoke GetModuleHandle, addr DllName
mov ebx, eax;
invoke GetProcAddress, ebx, addr FunName1
mov ecx, entity
call eax

ret
isCurrentEntity endp

getCurrentPlayer proc uses ebx

xor ebx, ebx
.while(ebx < 20)

invoke getPlayer, ebx

.if(eax)

invoke isCurrentEntity, eax
.if(eax)
jmp @F
.endif
.endif

inc ebx
.endw

@@: ret
getCurrentPlayer endp

;beginning point
start:

invoke ExitProcess, NULL


;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
end start
Posted on 2008-11-15 03:52:59 by BtryKit
bad formatted.......look this??????????????????????


.386
.model flat, stdcall
option casemap:none

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;headfiles and lib reference
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
include windows.inc
include user32.inc
include gdi32.inc
include kernel32.inc

includelib user32.lib
includelib gdi32.lib
includelib kernel32.lib

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;data seg
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

.const

DllName db 'Engine.dll', 0
FunName1 db '?GetPlayerEntity@CEntity@@SAPAV1@J@Z', 0
FunName2 db '?IsLocalEntity@CEntity@@QAEHXZ', 0

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;code seg
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

.code

getPlayer proc uses ebx roomNumber:DWORD

invoke GetModuleHandle, addr DllName
mov ebx, eax
invoke GetProcAddress, ebx, addr FunName1
push roomNumber
call eax

ret
getPlayer endp

isCurrentEntity proc uses ebx ecx entity:PVOID

invoke GetModuleHandle, addr DllName
mov ebx, eax;
invoke GetProcAddress, ebx, addr FunName1
mov ecx, entity
call eax

ret
isCurrentEntity endp

getCurrentPlayer proc uses ebx

xor ebx, ebx
.while(ebx < 20)

invoke getPlayer, ebx

.if(eax)

invoke isCurrentEntity, eax
.if(eax)
jmp @F
.endif
.endif

inc ebx
.endw

@@: ret
getCurrentPlayer endp

;beginning point
start:

invoke ExitProcess, NULL


;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
end start
Posted on 2008-11-15 03:56:59 by BtryKit
why? how to adjust formatt???????  :shock:
Posted on 2008-11-15 03:58:42 by BtryKit
Thanks a lot :P

I'll test it later, thanks ;)
Posted on 2008-11-15 08:56:22 by GermainR27