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 


Problem when running HTML file

 
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: 1668

PostPosted: Sun Sep 27, 2015 6:14 am    Post subject: Problem when running HTML file Reply with quote

Hi guys,

refer to topic about running a HTML/HTA file as shown by alanze :

link :
http://cheatengine.org/forum/viewtopic.php?t=581338&sid=9f4d4e1b7377c157be60351c060a5c91

I make a CE Trainer to test execute HTA file.
At first, second and third times it work properly, but next it won't work.
I put command "shellExecute("file.hta") under a CEButton.click(sender), not in a dialog event.

Code:

function makeForm()
title="Test HTA"
f  = createForm(false)
p  = createPanel(f)
setProperty(f,"ShowInTaskBar", 'stAlways')
setProperty(f,"Position", "poScreenCenter")
setProperty(f,"BiDiMode", "bdLeftToRight")
setProperty(p,"BiDiMode", "bdLeftToRight")
setProperty(p,"BiDiMode", "bdLeftToRight")
control_setSize(f, 250, 70)
x,y = control_getSize(f)
control_setSize(p, x,y)
control_setCaption(f, title)
tm = os.date()
tm = tostring(tm)
lb = createLabel(p)
control_setPosition(lb, 100, 5)
control_setCaption(lb, tm)
btn = createButton(f)
control_setCaption(btn, "Test HTA")
control_setSize(btn, 70, 30)
control_setPosition(btn, 20,20)
form_show(f)
end

makeForm()

function executor()
shellExecute("test.hta")
end

control_onClick(btn, executor)


test.hta has added as extra file in CE Menu > Table > Add file

test.hta script :

Code:

<html><head><title>Message Encrypter/Decrypter</title><HTA:APPLICATION
APPLICATIONNAME="Message Encrypter/Decrypter"
ID="Message Encrypter/Decrypter"
VERSION="1.0"
MAXIMIZEBUTTON="no"
SCROLL="no"/></head>
<style> td { color: Black; }
caption { color: Black; }
body { font-family: Arial; background-color: #708090; color: #808080; }
input { background-color: #202020; color: #808080; }
textarea { background-color: #202020; color: #808080; }
</style>
<script language="VBScript">
Sub Window_OnLoad
Dim width,height
width=700
height=500
self.ResizeTo width,height
End Sub
Function Validate(ID)
On Error Resume Next
Key = Int(pass.value)
If (pass.value = "") Then
X = MsgBox("You have to enter your password..!", 48, "Error")
Else If (tamsg.value = "") Then
X = MsgBox("Enter the text to encrypt or decrypt!", 48, "ERROR!")
Else
Junk = SetTimeOut(KEYS(ID), 1)
End If
End If
End Function
Function KEYS(ID)
text = pass.value
code = 0
Do Until text = ""
code = ((Asc(Left(text, 1)))+code)
text = Replace(text, Left(text, 1), "", "1", "1")
Loop
code = code Mod 255
akey.value = code
Junk = SetTimeOut(ID, 1)
End Function
Function Encrypt
Alpha = Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
text = tamsg.value
code = ""
key = Int(akey.value)
Do Until text = ""
cnum = Asc(Left(text, 1))
cnum = (cnum+key) Mod 255
num = cnum Mod 26
count = 0
tst = num
Do Until tst = cnum
tst = tst+26
count = count+1
Loop
code = code & Alpha(num) & count
text = Replace(text, Left(text, 1), "", "1", "1")
Loop
tamsg.value = code
End Function
Function Decrypt
Alpha = Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
text = tamsg.value
code = ""
key = Int(akey.value)
Do Until text = ""
lttr = Left(text, 2)
num = Asc(Left(lttr, 1))-65
chk = Right(lttr, 1)
count = 0
Do Until count = Int(chk)
num = num+26
count = count+1
Loop
num = num-key
Do While num <= 0
num = num+255
Loop
Code = code & Chr(num)
text = Replace(text, Left(text, 2), "", "1", "1")
Loop
tamsg.value = code
End Function
</script>
<body bgcolor="white"> <input type="hidden" id="akey"> <span title=""> <span title="Never stop to learn">
<marquee color="white" bgcolor="black" style="font-family= Book Antiqua;">This application made <font color="cyan">Hide your message with this hta application</font></marquee> </span> <table align="center" width="400">
<caption style="font-family:Book Antiqua; font-size:20;"><hr color="black"><b>Message Encrypter-Decrypter</b><hr color="black"></caption>
<tr> <td align="center"><span title="Enter your Full message here"><textarea id="tamsg" cols="80" rows="15"></textarea></span></td> </tr>
&nbsp;&nbsp;&nbsp;&nbsp; <td color="black" style="font-family: Book Antiqua; font-size:18;"><hr color="black"> Password &nbsp;<span title="Enter your password here">
<input type="password" id="pass"></span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span title="Click Here to Encrypt your Message"> <input style="width: 170px; height:23px; color: white; background-color: #203040; font-family:Book Antiqua;" type="button" Value="Encrypt" id="btnenc" onClick="Validate('Encrypt')" onmouseover="btnenc.style.background='#102030'" onmouseout="btnenc.style.background='#203040'"> </span> <span title="Click Here to Decrypt your Message"> <input style="width: 170px; height:23px; color: white; background-color: #203040; font-family: Book Antiqua; font-size:13;" type="button" Value="Decrypt" id="btndec" onClick="Validate('Decrypt')" onmouseover="btndec.style.background='#102030'" onmouseout="btndec.style.background='#203040'"> </span></td>
</tr> <tr> <td align="right"><hr color="black"><span title="All rights reserved by Corroder VCBro" style="font-size: 13px; font-family:Book Antiqua;">&copy; 2013 Corroder - All rights reserved.</span></td> </tr> </table> </body> </html>


I have tried with other .hta files, but it won't work ?

EDIT : If try run the .hta file it self not under CE Trainer, it work properly.

Does someone could fix the problem ?

Regards
Back to top
View user's profile Send private message
Fluffer_Nutter
Advanced Cheater
Reputation: 0

Joined: 26 Feb 2015
Posts: 67

PostPosted: Sun Sep 27, 2015 12:31 pm    Post subject: Reply with quote

The file needs to be loaded 1st. The shellexe() is to run a process from the pc. But the .hta file is in the stream. There is a command to do it but i cant remember what it is. Ill look around to help and post back when i find it.
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Sun Sep 27, 2015 10:38 pm    Post subject: Reply with quote

Thanks Fluffer_Nutter,

with shellExecute() we can run / executing local file, in this case HTA file which it placed in same directory with CE Trainer.

To execute HTA file as stream file, we can use openDialog() function.
Now I am still trying to make an openDilaog() into the trainer as file launcher function.

Maybe find some examples about use openDilaog in CE will help much.
Anyhow, thank you for your kind attention.

Regards
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
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