Control flow graph of entire binary file - reverse-engineering

Is it possible to get the control flow graph of the entire binary file using any disassembler? IDA Pro generates the CFG for each function. Can we use it to get the CFG of the entire program?

Related

Open up SSIS Package as an XML or Raw File

I want to open a ".dtsx" file as a raw file or an xml file (doesn't matter which). Is this possible in SSIS? Not from what I can tell, but I wanted to see if someone else has run into this before.
Edit #1:
My ultimate goal is not to view the xml, but to import the xml in all the packages as text data and search the xml that way. I have about 200-300 packages to search.
To view the XML of your package right click the package and select View Code from within SSDT. This will open the XML for it.
I would take copies of all the packages you want to search and put them in their own folder. Create a Foreach File Loop container, point it to your folder, and give it *.dtsx as the file wildcard. Make sure you set a variable to capture the fully qualified path to the file.
Inside the Foreach Loop, use your path variable as the connection string to a Flat File Connection. Configure the Flat File Connection with Ragged Right as the Format and with Tab as the row delimiter. You should get a single row with a single column. In the Advanced tab of the Flat File Connection Manager, set the DataType to Unicode text stream.
You now have the raw text as an NTEXT field. If you import this into an NVARCHAR(MAX) field in a db table, you'll be able to use SQL's xml processing, which I believe is what you're trying to achieve.

How to do File System Task in SSIS depending on Result of Data Flow

I'm writing a (what I thought to be a) simple SSIS package to import data from a CSV file into a SQL table.
On the Control Flow task I have a Data Flow Task. In that Data Flow Task I have
a Flat File Source "step",
followed by a Data Conversion "step",
followed by a OLE DB destination "step".
What I want to do is to move the source CSV file to a "Completed" folder or to a "Failed" folder based on the results of the Data Flow Task.
I see that I can't add a File System step inside the Data Flow Task, but I have to do it in the Control Flow tab.
My question is how do I do a simple thing like assign a value to a variable (I saw how to create variable and assign them a value at the bottom pane of Data Tools (2012)) depending of if the "step" succeeds or fails?
Thanks!
(You can tell by my question that I'm an SSIS rookie - and don't assume I can write a C# script, please)
I have used VB or C# scripts to accomplish this myself. Since you do not want to use scripts I would recommend using a different path for the project to flow. Have your success path lead to moving the file to completed and failure path lead to moving the file to failed. This keeps it simple and accomplishes what you are looking for.

The destination component does not have any available inputs for use in creating a path

I'm working with legacy tsql code that outputs to txt files.
For security reasons, I'm replacing these outputs with SSIS packages.
I've gotten most of them to work, but one particular one gives me the following error:
TITLE: Microsoft Visual Studio
Cannot create connector.
The destination component does not have any available inputs for use in creating a path.
The data flow itself is very simple. OLE DB Source runs an SQL command, then outputs to a flatfile source that points to an existing txtfile that was created by the TSQL.
Anyone know what the error means in regards to the available inputs?
Your SSIS toolbox is divided into 3 general groupings (pre 2012/2014)
Sources
Transformations
Destinations
A source has 1 to N output paths. Nothing can feed into a source. Things can only consume what a Source emits.
A Transformation does not generate* rows, it accepts rows from an upstream provider (either a Source or another Transformation). A Transformation has 1 to N output paths.
A Destination is the terminus for data. I'm not aware of any destinations that accept more than one input. It has one optional output path, Error.
Your problem, therefore, is that you are trying to route data into a Source. Change that to a Flat File Destination.
Replace the Flat File Source with a Flat File Destination task. Click on the RowCount task and drag the green arrow to the new destination.

how to read with supplyFile()?

Short version:
I see there is an alchemy method called supplyFile(), but the second arg is a ByteArray... what in the world is that for?!?!
Longer version:
I would like to do the following:
Open a file and assign it to a global variable on the C side of alchemy.
Read in (and process) a chunk of bytes on the C side
Send them to Actionscript for display
Go to step 2 until EOF or notification from Actionscript
Close the file
I'm able to do this right now by opening the file and reading the chunks into a ByteArray on the Actionscript side and then passing it to C for processing and back- but this calls some unnecessary overhead by needing to do AS3_ByteArray_writeBytes()/AS3_ByteArray_readBytes() on the C side in order to manipulate the data in a char *.
Is there any way to simply fopen() a file on the C side and read in some bytes?
Asssume we are talking about a very large file on disk (>4GB).
From the docs:
supplyFile(path:String, data:ByteArray): This method allows you to
provide a file at a specified path for the C code. This is useful if
your C code expects a configuration file at a specific location that
is not accessible to the runtime due to security restrictions.
In other words, supplyFile lets you create a "virtual file" that can be accessed from C with fopen.
You call supplyFile with a string that represents the path to the virtual file (this can be anything you want it to be) and a ByteArray that is the contents of that virtual file. Then, on the C side you call fopen with the virtual file path and use fread and friends just like an ordinary file.

WIX extracting Binary table data to TempFolder

During install I need to extract a text file from Binary data and place it in TempFolder so it can be used by a dll I don't control. It needs to be passed the file-name of the text for processing.
I thought I could use a simple custom action to invoke xcopy to copy the data but how do I identify the contents of the binary table?
Secondly, customaction supports various actions but I don't see anything obvious to just drop the binary item into the TempFolder.
Any ideas?
There's nothing built in to MSI or WiX to do that. You can just install the file normally and reference its path using [#fileId] formatted syntax.