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 


i need help about Script Login
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Fri Dec 29, 2017 6:58 pm    Post subject: Reply with quote

@atom0s

Quote:
@Corroder - Your above SQL/PHP code is exploitable and injectable. If you are using PHP to handle your server side, I'd recommend looking into its newer PDO stuff for database connections.


Thank you for your recommendation, any how that script made use CE 6.4 and old version SQL/PHP, it's just a sample. I will looking for newest PDO stuff database.

@dedlyblady
DB, FreeER, and also TheyCallMeTim13 absolutely right with their comments.

So for dedlyblady, here are steps need you do :

1. Make your Game Trainer using CE, C+ / C# or whatever programming language you want
2. Have your own database server engine (free or paid) such as MySQL, SQL Server, Oracle, MS.Access, Postgre, etc
3. Manage your SQL or user database, it must contain same variables field with your PHP script
4. Make your PHP script to handle your database (recommend contains get, insert, delete) and use it to authentication your users
5. Optional : you able to manage how look like (GUI) your PHP user authentication form using CSS
6. Make and write some function in your trainer script(s) to handle connection with your users database

Then that is the reason why DB said "learn database, SQL and PHP".
TheyCallMeTim13 and me already provided some links for your hints and tutorial, beside if you already made your game trainer then why you not post your script or part of your script which you want to connect to your database ?.

Even I post a CT file for login example you still need "learn" about database, SQL and PHP.
And also just for comparison, you can find a method how lua get updated table via online by looking somewhere in this forum, there are CT file made by Zanzer with file name : Autoupdated_table.CT or something like that.

Cheers

Edit : Can't attaching CT file (login_test2.CT)

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
dedlyblady
Cheater
Reputation: 0

Joined: 14 Sep 2017
Posts: 33

PostPosted: Sat Dec 30, 2017 12:33 am    Post subject: Reply with quote

@Corroder .. i'm using Trianer CE and all i need Scrpit Login username and pass for him Unfortunately, because I do not have enough experience in this, I asked for your help here. I thought it was simple and I will find the solution quickly but it seems that I will not get anything really. I do not know what to do about this, but I do not blame any of you. I have not found anything useful yet, but it's OK I'll keep looking. I tried to send you a train in private to look it. Maybe you could do something but I do not have permission to send you a private message and I can not upload links or pictures or anything .. Crying or Very sad
Back to top
View user's profile Send private message
dedlyblady
Cheater
Reputation: 0

Joined: 14 Sep 2017
Posts: 33

PostPosted: Wed Jan 03, 2018 11:07 am    Post subject: Reply with quote

@Corroder .. so how i can change this msg ("Welcome to an example lua script hosted on the cheat engine website") and ceLogo in the scrpit u uploaded him in this topic frist ?
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Wed Jan 03, 2018 6:28 pm    Post subject: Reply with quote

Here is a sample script :

Code:
f = createForm()
f.Width = 200
f.Height = 300
f.Position = 'poScreenCenter'

l = createLabel(f)
l.Font.Size = 12
l.Caption = 'My Advert Clicked : '
l.Top = 10
l.Left = math.floor(f.Width - l.Width) / 2

local i=createImage(f)
local int=getInternet()
local MyDataStr=int.getURL("https://usercontent1.hubstatic.com/11935302_f260.jpg")
int.destroy()

local ss=createStringStream(MyDataStr)
i.Picture.LoadFromStream(ss)
ss.destroy()
i.stretch=true
i.top = 40
i.left = 10
i.width = 180
i.height = 250
i.left = math.floor(f.width - i.width) / 2

f.show()


You see this line :

Code:
local int=getInternet()
local MyDataStr=int.getURL("https://usercontent1.hubstatic.com/11935302_f260.jpg")


a variable 'int' use for handle CE command to access internet connection 'getInternet()'.
other variable 'MyDataStr' use for get and load URL link where use to store datas. Data should be image, table, song, etc...

And next code :

Code:
local ss=createStringStream(MyDataStr)
i.Picture.LoadFromStream(ss)


A variable name with 'ss', use to handle CE command to create a Stream String File with data get from variable MyDataStr. This stream file stored in computer memory and can loading or accessing using command 'LoadFromStream()' and then on next step just need managing how that data want to display / present.

In other way you also able to encoding your data and load it by a decoding function. For example using base64 encoding.

Code:
local int=getInternet()
local logostr=int.getURL("http://pastebin.com/raw/sT9AAKm4")
int.destroy()
img = tostring(logostr)

function createPictureFromBase64(data)
  local b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  data = string.gsub(data, '[^'..b..'=]', '')
  data = (data:gsub('.', function(x)
    if (x == '=') then return '' end
    local r,f='',(b:find(x)-1)
    for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end
    return r;
  end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x)
    if (#x ~= 8) then return '' end
    local c=0
    for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(8-i) or 0) end
    return string.char(c)
  end))
  local picture = createPicture()
  local stream = createStringStream(data)
  picture.loadFromStream(stream)
  return picture
end

if form == nil then
  form = createForm(false)
end

if imgage == nil then
  imgage = createImage(form)
end

if picture == nil then
  picture = createPictureFromBase64(logostr)
  imgage.setPicture(picture)
  imgage.Height = 128
  imgage.Width = 128
end

form.show()


so,
Quote:
@Corroder .. so how i can change this msg ("Welcome to an example lua script hosted on the cheat engine website") and ceLogo in the scrpit u uploaded him in this topic frist ?


It's depending by what data's and how the data's look like you stored at a website.
If you want show your own data (picture, logo, message, etc) then make it by your own, store it at a site and then you can load and use it for your trainer or something else.

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
dedlyblady
Cheater
Reputation: 0

Joined: 14 Sep 2017
Posts: 33

PostPosted: Mon Jan 08, 2018 8:34 pm    Post subject: Reply with quote

@Corroder thank you For help me all the time .. Laughing At another request .. How do I run Trainer on more than one version of the game at the same time? It only works on one copy and if i'm open a copy of the game again it does not work on it but on the first version only Rolling Eyes
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Mon Jan 08, 2018 10:40 pm    Post subject: Reply with quote

Quote:
How do I run Trainer on more than one version of the game at the same time?


I am not sure and still try looking for the answers.
Maybe by giving specific open process for the games.

Code:
openProcess("game.exe")


But still I am not sure it will work for game version 1 vs game version 2, if the game have same name on 'process name'.
Maybe some one here knowing better how to do it...

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Tue Jan 09, 2018 6:32 am    Post subject: Reply with quote

If there are multiple open then you can use
getProcesslist(): Returns a table with the processlist (pid - name )
and
openProcess(processid) : causes cheat engine to open the given processid

That way even if they have the same name, they're guaranteed to have different process identifiers. Of course, you may have to open one, check the version somehow, then open another if it's not the "right" version etc. Of course, then your scripts/code will have to either work for both versions or be able to handle two+ different versions in some way.

If they aren't different versions then that simplifies things a bit, though you might want a dropdown list for the user to pick the pid if you're really running multiple instances of the game (and trainer) at one time, not sure of any way to keep a "Global" list of which are already handled.... though if so you could probably spawn a new trainer process automatically when a new game instance is detected using shellExecute and TrainerOrigin, not sure if you can tell CE to attach to a pid from the command line however. (edit: oh yeah, there's this option https://github.com/mrexodia/CEAutoAttach/blob/master/CEAutoAttach/CEAutoAttach.cpp either the exe itself or your own way to set an environment variable and then use a lua script in CE to use it)

Though I'm wondering if this is really about different game versions running at the same time rather than just the same as http://forum.cheatengine.org/viewtopic.php?p=5734508 where you start the game, it closes for whatever reason (accident, design, crash, etc.) and you reopen the same game (and version) and want CE to auto-attach to it (and perhaps re-enable a script)
Back to top
View user's profile Send private message
dedlyblady
Cheater
Reputation: 0

Joined: 14 Sep 2017
Posts: 33

PostPosted: Tue Jan 09, 2018 8:20 am    Post subject: Reply with quote

Corroder wrote:
Quote:
How do I run Trainer on more than one version of the game at the same time?


I am not sure and still try looking for the answers.
Maybe by giving specific open process for the games.

Code:
openProcess("game.exe")


But still I am not sure it will work for game version 1 vs game version 2, if the game have same name on 'process name'.
Maybe some one here knowing better how to do it...


thanks for replay but this not working i try it Crying or Very sad
Back to top
View user's profile Send private message
dedlyblady
Cheater
Reputation: 0

Joined: 14 Sep 2017
Posts: 33

PostPosted: Tue Jan 09, 2018 5:11 pm    Post subject: Reply with quote

@FreeER

ty bro for replay .. this Code openProcess(processid) : Not work yet but so how i can using onther Scrpit your ?
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 Lua Scripting All times are GMT - 6 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
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