Working with Negative Values 1.13c

This forum is for discussions on how to edit what can not be edited through the txt files, needless to say this isn't about battle net hacking.

Moderators: Nefarius, Havvoric

Post Reply
User avatar
b1n
Posts: 58
Joined: Mon Jul 18, 2016 10:55 pm
Contact:

Working with Negative Values 1.13c

Post by b1n » Thu Sep 12, 2019 8:35 pm

I'am beating my brain out to get this
I want to change the negative resistance cap of -100 to something like -150... or -200
Editing in assemble it fill with some NOPs and I'm not confident with the results of this

Code: Select all

D2Game.dll - DB470 and DB475 '[Minimum value (negative cap)]'

03B8B470    83FE 9C         CMP ESI,-64
///
03B8B475    BE 9CFFFFFF     MOV ESI,-64

D2Client.dll - BD929 and BD92E '[display cap in stat screen]'

6FB6D929      83FE 9C       CMP ESI,-64
///
6FB6D92E      BE 9CFFFFFF   MOV ESI,-64

;Change the -64 (-100) to your new value.
From kidpaddle94's code edits compilation

Could someone post the result code after changing those values?
Thanks
b1n

User avatar
devurandom
Forum Regular
Angel
Posts: 795
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: Working with Negative Values 1.13c

Post by devurandom » Fri Sep 13, 2019 4:56 am

not difficult right click assemble...

change

CMP ESI,-64

to

CMP ESI,-96

(150 decimal = 96 hex) I use windows calculator in scientific mode to get that.

then click assemble. nops aren't needed.
repeat for the other values, right click edit, save all modifications, right click save file.
Like you said these are just caps, the value gets assigned from DifficultyLevels.txt
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

User avatar
b1n
Posts: 58
Joined: Mon Jul 18, 2016 10:55 pm
Contact:

Re: Working with Negative Values 1.13c

Post by b1n » Fri Sep 13, 2019 12:24 pm

devurandom wrote:
Fri Sep 13, 2019 4:56 am
not difficult right click assemble...

change

CMP ESI,-64

to

CMP ESI,-96

(150 decimal = 96 hex) I use windows calculator in scientific mode to get that.

then click assemble. nops aren't needed.
repeat for the other values, right click edit, save all modifications, right click save file.
Like you said these are just caps, the value gets assigned from DifficultyLevels.txt
Nice, I'll try
And about other numbers like -200? In hex C8
Image
If I use 0C8 some strange codes appears

Edit: After Assemble -96 this happens
Image
I think I'm doing something wrong
:typing:
b1n

User avatar
Necrolis
Site Admin
Throne
Posts: 9017
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
Contact:
South Africa

Hand-picked

Re: Working with Negative Values 1.13c

Post by Necrolis » Fri Sep 13, 2019 2:28 pm

You only have 1 byte of space in the CMP, you are limit to values in the range of [-127,128].
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

User avatar
b1n
Posts: 58
Joined: Mon Jul 18, 2016 10:55 pm
Contact:

Re: Working with Negative Values 1.13c

Post by b1n » Fri Sep 13, 2019 7:25 pm

Necrolis wrote:
Fri Sep 13, 2019 2:28 pm
You only have 1 byte of space in the CMP, you are limit to values in the range of [-127,128].
Nice thank you for the info

But that last screen, when I change to -96 something happens and change a lot of things above
b1n

User avatar
devurandom
Forum Regular
Angel
Posts: 795
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: Working with Negative Values 1.13c

Post by devurandom » Fri Sep 13, 2019 8:32 pm

Necrolis is right its a signed char.

You only want to change the value with assemble not the instruction such as CMP or MOV


CMP ESI,-7F
///
MOV ESI,-7F

CMP ESI,-7F
///
MOV ESI,-7F
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

User avatar
b1n
Posts: 58
Joined: Mon Jul 18, 2016 10:55 pm
Contact:

Re: Working with Negative Values 1.13c

Post by b1n » Fri Sep 13, 2019 11:34 pm

Necrolis wrote:
Fri Sep 13, 2019 2:28 pm
You only have 1 byte of space in the CMP, you are limit to values in the range of [-127,128].
I didn't got this one
devurandom wrote:
Fri Sep 13, 2019 8:32 pm
Necrolis is right its a signed char.

You only want to change the value with assemble not the instruction such as CMP or MOV


CMP ESI,-7F
///
MOV ESI,-7F

CMP ESI,-7F
///
MOV ESI,-7F
this will be -127 right?
I needed -150 or -200
I thought I saw this before
b1n

User avatar
devurandom
Forum Regular
Angel
Posts: 795
Joined: Sat Mar 07, 2015 9:07 pm
United States of America

Re: Working with Negative Values 1.13c

Post by devurandom » Fri Sep 13, 2019 11:43 pm

There's not enough bytes to expand it past -127. To do so would require jump to slack space to add new code for the compare instructions, then jump back. There may be some tutorials how add new code using slackspace.
Assembly Reference | 1.13d Code Edits | UVLoD | BaseMod Plugin

Fiat paper money is the most elaborate and well devised form of slavery the world has ever seen..

User avatar
b1n
Posts: 58
Joined: Mon Jul 18, 2016 10:55 pm
Contact:

Re: Working with Negative Values 1.13c

Post by b1n » Sat Sep 14, 2019 1:43 am

devurandom wrote:
Fri Sep 13, 2019 11:43 pm
There's not enough bytes to expand it past -127. To do so would require jump to slack space to add new code for the compare instructions, then jump back. There may be some tutorials how add new code using slackspace.
Ahh it's really a limitation so
Thanks guys
b1n

Post Reply

Return to “Code Editing”