How can we parse .sconsign.dblite file? - build-process

From this : What is the file .sconsign.dblite for?
I understand that it is a database.
I am interested to see the contents of it. How can it be parsed?
Is there any standard tool available?

The installation of SCons contains a command-line tool named "sconsign", which can be used to output the contents of the signature database in a more human-readable format.
If you're under Linux/Unix, check its MAN page please (man sconsign).

Related

Is it possible to read .qrc Qt resource file from compiled executable?

I am creating an application in Qt which can be used by users to read some confidential text file. The idea is that if a user wants to access this file, he can only do so through this application and not read it directly. I am planning to add this file using qrc resource.
What I would like to know is that:
Is it possible for a user of the application to somehow "extract" the embedded resource from the compiled executable?
If so, in order to prevent this, is it possible to encrypt or hash the said resource before compiling?
P.S.Maybe someone out there has already faces this scenario and came up with a better solution then what I am thinking. If so, new ideas are always welcome.
Depending on your level of expertise, you could make retrieving the text a bit more difficult, but you won't get a secure result this way.
rcc (Qt's resource compiler) tries to compress a resource and if the resource compresses to less than 30%, it will compress the resource. Otherwise the resource will go uncompressed into your executable. As a starting point, you could persuade rcc to always compress by calling rcc with option -threshold 1.
Next you will have to make sure, that all debug symbols are erased from your delivery, otherwise an astute code reader will do something like this:
objdump -all-headers your.app/Contents/MacOS/your | grep qrc
and will get something like this:
00000001002162f0 l F __TEXT,__text __GLOBAL__sub_I_qrc_resources.cpp
Where 00000001002162f0 is a good starting point for disassembling your executable.
Still: Even if you remove all debug symbols, your resources will always pop up in the DATA section of your code.
So even if you are following this and further advice people might give, it's just obfuscation. Welcome to the wonderful world of cryptology and steganography.

asp.net Web API retrieve file(s) without saving them

I want to retrieve file(s) with ASP.NET Web Api, XML file(s) or zip file(s).
There are many examples how to do this, like this:
http://www.asp.net/web-api/overview/working-with-http/sending-html-form-data,-part-2
But the problem is, I don't want to save them on HDD!
I just want to validate the XML with some functions and generate a report on the fly and want to return this report.
But every tutorial use the "MultipartFormDataStreamProvider" witch save the files on HDD.
How can I get the file(s) and file name(s) in memory?
Kind regards
I think you can use the MultipartMemoryStreamProvider?
See a way to implement file upload without writing to the file system.

Auto-generate ReST web services documentation/WADL

We are creating ReST Web Services using ASP.NET and OpenRasta.
Is there any tool that can could help us:
create WADL file
or/and create human readable API documentation similar which decribed resources/HTTP
methods supported for each resource, etc ?
Looks like REST Describe & Compile should do the trick.
On the WADL developer site Marc Hadley
maintains a command line tool named
WADL2Java. The ambitious goal of REST
Describe & Compile is to provide sort
of WADL2Anything. So what REST
Describe & Compile does is that it:
Generates new WADL files in a completely interactive way.
Lets you upload and edit existing WADL files.
Allows you to compile WADL files to source code in various programming
languages.
For OpenRasta, it'd be possible to use a UriDecorator to have help-like URIs defined for your resources (such as /myResource$help). You can then rewrite the URI before parsing to something yo can document easily, parse teh uri, find the resource type, and rewrite to /help/{resourcetype}
From there you register a resource for your help system:
ResourceSpace.Has.ResourcesOfType()
.AtUri("/help/{resourceType}")
.HandledBy()
.RenderedByXxx()
Then you can create your handler to return the documentation about a resource. You could for example use the IOperationCreator service to know which http methodds are available and with what input arguments, use the ICodecRepository to see what media types may be accepted as input, and potentially what a media type serialization would look like by calling the codec and generating an html friendly view of it.
That's definitly an area we're going to work on for the next version.

How to write a webscript in Alfresco that returns a zip file

I need to write a webscript in alfresco that returns to the user a single zip file that contains several files, some of them created on the fly by the script and some of them stored on the server.
How can i do it?I know how to create different files on the server, i don't know how to zip them and how to include files that are stored on the server.
Well, you can develop a Java action that would do the zipping part.
Last time I was looking into this, I didn't find an out-of-the-box solution.
As for returning, you can specify that by specifying webscript format, ie:
<format default="html">any</format>
Only, there is a problem, you can't set a zip format, but alfresco wiki says how you can add more:
http://wiki.alfresco.com/wiki/3.0_Web_Scripts_Framework#HTTP_Response_Formats
Edit: I just found this thread (while looking for a solution for another problem). In the thread a custom "unzip" action is described, maybe you can use that to add a zip/unzip action in your alfresco installation and use it.

How to create a directory in Lua?

Is it possible to create a directory in lua ? If so, how ?
You may find the LuaFileSystem library useful. It has a mkdir function.
require "lfs"
lfs.mkdir("/path/to/dir")
There's a "system" call (or something like that, this is from memory) which you should be able to use to run an arbitrary program, which could include the mkdir command.
EDIT: I found my Programming in Lua book. On page 203, it mentions how you could use an
os.execute("mkdir " .. dirname)
to "fake" a directory creation command.
EDIT 2: Take note of Jonas Thiem's warning that this command can be abused if the directory name comes from an untrusted source!
You may also want to look at Lua/APR, the Apache Portable Runtime binding for Lua. The docs can be found at here
One of the reasons I use Lua is that I can write code that runs across multiple OSes. I was using LFS for some time, but have found that using Lua/APR provides a more platform-neutral library. And there are lots of other useful routines in the APR.
You can use the paths package instead. Then you can simply do:
require 'paths'
paths.mkdir('your/dir')

Resources