vsi.windows package

Submodules

vsi.windows.console module

vsi.windows.console.fix_ansi()[source]

There is an issue in Windows consoles with TTY support where Windows mangles ANSI codes on stdout and stderr. This function will prevent this mangling for the current python process by setting the console mode to ENABLE_ECHO_INPUT if ENABLE_LINE_INPUT is enabled, which fixes the problem.

vsi.windows.find_process module

vsi.windows.find_process.findProcess(imageName, filterString)[source]
Parameters:
  • imageName (str) – The image name

  • filterString (str) – The filter string

Returns:

The Process

Return type:

iterator

vsi.windows.named_pipes module

class vsi.windows.named_pipes.Pipe(name, server=False)[source]

Bases: object

Windows Named Pipe class similar to File objects

close()[source]
disconnect()[source]

Send disconnect to client, forcing them to disconnect from the pipe

open()[source]
Raises:
read(bufferSize=4096)[source]

Read up to bufferSize bytes

static wait_for(name, timeout__ms)[source]
Parameters:
  • name (str) –

  • timeout__ms (int) – The timeout in milliseconcds

Return type:

bool

write(message)[source]
Parameters:

message (str) – The message

exception vsi.windows.named_pipes.PipeException[source]

Bases: Exception

vsi.windows.named_pipes.open(name, server=False)[source]

Helper open function

Parameters:

name (str) –

Returns:

The pipe

Return type:

Pipe

Give it the look and feel of python’s open command

vsi.windows.win32 module

vsi.windows.win32.GetFileInformationByHandleEx_FileNameInfo(file_handle)[source]

Calls the FileNameInfo version of GetFileInformationByHandleEx and returns the filename

file_handle should be a kernel32 HANDLE, such as kernel32.GetStdHandle

Parameters:

file_handle (HANDLE) –

Return type:

str

vsi.windows.wmic module

class vsi.windows.wmic.Pgrep(args=[], get=['/all'])[source]

Bases: object

parse()[source]
Raises:

Exception – Unknown type

run()[source]
Raises:

Exception – Bad pid return code

class vsi.windows.wmic.Wmic(path)[source]

Bases: object

static getPaths()[source]

Get all possible paths

getProperties()[source]
help()[source]
class vsi.windows.wmic.WmicProperty(name, type, value=None, perm=None)[source]

Bases: object

perm
Raises:

Exception – Unknown type

Module contents