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 


Lua script Detect Mac/Physical address

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
dario3star
Newbie cheater
Reputation: 0

Joined: 14 Dec 2020
Posts: 23

PostPosted: Sat Dec 26, 2020 11:46 pm    Post subject: Lua script Detect Mac/Physical address Reply with quote

Hello Masters, i'm coding my trainer but i don't know how to get the mac address/physical address of any pc.
If my friend use my trainer.exe, he's the only one can use it and cannot be able to share it to others (he don't know any code, reverse engineering, IT stuffs)
my idea is sharing my trainer to my friends and if they attempt to try sharing my trainer.exe with other people that i don't know, the trainer.exe will not work.
the picture below shows the physical/mac address of my pc, i want to detect my pc's physical/mac address via lua. If the physical/mac address doesn't match to trainer's code, the trainer should not work. If the physical/mac address matched inside of the script, the trainer should work.
...............
Sorry for my bad english.
...............
In the second picture, that's my example the trainer worked with doing expiration date mode, then trainer closeCE and show error message. I want to add detect mac/physical address if not match in the script, the trainer closeCE and show error message too.
Thank you.
i used code from Zanzer for references, thank u zanzer, Corroder, DaSpamer



Capturesample.JPG
 Description:
 Filesize:  101.62 KB
 Viewed:  2236 Time(s)

Capturesample.JPG



Capturemac.JPG
 Description:
 Filesize:  118.57 KB
 Viewed:  2237 Time(s)

Capturemac.JPG


Back to top
View user's profile Send private message AIM Address
blankTM
Cheater
Reputation: 1

Joined: 03 May 2020
Posts: 49

PostPosted: Sun Dec 27, 2020 8:25 am    Post subject: Re: Lua script Detect Mac/Physical address Reply with quote

Code:

function GetMac()
 local t = io.popen('ipconfig /all')
 local ret = string.match(t:read("*all"),"%w+[-]%w+[-]%w+[-]%w+[-]%w+[-]%w+")
  t:close()
  if ret then
  return ret
  end
end

print(GetMac())
Back to top
View user's profile Send private message
dario3star
Newbie cheater
Reputation: 0

Joined: 14 Dec 2020
Posts: 23

PostPosted: Sun Dec 27, 2020 9:00 am    Post subject: Re: Lua script Detect Mac/Physical address Reply with quote

blankTM wrote:
Code:

function GetMac()
 local t = io.popen('ipconfig /all')
 local ret = string.match(t:read("*all"),"%w+[-]%w+[-]%w+[-]%w+[-]%w+[-]%w+")
  t:close()
  if ret then
  return ret
  end
end

print(GetMac())


How is this works? Where do i put my mac there?
I want to add it on simple security feature below or above my script.
The code in if ret then is error
Back to top
View user's profile Send private message AIM Address
blankTM
Cheater
Reputation: 1

Joined: 03 May 2020
Posts: 49

PostPosted: Sun Dec 27, 2020 9:12 am    Post subject: Re: Lua script Detect Mac/Physical address Reply with quote

dario3star wrote:
blankTM wrote:
Code:

function GetMac()
 local t = io.popen('ipconfig /all')
 local ret = string.match(t:read("*all"),"%w+[-]%w+[-]%w+[-]%w+[-]%w+[-]%w+")
  t:close()
  if ret then
  return ret
  end
end

print(GetMac())


How is this works? Where do i put my mac there?
I want to add it on simple security feature below or above my script.
The code in if ret then is error


Code:

if GetMac() =='XX-XX-XX-XX-XX-XX' then
print('ok')
else
print('no')
end
Back to top
View user's profile Send private message
dario3star
Newbie cheater
Reputation: 0

Joined: 14 Dec 2020
Posts: 23

PostPosted: Sun Dec 27, 2020 9:26 am    Post subject: Re: Lua script Detect Mac/Physical address Reply with quote

blankTM wrote:
dario3star wrote:
blankTM wrote:
Code:

function GetMac()
 local t = io.popen('ipconfig /all')
 local ret = string.match(t:read("*all"),"%w+[-]%w+[-]%w+[-]%w+[-]%w+[-]%w+")
  t:close()
  if ret then
  return ret
  end
end

print(GetMac())


How is this works? Where do i put my mac there?
I want to add it on simple security feature below or above my script.
The code in if ret then is error


Code:

if GetMac() =='XX-XX-XX-XX-XX-XX' then
print('ok')
else
print('no')
end


Im a bit confused, sorry. How do i make this work?



1111111.JPG
 Description:
 Filesize:  55.27 KB
 Viewed:  2159 Time(s)

1111111.JPG


Back to top
View user's profile Send private message AIM Address
blankTM
Cheater
Reputation: 1

Joined: 03 May 2020
Posts: 49

PostPosted: Sun Dec 27, 2020 9:41 am    Post subject: Re: Lua script Detect Mac/Physical address Reply with quote

WTF????????????????????????????????????????????????????????????????????????????????????????????????????????????

GetMac is a function to return your MAC string

Code:

function GetMac()
 local t = io.popen('ipconfig /all')
 local ret = string.match(t:read("*all"),"%w+[-]%w+[-]%w+[-]%w+[-]%w+[-]%w+")
  t:close()
  if ret then
  return ret
  end
end

if GetMac() =='B4-2E-99-8D-9D-BD' then
print('ok')
else
print('no')
end
Back to top
View user's profile Send private message
dario3star
Newbie cheater
Reputation: 0

Joined: 14 Dec 2020
Posts: 23

PostPosted: Sun Dec 27, 2020 10:09 am    Post subject: Re: Lua script Detect Mac/Physical address Reply with quote

I changed it a bit and it worked. But the problem is my code date check below worked before, now not working, still opens the trainer. it should not open the trainer. Someone help me to fix it. Please, thanks.

EDIT: Now both worked. I figured it out how to make both work at the same time.


Last edited by dario3star on Sun Dec 27, 2020 1:21 pm; edited 1 time in total
Back to top
View user's profile Send private message AIM Address
blankTM
Cheater
Reputation: 1

Joined: 03 May 2020
Posts: 49

PostPosted: Sun Dec 27, 2020 10:15 am    Post subject: Re: Lua script Detect Mac/Physical address Reply with quote

Your code drives me crazy
Back to top
View user's profile Send private message
dario3star
Newbie cheater
Reputation: 0

Joined: 14 Dec 2020
Posts: 23

PostPosted: Sun Dec 27, 2020 10:18 am    Post subject: Re: Lua script Detect Mac/Physical address Reply with quote

blankTM wrote:
Your code drives me crazy

Sorry man Rolling Eyes i still don't know lua overall, any help/fix i appreciate it. Smile
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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