Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED]How can I permanent freeze some Values in the Memory
#1
Hello, I try to figure out how to freeze some values permanent in an application but I don't know how. Also the macro should freeze the value as long as the application is running or until I deactivate it with an Hot-key or an Window-Button. I hope someone can Help me with this.

My current Macro:
Macro Minesweeper
Code:
Copy      Help
int hWnd,lpdwProcessId,o,r,w,Value,NewValue
int BufferSize = sizeof(Value)
byte* BaseAddress
BaseAddress+0x100579C
hWnd=FindWindow(0 "Minesweeper")
GetWindowThreadProcessId(hWnd lpdwProcessId)
;out "Process ID=%i" hWnd ;;enable/disable this line for debug
o=OpenProcess(PROCESS_ALL_ACCESS 0 lpdwProcessId)
r=ReadProcessMemory(o BaseAddress &Value 4 0)
;out "ReadProcessMemory=%i" r ;;enable/disable this line for debug
;out "BaseAddress=%X ,Buffer=%i BufferSize=%i" BaseAddress Value BufferSize ;;enable/disable this line for debug
NewValue=0
w=WriteProcessMemory(o, BaseAddress, &NewValue 4 0)

I deicide to use this small game from Windows XP for learning and testing before I change anything big in other applications.
Windows 8.1 x64 | Quick Macros v2.4.x.x
#2
Cannot freeze. Maybe can set read-only with VirtualProtectEx, but then the program probably would crash.
#3
Thanks, for the replay.
But is there really no way to do this?

What if the Macro sends every X seconds?:
Macro WriteProcessMemory
Code:
Copy      Help
w=WriteProcessMemory(o, BaseAddress, &NewValue 4 0)

Can you make this small function for me?
I'm to stupid for this. Sad

The function should be activated and deactivated per Hot-key and should only work if the Process or the Windows is active other wise it should automaticly deactivate.
Windows 8.1 x64 | Quick Macros v2.4.x.x
#4
Macro Macro2538
Code:
Copy      Help
int hWnd,r,w,Value,NewValue
int BufferSize = sizeof(Value)
byte* BaseAddress
BaseAddress+0x100579C

double X=0.1 ;;every 0.1 s

hWnd=win("Notepad")
if(!hWnd) ret
;if(hWnd!=win) ret ;;if window not active
__ProcessMemory o.Alloc(hWnd 0) ;;just get process handle; error if fails
rep
,;o.ReadOther(&Value BaseAddress BufferSize)
,;out Value
,NewValue=0
,o.WriteOther(BaseAddress &NewValue BufferSize)
,if(WaitForSingleObject(o.hprocess X*1000)!=WAIT_TIMEOUT) break ;;if process ended
,;if(hWnd!=win) break ;;if window deactivated
#5
It works the Value is frozen thank you so much for this now I have to figure out how to activate and to deactivate the macro per Hot-key.
Windows 8.1 x64 | Quick Macros v2.4.x.x
#6
If will need hotkeys in exe, use __RegisterHotKey class.


Forum Jump:


Users browsing this thread: 1 Guest(s)