Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Dark Souls PTDE - Modifying Enemies?
Goto page Previous  1, 2, 3, 4, 5, 6, 7
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
ParkourPenguin
I post too much
Reputation: 155

Joined: 06 Jul 2014
Posts: 4774

PostPosted: Tue Jun 07, 2016 10:00 am    Post subject: Reply with quote

x87 and SSE are expansions of the x86 instruction set used for dealing with floating point numbers (i.e. value types float and double). It would be largely irrelevant in this context unless you are planning on doing floating point math.

Here's a basic summary of all the registers:
  • EAX - general purpose register. Used for accumulating values (loose convention) and return values from subroutines (strict convention).
  • ECX - general purpose register. Can be used as a counter in loops (common convention) and used by some instructions as a counter register (see REP prefix).
  • EDX - general purpose register. Sometimes used as support for 64-bit numbers in a 32-bit process (EDX:EAX; e.g. DIV).
  • EBX - general purpose register. Used to point to the base of an array (loose convention).
  • ESI - general purpose register. Denotes the source of an operation (e.g. MOVSD; apart from relevant instructions, loose convention).
  • EDI - general purpose register. Denotes the destination of an operation (apart from relevant instructions, loose convention).
  • EBP - general purpose register. Commonly used to store the base of the current subroutine's stack frame (strict convention).
  • ESP - while technically a general purpose register, this always points to the top of the stack (hardware-dependent convention). Severely modifying it without taking proper precautions will usually lead to the process crashing. Since push/pop are affected, you will need to store it some other way (i.e. in another register or in memory somewhere).
  • EIP - cannot be manipulated like the general-purpose registers. This always points to the address of the next instruction to be executed (hardware-enforced convention).


Here's a version of that script I quickly optimized:
Code:
[ENABLE]
aobscanmodule(PreHealthInstruction,DARKSOULS.exe,8B 10 89 11 59)
alloc(newmem,4096)

label(getAndCompareNPC)
label(makeEnemyHealthZero)
label(exit)
label(return)

registersymbol(PreHealthInstruction)

newmem:

getAndCompareNPC:
  push esi
  lea esi,[ecx-2d4]

  cmp word ptr[esi+40],0030
  jne short exit

  cmp [esi+38],00320063
  je short @f

  cmp [esi+38],00330063         // DemStCheck
  jne short exit
  cmp [esi+3C],00330034
  jne short exit
  jmp short makeEnemyHealthZero

@@:
  cmp [esi+3C],00370033         // ChannCheck
  je short makeEnemyHealthZero

  cmp [esi+3C],00310034         // SKCheck
  je short makeEnemyHealthZero

  cmp [esi+3C],00300034         // PGCheck
  je short makeEnemyHealthZero

  cmp [esi+3C],00370038         // SenlCheck
  je short makeEnemyHealthZero

  cmp [esi+3C],00300038         // CrystalCheck
  je short makeEnemyHealthZero

  cmp [esi+3C],00340032         // ChaosEatCheck
  jne short exit

makeEnemyHealthZero:
  mov [esi+2d4],00000000

exit:
  pop esi

  // Original Code
  mov edx,[eax]
  mov [ecx],edx
  pop ecx
  jmp return


PreHealthInstruction:
  jmp getAndCompareNPC
return:


[DISABLE]

PreHealthInstruction:
  db 8B 10 89 11 59

unregistersymbol(PreHealthInstruction)
dealloc(newmem)

I'm sure this can be optimized more, but it isn't really that important.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4, 5, 6, 7
Page 7 of 7

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites