Jump to content
Moopler
  • 0
misterdave35

Help CheatEngine Lua writeString to Resolution Changer

Question

Hey again~. I'm still new to lua, and I have no idea how to writeString to width and height in this case where it uses 'dd #' (same applies to Auto cc).

What I currently have: ResolutionChanger checkbox with the function ResolutionChanger onChange, and two Editboxes with the ChangeRCWidth and ChangeRCHeight onChange functions respectively. When I enable resolution changer, it doesn't do anything. I've tried using define(width, #%s), which, of course, didn't work. What is wrong here?

function ResolutionChanger(RES_CHANGE)
--v186.3
if RES_CHANGE.checked then
  autoAssemble(string.format([[
    alloc(ResolutionChanger, 128)
    label(AlreadyChanged)
    alloc(height,4)
    alloc(width,4)
    registersymbol(height)
    registersymbol(width)

    alloc(IntersectRectAddy,4)
    alloc(ResolutionChangerAddy,4)

    IntersectRectAddy:
    dd USER32.IntersectRect

    ResolutionChangerAddy:
    dd ResolutionChanger

    width:
    dd #%s

    height:
    dd #%s

    ResolutionChanger:
    pushad
    mov edi,[02C19938]//follow first call from the function below
    mov eax, [edi+7CF0] //follow first call from the function below
    cmp eax, [width]
    je AlreadyChanged
    mov eax,[edi+7CF0+4]
    cmp eax,[height]
    je AlreadyChanged
    mov ecx, [height]
    mov edx, [width]
    push 00
    push ecx
    push edx
    mov ecx,edi
    call 02199B10 //55 8b ec 51 53 57 89 ? ? E8 ? ? ? ? 8B ? 08
    //68 58 02 00 00 68 20 03 00 00 8B 0D ? ? ? ? E8 [FOLLOW CALL BELOW]

    AlreadyChanged:
    popad
    jmp dword ptr [IntersectRectAddy]

    021086D1:
    call dword ptr [ResolutionChangerAddy]
    ]],tostring(UDF1.CEEdit12.Text),tostring(UDF1.CEEdit13.Text)))
    UDF1.CEEdit12.Enabled = false
    UDF1.CEEdit13.Enabled = false
  else
  autoAssemble([[
    dealloc(ResolutionChanger)
    dealloc(heigh)
    dealloc(width)
    dealloc(IntersectRectAddy)
    dealloc(ResolutionChangerAddy)
    unregistersymbol(height)
    unregistersymbol(width)


    021086D1: //[3RD RESULT] FF 15 ? ? ? ? 85 C0 0F 84 ? ? 00 00 51 8B ?
    call dword ptr [02C3A808]
    ]])
    UDF1.CEEdit12.Enabled = true
    UDF1.CEEdit13.Enabled = true
  end
end

function ChangeRCWidth(C_RCW)
local value = tostring(UDF1.CEEdit12.Text)
  if C_RCW.Checked then
    writeString("width", value)
  end
end

function ChangeRCHeight(C_RCH)
local value = tostring(UDF1.CEEdit13.Text)
  if C_RCH.Checked then
    writeString("height", value)
  end
end

 

Edited by misterdave35

Share this post


Link to post

2 answers to this question

Recommended Posts

  • 0

Try changing channels a couple times or entering different values, your script does work it's just a bit wonky.

d916884e9e.png

 

 

  • Like 1

Share this post


Link to post
  • 0
9 minutes ago, NORBIN said:

Try changing channels a couple times or entering different values, your script does work it's just a bit wonky.

d916884e9e.png

 

 

Huh.. looks like both values need to be changed or it won't change... very strange. Thanks!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×