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 


Function Error

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
ghmarko
Cheater
Reputation: 0

Joined: 31 Jan 2020
Posts: 29
Location: 192.168.0.1

PostPosted: Sun May 24, 2020 6:20 am    Post subject: Function Error Reply with quote

Hello...
How to fix this proplem the trianer works good with Cheat Engine but when export it to to exe give me that error



Capture1.PNG
 Description:
My Code
 Filesize:  28.71 KB
 Viewed:  1908 Time(s)

Capture1.PNG



Capture2.PNG
 Description:
Error
 Filesize:  7.64 KB
 Viewed:  1909 Time(s)

Capture2.PNG


Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Sun May 24, 2020 6:49 am    Post subject: Reply with quote

I re-writing your function and test it without errors. Saved as CT, CETRAINER and EXE (gigantic 64bit(

Code:
function Decode(s)
 local t = {}
 for byte in s:gmatch('..') do
  t[#t+1] = string.char(tonumber(byte,16))
 end
 return table.concat(t,'')
end

function UDF1_CEButton1Click(sender)
 url = Decode('68747470733A2F2F706173746562696E2E636F6D2F7261772F7230676A6E415655')
 print(url)
 int = getInternet()
 resp = int.getURL(url)
 print('----------------------------------------')
 print(resp)
 result = Decode(resp)
 print('----------------------------------------')
 print(result)
 print('----------------------------------------')
 decodeFunction(result)()
end

--script = Decode('632D6F5770444E504A216B65746C5243423D2F55214E5332283579705433387321642B3432296271476E6D573730776D5A4E393267754F37234C493B372350295538573F2E3B566B5F74783854735944736C7D2E4B3B38554A69392E7244775D4854244D3030377B4134376D')
--print(script)
--decodeFunction(script)()

UDF1.show()

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

Joined: 31 Jan 2020
Posts: 29
Location: 192.168.0.1

PostPosted: Sun May 24, 2020 8:49 am    Post subject: Reply with quote

If i need it works for 32 and 64 bit
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Sun May 24, 2020 9:38 am    Post subject: Reply with quote

See this topic:

https://forum.cheatengine.org/viewtopic.php?t=595142
https://forum.cheatengine.org/viewtopic.php?p=5744231&sid=14f66dae5e285ea951252024c4687f91

So, might be like this:

Code:
function Decode(s)
 local t = {}
 for byte in s:gmatch('..') do
  t[#t+1] = string.char(tonumber(byte,16))
 end
 return table.concat(t,'')
end

function UDF1_CEButton1Click(sender)

-- Make 2 encode script and store on 2 URL's

-- URL for encode script by 64 bit script / CE
  url64 = Decode('68747470733A2F2F706173746562696E2E636F6D2F7261772F7230676A6E415655')
-- URL for encode script by 32 bit script / CE
  url32 = Decode('68747470733A2F2F706173746562696E2E636F6D2F7261772F7230676A6E415655')


  resp = int.getURL(url32)
  result = Decode(resp)

  int = getInternet()

  if cheatEngineIs64Bit() then
     resp = int.getURL(url64)
     result = Decode(resp)
     local my_function = decodeFunction(result)
     my_function()
  else
     resp = int.getURL(url32)
     result = Decode(resp)
     local my_function = decodeFunction(result)
     my_function()
  end
end

UDF1.show()

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
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 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