//alloc(newmem,4048,"DiabloImmortal.exe"+34C0D6) cu
alloc(newmem,4048,"DiabloImmortal.exe"+34EB33)
label(returnhere)
label(originalcode)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here

originalcode:
mov rax,[rax+10]
mov rcx,[rax+20]
//mov rcx,[rcx]  // > tach ra de lay rcx = rbx > text monster
// "DiabloImmortal.exe"+34C0DE > "DiabloImmortal.exe"+34C0D6
// vi thieu bytes jmp
//mov rcx,[rcx+000001B8]

// mov rbx,[rcx] //> chuyen rcx sang rbx
// r14 = id enemy
// [rcx+38] = [enemy id]
// rcx+A8 = 736E6F4D // Monster
// rcx+AC = 00726574 // Monster
// rcx+C8 = float x
// rcx+D0 = float y
// rdx = text target or client combat
// rdx+28 = 696C635F _clientCombatSwitch
// rdx+2F = 626D6F43 _clientCombatSwitch
// rdx+28 = 67726174 targetid

// rdx+28 = 69417369 isAiInMaster > 1
// rdx+68 = 4C696F61 aoiLayerIndexes > 2

// [rdx+B8] > 28 = 66696C5F _lifeState > 3
// [rdx+B8] > 28 > 158 > 28 = 66696C5F _lifeState > enable

// rdx+28 = 656E776F // ownerid > bi tan cong bat id

push rax // address
push rcx // address
mov rcx,[rcx] //> chuyen rcx = rbx = [rax+20]
mov rax,newmem+500 // address 0x0 value vtmem

cmp byte ptr[r14+0],01 // id enemy
je exit01
cmp [r14+1],00000000 // id enemy
jne exit01

//cmp [rcx+C8],(float)999999 // float x
//je exit01
//cmp [rcx+D0],(float)999999 // float y
//je exit01

//cmp [rcx+A8],79616C50 // PlayerAvat
//je exit01
cmp [rcx+A8],736E6F4D // Monster
jne exit01

cmp [rdx+28],70537369 // isSpiritGreenShadowUsed
jne exit01


//cmp [rdx+28],6C507369 // isPlayerDeadBody
//jne exit01

//cmp [rdx+28],704E7369 // isNpcFlag > bi dinh summon xa
//jne exit01


//cmp [rdx+28],63696C63 // clickPos
//jne exit01


//cmp [rdx+28],656E776F // ownerid enemy attack damage
//jne exit01
//cmp [rdx+28],6D61675F // _gameCamp
//jne exit01
//636E6163  cancelMotionNotify
//lastCanExitAttackTime 7473616C



//cmp [rcx+A8],79616C50 // PlayerAvat
//je exit01
//cmp [rcx+A8],63617053 // SpaceSnare
//je exit01
//cmp [rcx+A8],74617641 // Avatar > vi tri nhan vat
//jne exit01
//cmp [rdx+28],6D61675F // _gameCamp
//jne exit01

//cmp [rdx+28],70796177 // waypointState
//jne exit01

//cmp [rdx+28],63536E69 // inScene
//jne exit01

//cmp [rdx+28],61657263 // creatureId
//jne exit01

//cmp [rdx+28],63657073 // specialInitCollisionFlag
//jne exit01

//cmp [rdx+28+7],74636944 // specialDict > avatar
//jne exit01

//cmp [rcx+A8],736E6F4D // Monster + targetid = Monster
//jne exit01
//cmp [rdx+28],61547369  //  isTaskFlag
//jne exit01
//cmp [rdx+28],67726174 // targetid
//jne exit01



//cmp byte ptr[r14+0],01 // id enemy
//je exit01
//cmp byte ptr[r14+0],03 // id enemy
//je exit01
//cmp byte ptr[r14+1],00 // id enemy
//jne exit01
//cmp byte ptr[r14+5],00 // id enemy
//jne exit01


//cmp [rcx+A8],736E6F4D // Monster
//jne exit01
//cmp [rcx+378],63617053 // SpaceSnare
//jne exit01

//cmp [rdx+28],69417369 // isAiInMaster
//jne exit01

//cmp [rdx+28],66696C5F // _lifeState
//je exit01

//cmp [rdx+28],00766C5F // _lv
//jne exit01

//cmp [rdx+28],70685F70 // p_hp
//jne exit01


//cmp [rdx+28],696C635F // _clientCom summon
//je exit01

//cmp [rdx+28],73616D5F // _masterId summon
//je exit01

//cmp [rdx+28],6465656E // needInteract
//je exit01

//cmp [rdx+28],6170735F // _spacecamp
//je exit01

//cmp [rdx+28],696E615F // _animPause
//je exit01

//cmp [rdx+28],4C706F5F // _opLock
//je exit01

//cmp [rdx+28],704E7369 // isNpcFlag
//je exit01

//cmp [rdx+28],66696C5F // address _lifeState
//jne exit01

//cmp [rcx+A8],79616C50 // PlayerAvat
//je exit01
//cmp [rdx+28],67726174 // targetid
//je exit01
//cmp [rdx+28],696C635F // _clientCom summon
//je exit01






//cmp [rcx+A8],63617053 // SpaceBox + conditionList = Return to Westmarch
//jne exit01
//cmp [rdx+28],646E6F63 // conditionList
//jne exit01

//cmp [rdx+28],61547369  //  isTaskFlag
//jne exit01


mov [rax+8*1],rcx // rcx > chuyen thanh rbx+38 = id enemy //mov [rax+8],rsi
mov [rax+8*2],rdx // target id
//mov [rax+8*3],rsp //
//mov [rax+8*3],rbx // account
//mov [rax+8*4],r14 // id enemy
//mov [rax+8*5],rax
//mov [rax+8*6],rsi
//mov [rax+8*7],r10
//mov [rax+8*8],r13

//mov rax,194D425E620 // target enemy
//mov [rax],r14


exit01:

cmp byte ptr[r14+0],01 // id enemy
je exit02
cmp [r14+1],00000000 // id enemy
jne exit02

cmp [rcx+A8],736E6F4D // Monster
jne exit02
//cmp [rdx+28],656E776F // ownerid enemy attack damage
//jne exit02
cmp [rdx+28],6165725F // _realFight enemy attack not damage
jne exit02

// 11 HEX AUTO ASSEMBLY = 17 DEC AUTOIT
mov [rax+8*11],rcx // rcx > chuyen thanh rbx+38 = id enemy //mov [rax+8],rsi
mov [rax+8*12],rdx // target id

exit02:


cmp [rcx+A8],63617053 // SpaceSnare
jne exit03
cmp [rdx+28],68006F6E // no
jne exit03

// 21 HEX AUTO ASSEMBLY = 33 DEC AUTOIT
mov [rax+8*21],rcx // rcx > chuyen thanh rbx+38 = id enemy //mov [rax+8],rsi
mov [rax+8*22],rdx // target id

exit03:


pop rcx
pop rax

exit:
jmp returnhere
"DiabloImmortal.exe"+34EB33
//"DiabloImmortal.exe"+34C0D6: cu
jmp newmem
nop
nop
nop
returnhere:



//P
//_clientCom
//isAiInMast







//E
//isInFOW
//_clientCom
//isAiInMast
//targetid


//targetid
//isAiInMast
//_clientCom




