Posts Tagged ‘windows’

Setup and Use GCC on Windows in 5 Easy Steps

Do you want to be able to compile C, C++, Ada and Fortran programs on Windows without losing time wrestling with a bulk, resource-intensive IDE? You can! The solution is to port the ultra-popular, lightweight GCC (GNU Compiler Collection) often used in *nix systems to Windows via MinGW + Cygwin.

MinGW is the minimalist GNU implementation for Windows.

If you’re like me then by the time you’ve come to the realization that you want to use MinGW and GCC on Windows for coding purposes, you’ve probably already installed it as a dependency of other software you might run, such as Anaconda or along with your Cygwin install (if so, skip to Step 3).

1. Install Cygwin, which provides many Linux commands/libraries to Windows

2. Install MinGW

3. Make sure that MinGW was added to your PATH by typing PATH in a terminal

If not, you can add it through Window’s GUI interface (just type PATH or Environment in Start on Win 7 or 8 and it will come right up as a search result).

4. In a terminal (cmd or PowerShell) go to the directory containing the code you want to compile, i.e.

cd c:\Users\Hackr\coolcode

5. Type the compile command:

g++ hackr.c -o hackr.exe

where -o is indicating your output file.

This also works with compiling multiple files:

g++ hackr.c econometrics.c hadoop.c overflow.c -o hackeconometrics.exe
That’s it!

This should take at least an hour or 2 less time than installing Microsoft’s Visual Studio (though the latter has it’s virtues) or a similar bulky IDE and will give you fewer headaches by avoiding complicating your life with a million unnecessary options and confusing attempts to “help” you build a simple project.

BabyGnu

Python: Install easy_install for Python 3.4 under Windows 7 in 2 Steps

Sometimes your Python installation is a little more bare bones than it should be. To initialize easy_install do the following:

1. Download and run this file:

https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py

2. Specify easy_install commands with this syntax:


C:\Python34\python.exe -m easy_install packagename

White & Black box Debuggers, Intelligent Debugging, and Dynamic Analysis

Debugging is a common task for data scientists, programmers, and security experts alike. In good ole RStudio we have a nice, simple built-in white-box debugger. For many analysis-oriented coders, the basic debugging functionality of an IDE like RStudio is all they know and it may be a surprise that debugging is a bigger, much sexier, topic. Below I define and describe key topics in debugging and dynamic analysis, as well as provide links to the most cutting edge free debuggers I use.

Dynamic Analysis: Runtime tracing of a process, usually performed using a debugger. Dynamic Analysis is critical for exploit development, fuzzer assistance, and malware inspection.

Debugger: a program that is used to test and troubleshoot other programs.Intelligent Debugger: a scriptable debugger that supports extended features such as call hooking, such as Immunity Debugger and PyDbg.

White Box Debugger: Debuggers built into IDEs and other dev platforms, which enable developers to trace through source code with a high degree of control, as to aide in the troubleshooting of functions and other code breakages.
Black Box Debugger: Used by bug hunters and reverse engineers, black box debuggers operate on compiled programs when the source code is not available and the only information is available in a disassembled format. There are two broad subclasses of black box debuggers, which are user mode (i.e. ring 3) and kernel mode (i.e. ring 0).
User mode black box debugger: a processor mode under which your applications run, usually with the least amount of privilege (e.g. double clicking PuTTY.exe launches a user-mode process).
Kernel mode black box debugger: a processor mode where the core of the OS runs using the highest amount of privilege (e.g. capturing packets with a network adapter that is in passive mode).
User-mode Debuggers Commonly used among Reverse Engineers
WinDbg by Microsoft
OllyDbg by Oleh Yuschuk, a F.O.S.S. debugger
GNU Debugger (gdb), a F.O.S.S. Linux debugger by the community
Script_Debugger

DLL, SO, COM; Windows + Linux

DLL = Dynamically Linked Libraries (Windows)

SO = Shared Objects (Linux)
COM = Component Object Model functions (Microsoft); HRESULT error codes come from here
Example:
msvcrt.dll is located in C:\WINDOWS\System32 in Windows and
libc.so.6 is located in  /lib in Linux
Both contain printf() from the C runtime

SAS: How to Run a SAS Script on Windows CLI

“E:\Program Files\SAS\SASFoundation\9.2\sas.exe” -sysin “\\path\to\script\script.sas”” -NOSPLASH -ICON -CONFIG “E:\Program Files\SAS\SASFoundation\9.2\nls\en\SASV9.CFG” -sasinitialfolder “E:\temp\foldername”  -work “E:\temp\foldername”

Windows: Generate a List of Installed Programs

Enter “wmic” (wmic is the Windows Management Instrumentation

term

Command-line tool) at the command line and press Enter.

NOTE: For more information about WMIC, see Microsoft – Using the Windows Management Instrumentation Command-line (WMIC) tool.

Enter the following line at the wmic:root\cli prompt and press Enter.

/output:C:\Users\jmiller\InstallList.txt product get name,version

NOTE: There is a space between .txt and product, between product and get, and between get and name.

You can also change the name of the output file and drive letter and path (right after /output:) if you want to modify the output location.

term2

The InstallList.txt file is created on the root of the C: drive.

NOTE: Depending on how many programs are installed, you may have to wait a bit for the list of installed programs to be created. You will know that the list is complete when you get the wmic:root\cli prompt again.

3

When you open the InstallList.txt file in a text editor, you can view the Name and Version of every program installed on your computer in a nice table.