How to change the assemblyIdentity of an executable? - assemblies

I want to hide the tool I used to create an .exe file. I am not doing anything illegal, I just want to protect my intellectual property from being copied. If I open the exe file in a text editor I see the following section.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="XXX.XX"
processorArchitecture="X86"
name="Microsoft.Windows.NameOfTheTool"
type="win32"
/>
</assembly>
I have attempted to change the name to:
name="Microsoft.Windows.SomeOtherName"
This resulted in the following message when I attempted to execute the file.
"This application has failed to start because its side-by-side configuration is incorrect."
How can I solve this?

I've never changed the manifest data, but it might be possible. You should check the linker options.
Regardless, an exe packer like .NETZ may obfuscate things sufficiently.
Now that I look again: the name attribute should be the name of your assembly, not the program (such as VisualStudio) used to create it. If it's not, you'll have to tell us more for us to figure out why. If your program is really script that's fed into some other program, all bets are off.

Related

Corda Enterprise generates a details-node-.log file

at the beginning of the project we worked with Corda Opensource, and we used the command line argument logging-level=WARN to change the log level of the nodes.
When we started using Corda Enterprise, we noticed that a details-node-.log file was created. It is a log file that grows fast and is at TRACE level.
Our question: can the log in this file affect the performance of our cordapps and can we change the level of this log or disable it?
Corda Enterprise adds that logger which is not present in Open Source Corda.
The only impact I can see for a CordApp could be probably the lack of space on the server, so if in your case this log file becomes too big too quickly, it would be a good idea to configure it to avoid possible problems.
You can override the log4j configuration file and give it as input to the jar like this:
java -jar Dlog4j.configurationFile=new-log-config.xml <en-service>.jar
It is standard log4j, so you can also configure the rollover period and the size.
For reference, you can also take a look to this log4j.xml in open source Corda to see how the loggers are configured.
So, can probably override the logger you're concerned about with the following:
<?xml version="1.0" encoding="UTF-8"?>
<Properties>
...
<Property name="detailLogLevel">TRACE</Property>
</Properties>
<Appenders>
...
<RollingRandomAccessFile name="Detailed-RollingFile-Appender"
fileName="${log-path}/details-${log-name}.log"
filePattern="${archive}/details-${log-name}.%date{yyyy-MM-dd}-%i.log.gz">
<Policies>
...your policies...
</Policies>
<DefaultRolloverStrategy>
...your strategy...
</DefaultRolloverStrategy>
</RollingRandomAccessFile>
</Appenders>
<Loggers>
...
<Logger name="DetailedInfo" additivity="false" level="${detailLogLevel}">
<AppenderRef ref="Detailed-RollingFile-Appender"/>
</Logger>
</Loggers>

ASP.NET Web Forms - Adding Hebrew characters in web.config gives internal server error

In my web.config file I am trying to add a key like that:
<add key="DefaultUserErrorPayMessage" value="רווית" />
but I get an internal server error doing that...
(when I add a value in English letters it works ok)
In the globalization tag I tried to add:
<globalization culture="he-IL" uiCulture="he-IL" fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8"/>
but still no luck there.
I also have this at the top of the file:
<?xml version="1.0" encoding="UTF-8"?>
Can anyone point out what is the desired solution for this?
OK found the answer...
It is quite stupid I must admit.
when publishing the website the web.config file is ANSI encoded, so need to overwrite this file as UTF-8 encoded.

QFile can't delete files on C drive

I have a listWidget that displays files. I can delete selected files on the desktop and other locations, but files on the C drive will not delete. How can I delete the files on C drive? I am only trying to delete single files, not a directory. I am using Windows. Here is my code snippet.
void MainWindow::on_removeSelectedFile_clicked() {
QString fileToRemove = ui->listWidget->currentItem()->text();
QFile::setPermissions(ui->listWidget->currentItem()->text(),
QFile::ReadOwner|QFile::WriteOwner|QFile::ExeOwner);
QFile::remove(fileToRemove);
ui->listWidget->takeItem(ui->listWidget->currentRow());
}
I have tried setting all of the different permissions.
I have also tried using code below but not sure if I was doing the right thing with it:
extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
qt_ntfs_permission_lookup++;
How can I delete files on the C drive of have permission to delete any file in any location?
To get this working, I needed administrator privileges when the program starts. Here is the solution.
1) Create the rc file :Open notepad and paste the following text inside then save the file as yourappname.rc This creates the rc file. Put the file in the folder that has all of your sourcecode and pro file.
#include <windows.h>
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "yourappname.exe.manifest"
2) Create the manifest file with notepad, paste the following text, and save it as yourappname.exe.manifest and put it in the same location as above.
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="2.0.0.0" processorArchitecture="X86"
name="yourappname.yourappname" type="win32" />
<description>A discription of your app</description>
<dependency />
<!-- Identify the application security requirements. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
3) In your pro file put the following text:
win32 {
RC_FILE = yourappname.rc
}
That's it. Now your application should start with administrator privileges.
There are similar post that describe this process too. Just make sure there are no spaces in your folder names or it won't work. Also you MUST run qt with administrator privileges for it to work. Right click Qt and run as administrator before trying to compile.

Where is the update site for `org.eclipse.fx.javafx` (Unable to locate installable unit)?

I have a plugin based product file using:
org.eclipse.fx.javafx
org.eclipse.fx.osgi
I think these plugins come from the e(fx)clipse project.
I am trying to build a target file providing those plugins (a maven+tycho build will be my next step). I thought I could get them on this p2 update site:
http://download.eclipse.org/efxclipse/updates-released/1.0.0/site
My target file looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?><target name="my_target" sequenceNumber="1">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.fx.javafx" version="2.2.0.201408150502"/>
<unit id="org.eclipse.fx.osgi" version="1.0.0.201408150502"/>
<repository location="http://download.eclipse.org/efxclipse/updates-released/1.0.0/site"/>
</location>
</locations>
</target>
But I get this error: "Unable to locate installable unit org.eclipse.fx.javafx".
If I edit the location, I can select one of those items:
I have the same behavior with the nightly update site:
http://download.eclipse.org/efxclipse/updates-nightly/site
You should NOT use this update-site to setup a target platform! Use http://download.eclipse.org/efxclipse/runtime-shared-released/1.1.0/site when creating target platforms.
.
The XML content of the Target file looks like this:
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="slicer" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.fx.runtime.min.feature.feature.group" version="1.1.0.201411050602"/>
<repository location="http://download.eclipse.org/efxclipse/runtime-shared-released/1.1.0/site/"/>
</location>
The feature with minimal content is described here: Easier runtime consumption through special features.
in this there is org.eclipse.fx.*
http://download.eclipse.org/efxclipse/updates-nightly/site
if you have problem you can dowload in zip:
http://download.eclipse.org/efxclipse/updates-nightly/site_assembly.zip

How to force replace an element using config transform in Visual Studio?

We know that Visual Studio has this awesome feature to transform Web.config on publish. So we can have something like the following in Web.Release.config to replace the original value in Web.config:
Web.config:
<add key="SomeKey" value="DebugValue"/>
Web.Release.config:
<add key="SomeKey" value="ReleaseValue" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
This is all good as long as you don't have a typo in the transform config. So for instance if you have the following line in your transform config:
<add key="SomeKeyTypo" value="ReleaseValue" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
Then "SomeKey" item is not going to be replaced because transform will not find the key and will silently print this warning:
...\Web.Release.config: Warning : No element in the source document matches '/configuration/appSettings/add[#key='SomeKeyTypo']'
The problem is that under some situations like if you change the key in the main Web.config and you forget to change it in Web.Release.config, when you publish there is a good chance that you don't read the publish output messages and you miss the Warning, which can end up in disaster because the Debug value will be used in your application instead of the Release value.
So the question is when you define the transform in Web.Release.config is there a way to indicate that the given item MUST be replaced and if the key is not found throw and ERROR instead of WARNING and basically exit the publish with some error code?
You could set the Visual Studio option to 'Treat Warnings As Errors' which would then raise an error preventing the Publish task from completing. You could even configure it to treat only this specific warning as an error.
You can find the dialog by going to the Properties Pages of the project you want to deploy, then under Build near the bottom you will find your options.

Resources