473,666 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTAs, code protection and resource compiling.

Hi all,

Don't know how many out there actually use HTA's, but I do, and am
looking at protecting javascript code associated with one I look after.

This HTA runs of a network drive, not a webpage.

Basically I've read that it's possible to compile js files and the like
to a "Resource file", and then access it using a call to the res://
protocol.

The trouble is I can't find any information on where to get the
resource compiler from, and how to actually create this resource dll,
does anyone know how to do this, or where I can get a tutorial to step
me through this.

I basically want to protect my js code (at least superficially) from
prying users. Because of the code complexity (the generates html
pages), I've had no luck with obfuscation, and it tends to break the
code irreparably.

Thanks for any help
Mike

Jul 25 '05 #1
15 6100
VK


runonthespot wrote:
Hi all,

Don't know how many out there actually use HTA's, but I do, and am
looking at protecting javascript code associated with one I look after.

This HTA runs of a network drive, not a webpage.

Basically I've read that it's possible to compile js files and the like
to a "Resource file", and then access it using a call to the res://
protocol.

The trouble is I can't find any information on where to get the
resource compiler from, and how to actually create this resource dll,
does anyone know how to do this, or where I can get a tutorial to step
me through this.

I basically want to protect my js code (at least superficially) from
prying users. Because of the code complexity (the generates html
pages), I've had no luck with obfuscation, and it tends to break the
code irreparably.

Thanks for any help
Mike


If the browser compatibility is not an issue, you may use Microsoft
Script Encoder. It's not some long-key enscription, but still times
better than any home made obfuscator.

<http://www.microsoft.c om/downloads/details.aspx?Fa milyId=E7877F67-C447-4873-B1B0-21F0626A6329&di splaylang=en>

<http://msdn.microsoft. com/library/default.asp?url =/library/en-us/script56/html/seusingscripten coder.asp>

Jul 25 '05 #2
Alas, I've tried it but get an incomprehensibl e
"Script encoding failed" when I attempt to encode my js files.

I flailed around the net a bit, but haven't been able to find any
resource that gives me enough information to work out what I should be
looking for in my js pages that would make it fail.

Jul 25 '05 #3
.... but thanks for the suggestion!

Any idea where I can find a guide as to why/where the encoder might
fail, so I could potentially fix it?

Regards,
Mike

Jul 25 '05 #4
VK
> Alas, I've tried it but get an incomprehensibl e
"Script encoding failed" when I attempt to encode my js files.


Strange, it works just fine for me. Check your syntacs again:

<html>
<head>
<title>Microsof t Encoder Test</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<script language="JScri pt.Encode" src="sourceEnco ded.jse"></script>
</head>
<body bgcolor="#FFFFF F">
</body>
</html>

1) You must to use language declaration strictly this way:
language="JScri pt.Encode"

2) You have to manually assign .jse extention to ecoded file:
screnc plainScript.js encodedScript.j se

As sucky Google News seems do not allow attachments, I put all relevant
files here:
<http://www.geocities.c om/schools_ring/EncodingTest.zi p>

Jul 25 '05 #5
Google groups is a bit sucky, but at least I can access it from work
:-)

That worked fine, but the problem for me occurs in the encoding process
itself.
Using the Windows Source Encoder, and from the command line running the
code comes up with
"Encoding failed" when trying to create the jse file in the first
place. I can't seem to find anything on the net that explains the
limitations of the encoder.

Interestingly, I couldn't even compile the original source file you
provided ... I guess this is some kind of encoder failure on my box...
(Windows 2000, SP4)

"Scripting encoder object ("Scripting.Enc oder") failed on
c:\test\sourceP lain.js"

Thoughts?

Thanks for the trouble you're going to!

Jul 25 '05 #6
Aha!
Bingo. I figured out after some trawling that it might be a version
issue, and installed Windows Scripting Host 5.1, which seems to have
fixed the encoder.

Installing 5.5 on top of that and it still works-- must have been
something in 5.1 forgotten in 5.5...

Thanks for your help!

Jul 25 '05 #7
VK


runonthespot wrote:
Google groups is a bit sucky, but at least I can access it from work
:-)

That worked fine, but the problem for me occurs in the encoding process
itself.
Using the Windows Source Encoder, and from the command line running the
code comes up with
"Encoding failed" when trying to create the jse file in the first
place. I can't seem to find anything on the net that explains the
limitations of the encoder.

Interestingly, I couldn't even compile the original source file you
provided ... I guess this is some kind of encoder failure on my box...
(Windows 2000, SP4)

"Scripting encoder object ("Scripting.Enc oder") failed on
c:\test\sourceP lain.js"

Thoughts?
There is a number of "pseudo-screnc" programs in the Internet. Some
amateurs are hiding their home made obfuscators under the "loud name"
of the Microsoft product.

1) So first of all make sure thay you're using THAT screnc.exe. Go to
the address below and obtain a copy of the latest version. It's free
but requires a legal copy of Windows (runtime check will be done). I
hope it's not a problem? ;-)

Even if you are absolutely sure that you have THAT screnc, still
install the right copy from the scratch, please.

<http://www.microsoft.c om/downloads/details.aspx?Fa milyId=E7877F67-C447-4873-B1B0-21F0626A6329&di splaylang=en>
2) screnc is a DOC program, no Windows-interface is provide. To make
your future life easier, install it to some 8.3-compliant path.
c:\screnc would be a good choice.

3) Unpack my zip to c:\screnc and remove sourceEncoded.j se

4) Now run MS-DOS prompt and type:
cls<enter>
cd c:\screnc<enter >
screnc sourcePlain.js sourceEncoded.j se<enter>

sourceEncoded.j se should appear in your c:\screnc\ directory.

Tell me if it fails.

Thanks for the trouble you're going to!

No problem, I'm just charing what I already used for a while.
Plus *sometimes* I'm getting some sadistic plesure to talk about things
no one but IE can do :-)

Jul 25 '05 #8
Hi,

I too use HTA's a lot and use a resource DLL to store all my script
files and images.

To create a resource DLL you have to create a resource description
file. Then compile this file with a resource compiler which will give
you a .RES file. This file must be used in a linker to create a DLL
file. Check this website for the tools and more explanation.
http://www.godevtool.com/

Jul 25 '05 #9
VK


michael elias wrote:
Hi,

I too use HTA's a lot and use a resource DLL to store all my script
files and images.

To create a resource DLL you have to create a resource description
file. Then compile this file with a resource compiler which will give
you a .RES file. This file must be used in a linker to create a DLL
file. Check this website for the tools and more explanation.
http://www.godevtool.com/

And another bist of this kind (but this I never tried):

you may install the free Microsoft .NET Framework, it has JScript
compiler in it (jsc.exe) This way you can compile .js files into .exe
or .dll

But this is getting to much I guess...

Jul 25 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2364
by: peter chan | last post by:
java code protection- encrypted class For encrypted class , if intercept point is added in the classloader.defineClass() , all the class can be dumped, a product -Jencoder can prevent it . Do anyone know its operation.
9
8506
by: Saso Zagoranski | last post by:
Hi! I have recently completed an application, written in C#. When I opened one of the files with a hex editor I was amazed by the lack of protection for the assemblies. My application uses SQL Server and during install it sets up tables needed in the application. I also use a simple protection system, which stores a string (an initialization password) in the database, needed for the application to unlock after a few days have passed.
1
1247
by: Paul Aspinall | last post by:
Hi Does anyone know if there are to be any improvements in Obfuscation / code protection in .NET 2.0?? Will there be a better 'bundled' obfuscator?? I don't want to buy an obfuscator now, only to find I didn't need it, when 2.0 is released... for whatever reason. Thanks
7
2424
by: Boni | last post by:
Dear all, in order to protect my assembly component from decompilation I implemented following schema: I created mixed mode C++ project wich has managed cProxy class and unmanaged cMemLoader. In the cMemLoader I load encrypted assembly, decrypt it into memory buffer and then marshal this buffer into managed memory and load the assembly from memory.
5
1365
by: guoqi zheng | last post by:
I often write some .dll component for other people. Because of CLR, I often find easily access to all source code of my .DLL file by using some kind of reflector. Is there an easy to protect my .NET .DLL class source code? regards, Guoqi Zheng http://www.ureader.com
0
1175
by: Dutt | last post by:
..NET Obfuscation using Dotfuscator for Source Code Protection http://www.google.co.in/url?sa=t&ct=res&cd=36&url=http%3A%2F%2Fmsdotnetsupport.blogspot.com%2F2008%2F02%2Fnet-obfuscation-using-dotfuscator-for.html&ei=thesR9TOBoOEiAGO4uzKDg&usg=AFQjCNFuCy6jTz_K0cQ5h0TkqxUxN-vZkA&sig2=aaqZJ3FL6PlDEDDjPlj2fQ
0
8443
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8866
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8550
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8639
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7385
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5663
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1772
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.