10 Commits

Author SHA1 Message Date
Jason Hood
bccf933c0a Always find the base address of kernel32.dll. 2014-01-27 14:03:53 +10:00
Jason Hood
b2c8a9ec12 LoadLibrary hooking improvements.
Don't hook ourself from LoadLibrary or LoadLibraryEx.
Test additional LoadLibraryEx flags before deciding to hook.
2014-01-25 23:43:41 +10:00
Jason Hood
a52a46c9c1 New method to obtain 32-bit LoadLibraryW from 64-bit code, eliminating the need
for ANSI-LLW.exe.
Set the code page so ansicon.exe can display some strings properly.
Expand wildcards for -t.
VC6 can now compile the 32-bit version; use it for the release binaries.
Improvements to the VC makefile.
Describe the sequences in a bit more detail.
2012-11-24 23:41:29 +10:00
Jason Hood
790de57763 Exclude modules from being hooked; hook only selected GUI programs.
Added environment variable ANSICON_EXC to specify modules that should not be
hooked.  This should work around the nvd3d9wrap.dll issue.  Since it helps to
know what the modules are, logging is now always available, controlled by -l
or ANSICON_LOG.  A side-effect caused debugstr.c to move to util.c.

GUI programs are once again not hooked, unless run by "ansicon" directly or in
the ANSICON_GUI environment variable.  Since not hooking still leaves ANSICON in
the environment, created ANSICON_VER as a dynamic-only variable, which can also
serve as a version check.

Due to an email requesting a reverse video option, realised I always take the
current attributes as default.	This means if you turned on reverse and ran a
program, it would take the reverse as its default.  Created ANSICON_DEF variable
to explicitly set the default attribute, using the current if it doesn't exist.
The reverse video option is done via a "negative" attribute (e.g. "-m-f0" is
reversed black on white, meaning you'll get white on black, with foreground
sequences changing the background).  (The difference from "\e[7m" is that it
won't be reset on "\e[m".)

A child program will inherit the parent's modes (but not shift); the parent will
read the child's modes on exit (but not unload).  The exception is "ansicon",
which will always start with the default modes and leave the parent unchanged.

Improved the AutoRun entry, only running "ansicon" if ANSICON_VER doesn't exist.
The "ansicon" command is always first.

Stopped -u implying -p; return the program's exit code; don't restore the
original color when just using -p; output error messages to stderr.
2011-12-14 20:53:51 +10:00
Jason Hood
b6e61429d7 Added DECTCEM to show/hide the cursor. 2011-03-01 21:01:37 +10:00
Jason Hood
6d7cd9212c Hook GetProcAddress (.NET support for PowerShell) 2011-02-26 01:12:35 +10:00
Jason Hood
1b3511ac1f Fixed x64 and MinGW32 crashes. 2010-12-22 18:47:45 +10:00
Jason Hood
be7672b92e Close the handles opened by CreateProcess.
Prevent the block when directly running a GUI process.
File logging improvements (on by default, this time).
2010-12-16 16:00:56 +10:00
Jason Hood
dd4e45686b General maintenance. 2010-12-12 23:32:22 +10:00
Jason Hood
b9d2207742 Improvements 2010-12-12 21:58:35 +10:00