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 


Minesweeper. CE6 Lua GUI, AutoAssemble, SOUND.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials
View previous topic :: View next topic  
Author Message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sat Jan 15, 2011 3:49 pm    Post subject: Minesweeper. CE6 Lua GUI, AutoAssemble, SOUND. Reply with quote

Not for beginners Rolling Eyes

Autoassemble scripts attached to cheat table and "LUA script" MIX.



Autoassemble scripts:
Unlimited Flags:
Code:
[ENABLE]
winmine.exe+346E:
db 90 90 90 90 90 90

[DISABLE]
winmine.exe+346E:
db 01 05 94 51 00 01


Timer Freeze:
Code:
[ENABLE]
winmine.exe+2FF5:
db 90 90 90 90 90 90

[DISABLE]
winmine.exe+2FF5:
db FF 05 9C 57 00 01



Now the better part, SOUND:

Loading two WAVE files into memory
Code:
[DISABLE]
dealloc(SOUNDcheatengine)
unregistersymbol(SOUNDcheatengine)
unregistersymbol(SOUNDcheatengine_2)

[ENABLE]
LOADLIBRARY(winmm.dll)
alloc(SOUNDcheatengine,47936)
registersymbol(SOUNDcheatengine)    // "disable" WAVE file
label(SOUNDcheatengine_2)
registersymbol(SOUNDcheatengine_2) // "enable" WAVE file
SOUNDcheatengine:
dd 46464952
dd 0000654C
dd 45564157
dd 20746D66
dd 00000010
dd 00010001
dd 00002B11
dd 00005622
.....
.....many of these
.....
SOUNDcheatengine_2:
dd 46464952
dd 000055E4
dd 45564157
dd 20746D66
.....
.....many of these
.....


Code from [ENABLE] is launched when trainer attches to process (onOpenProcess). Part between [DISABLE] [ENABLE] is launched when we close custom gui window (onClose)
Search "entry_sound_bytearray" inside LUA code.



Playing sound:

in this case, under SOUNDcheatengine_2 offset, there is WAVE with "cheat enabled" (assigned hotkey numeric1)
Code:
[ENABLE]
globalalloc(codeplaysound,64)
createthread(codeplaysound)

codeplaysound:
push 5
push 0
push SOUNDcheatengine_2
call WINMM.PlaySoundA
ret
[DISABLE]


under SOUNDcheatengine offset, there is WAVE with "cheat disabled" (assigned hotkey numeric2)
Code:
[ENABLE]
globalalloc(codeplaysound,64)
createthread(codeplaysound)

codeplaysound:
push 5
push 0
push SOUNDcheatengine
call WINMM.PlaySoundA
ret
[DISABLE]


Search "entry_soundenable" and "entry_sounddisable" inside LUA code.


LUA GUI


Code:
---------------------------------------------------------------
--------- _memrec_xxxxx_activated(te)
--------- where xxxxx is your table entry description
---------------------------------------------------------------
----- enable
function _memrec_Flags_activated(te)
     --play ("cheat enable")
     memrec_freeze(entry_soundenable)
     --clear freeze status
     memrec_unfreeze(entry_sounddisable)
     --change "label caption" related to cheat status (enabled)
     control_setCaption( unlimitedflagsLabel, unlimitedflagsString .. " [enabled]")
end
function _memrec_Timer_activated(te)
     memrec_freeze(entry_soundenable)
     memrec_unfreeze(entry_sounddisable)
     control_setCaption( timefreezeLabel, timefreezeString .. " [enabled]")
end
----- disable (opposite, freeze unfreeze'ed and vice versa, )
function _memrec_Flags_deactivated(te)
     --play ("cheat disable")
     memrec_unfreeze(entry_soundenable)
     --clear freeze status
     memrec_freeze(entry_sounddisable)
     --change "label caption" related to cheat status (disabled)
     control_setCaption( unlimitedflagsLabel, unlimitedflagsString )
end
function _memrec_Timer_deactivated(te)
     memrec_unfreeze(entry_soundenable)
     memrec_freeze(entry_sounddisable)
     control_setCaption( timefreezeLabel, timefreezeString )
end
---------------------------------------------------------------
---------------------------------------------------------------
--------- autoassamble sound (huge byte array)
function onOpenProcess(processid)
     -- Autoassemble script with wave files
     memrec_freeze(entry_sound_bytearray)
     --change form caption
     control_setCaption(TrainerWindow,"Minesweeper. Lua, Autoassemble, Sound. ACTIVE")
end
---------------------------------------------------------------
--------- function InitLabel (Wiccaan function)-----------------
function InitLabel( form, x, y, text )
     local label = createLabel(form)
     if( label == nil ) then return nil end
     control_setCaption( label, text )
     control_setPosition( label, x, y )
     return label
end
---------------------------------------------------------------
---------------------------------------------------------------
function onClose(sender)
     --cleaning
     memrec_unfreeze(entry_sound_bytearray)
     unlimitedflagsLabel=nil
     timefreezeLabel=nil
     TrainerWindow = nil
     --show Cheat Engine Main Window
     unhideMainCEwindow()
end
---------------------------------------------------------------
----------------MAIN FUNCTION----------------------------------
---------------------------------------------------------------
--------- get Table Entries
entry_soundenable=getTableEntry('SOUND ENABLED')
entry_sounddisable=getTableEntry('SOUND DISABLED')
entry_sound_bytearray=getTableEntry('SOUND_BYTEARRAY')
---------
--------- initialize variables
unlimitedflagsString="Hit NUMERIC1 for unlimited flags"
timefreezeString="Hit NUMERIC2 for time freeze"
---------
--------- autoattach
aalist=getAutoAttachList()
stringlist_add(aalist,"winmine.exe")
---------
--------- prepare GUI
hideAllCEWindows()
TrainerWindow = createForm( true )
form_onClose(TrainerWindow,onClose)
control_setCaption(TrainerWindow,"Minesweeper. Lua, Autoassemble, Sound.")
control_setSize(TrainerWindow, 400,50)
unlimitedflagsLabel=InitLabel(TrainerWindow, 5, 5, unlimitedflagsString)
timefreezeLabel=InitLabel(TrainerWindow, 5, 25, timefreezeString)
form_centerScreen(TrainerWindow)



How to create WAV file inside CT:
1) prepare WAVE. 11025 HZ, 16 bit, mono. Save file as wav.wav
2) download my old pascal prog (quickly modified to WAV2CT.EXE) Link
3) place EXE file in the same folder where wav.wav file is
4) launch EXE, You get MUSIC.CT cheat table and information about size adjustments[/img]



winmine.CT
 Description:
Mineseeper
LUA GUI, SOUND, AUTOASSEMBLER

Download
 Filename:  winmine.CT
 Filesize:  157.87 KB
 Downloaded:  1669 Time(s)


_________________


Last edited by mgr.inz.Player on Mon Nov 14, 2011 4:48 pm; edited 3 times in total
Back to top
View user's profile Send private message MSN Messenger
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5636

PostPosted: Sat Jan 22, 2011 8:44 pm    Post subject: Reply with quote

Interesting. I have tried it and it's pretty good.
_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials All times are GMT - 6 Hours
Page 1 of 1

 
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