Ejemplo n.º 1
0
void SHVConsole::wprintf(const WCHAR* str, ...)
{
SHVVA_LIST args;
	SHVVA_START(args,str);
	vwprintf(str,args);
	SHVVA_END(args);
}
Ejemplo n.º 2
0
void kprintf(PCWCHAR format, ...)
{
#ifdef _WINDLL
	int varBuf;
	size_t tempSize;
#endif
	va_list args;
	va_start(args, format);
#ifndef _WINDLL
	vwprintf(format, args);
	fflush(stdout);
#else
	if(outputBuffer)
	{
		varBuf = _vscwprintf(format, args);
		if(varBuf > 0)
		{
			if((size_t) varBuf > (outputBufferElements - outputBufferElementsPosition - 1)) // NULL character
			{
				tempSize = (outputBufferElements + varBuf + 1) * 2; // * 2, just to be cool
				if(outputBuffer = (wchar_t *) LocalReAlloc(outputBuffer, tempSize * sizeof(wchar_t), LMEM_MOVEABLE))
					outputBufferElements = tempSize;
			}
			varBuf = vswprintf_s(outputBuffer + outputBufferElementsPosition, outputBufferElements - outputBufferElementsPosition, format, args);
			if(varBuf > 0)
				outputBufferElementsPosition += varBuf;
		}
	}
#endif
	if(logfile)
		vfwprintf(logfile, format, args);
	va_end(args);
	fflush(logfile);
}
Ejemplo n.º 3
0
int wprintf(const wchar_t* format, ...) {
  va_list args;
  va_start(args, format);
  int result = vwprintf(format, args);
  va_end(args);
  return result;
}
Ejemplo n.º 4
0
void RetailPrint(wchar_t *pszFormat, ...)
{
    va_list al;
    va_start(al, pszFormat);
    vwprintf(pszFormat, al);
    va_end(al);
}
Ejemplo n.º 5
0
static void text_append_va(void *obj, const wgChar *format, va_list list)
{
#ifdef _UNICODE
	vwprintf(format, list);
#else
	vprintf(format, list);
#endif
}
Ejemplo n.º 6
0
/**
   Print formatted output
*/
static void say( wchar_t *blah, ... )
{
	va_list va;
	va_start( va, blah );
	vwprintf( blah, va );
	va_end( va );	
	wprintf( L"\n" );
}
Ejemplo n.º 7
0
int vwprintfDotsShell ( const wchar_t * format, ... ) {
    int res;
    va_list argList;
    va_start( argList, format );
    res = vwprintf( format, argList );
    va_end( argList );
    return res;
}
Ejemplo n.º 8
0
void WinPmem::Log(const TCHAR *message, ...) {
  if (suppress_output) return;

  va_list ap;
  va_start(ap, message);
  vwprintf(message, ap);
  va_end(ap);
};
Ejemplo n.º 9
0
void lh_abort(const wchar_t *msg, ...)
{
	va_list ap;
	va_start(ap, msg);
	vwprintf(msg, ap);
	va_end(ap);
	exit(1);
}
Ejemplo n.º 10
0
void CCmdBase::Output(PCWSTR pszFormat, ...) const
{
    va_list args;
    va_start(args, pszFormat);

    vwprintf(pszFormat, args);

    va_end(args);
}
Ejemplo n.º 11
0
void Log::print(const wchar_t* str, ...) const
{
	if(enabled){
		va_list mark;
		va_start(mark,str);
		vwprintf(str,mark);
		va_end(mark);
	}
}
Ejemplo n.º 12
0
void Util::Print(LPWSTR s, ...)
{
	va_list argList;
	va_start(argList, s);
	SetConsoleColor(WHITE);
	vwprintf(s, argList);
	SetConsoleColor(DEFAULT);
	va_end(argList);
}
/* goodB2G uses the BadSource with the GoodSink */
void CWE134_Uncontrolled_Format_String__wchar_t_file_vprintf_65b_goodB2GVaSink(wchar_t * data, ...)
{
    {
        va_list args;
        va_start(args, data);
        /* FIX: Specify the format disallowing a format string vulnerability */
        vwprintf(L"%s", args);
        va_end(args);
    }
}
/* goodG2B uses the GoodSource with the BadSink */
void CWE134_Uncontrolled_Format_String__wchar_t_file_vprintf_65b_goodG2BVaSink(wchar_t * data, ...)
{
    {
        va_list args;
        va_start(args, data);
        /* POTENTIAL FLAW: Do not specify the format allowing a possible format string vulnerability */
        vwprintf(data, args);
        va_end(args);
    }
}
Ejemplo n.º 15
0
void Util::Notice(LPWSTR string, ...)
{
	va_list argList;
	va_start(argList, string);
	SetConsoleColor(LIGHT_GREEN);
	wprintf(L"[+] ");
	vwprintf(string, argList);
	SetConsoleColor(DEFAULT);
	va_end(argList);
}
Ejemplo n.º 16
0
void
CStCuiView::PrintW(
    WORD            inClr,
    LPCWSTR inFormat,
    va_list         inArgList)
{
    WORD oldClr = ChangeTextClr(inClr);
    vwprintf(inFormat, inArgList);
    ChangeTextClr(oldClr);
}
Ejemplo n.º 17
0
void Util::Warn(LPWSTR string)
{
	va_list argList;
	va_start(argList, string);
	SetConsoleColor(LIGHT_YELLOW);
	wprintf(L"[-] ");
	vwprintf(string, argList);
	SetConsoleColor(DEFAULT);
	va_end(argList);
}
/* goodG2B uses the GoodSource with the BadSink */
static void goodG2BVaSink(wchar_t * data, ...)
{
    {
        va_list args;
        va_start(args, data);
        /* POTENTIAL FLAW: Do not specify the format allowing a possible format string vulnerability */
        vwprintf(data, args);
        va_end(args);
    }
}
Ejemplo n.º 19
0
int wprintf(const wchar_t* fmt, ...)
{
    va_list ptr;
    int ret;

    va_start(ptr, fmt);
    ret = vwprintf(fmt, ptr);
    va_end(ptr);
    return ret;
}
/* goodB2G uses the BadSource with the GoodSink */
static void goodB2GVaSink(wchar_t * data, ...)
{
    {
        va_list args;
        va_start(args, data);
        /* FIX: Specify the format disallowing a format string vulnerability */
        vwprintf(L"%s", args);
        va_end(args);
    }
}
	void Pause(wchar_t const* const _Format, ...)
	{
		va_list _ArgList;
		va_start(_ArgList, _Format);
		vwprintf(_Format, _ArgList);		
		va_end(_ArgList);
		
		std::cout << std::endl;
		_getch();
	}
Ejemplo n.º 22
0
void CCmdBase::RuntimeError(PCWSTR pszFormat, ...)
{
    _fError = TRUE;
    va_list args;
    va_start(args, pszFormat);

    wprintf(L"ERROR - ");
    vwprintf(pszFormat, args);

    va_end(args);
}
Ejemplo n.º 23
0
/// Prints to stdout if it is a console application
void SHVConsole::Printf16(const SHVWChar* str, ...)
{
SHVVA_LIST args;
	SHVVA_START(args,str);
#ifdef __SHIVA_POSIX
	printf("%s", SHVString16C::FormatList(str, args).ToStrT().GetSafeBuffer());
#else
	vwprintf((const WCHAR*)str,args);
#endif
	SHVVA_END(args);
}
Ejemplo n.º 24
0
/// Prints to stdout if it is a console application
void SHVConsole::PrintfList16(const SHVWChar* str, SHVVA_LIST args)
{
SHVVA_LIST argList;
	SHVVA_COPY( argList, args );
#ifdef __SHIVA_POSIX
	printf("%s", SHVString16C::FormatList(str, argList).ToStrT().GetSafeBuffer());
#else
	vwprintf((const WCHAR*)str,argList);
#endif
	SHVVA_END( argList );
}
Ejemplo n.º 25
0
void print_string(LPCWSTR format, ...)
{
  if (format)
  {
    va_list args;

    va_start(args, format);
    vwprintf(format, args);
    va_end(args);
  }
}
Ejemplo n.º 26
0
/**
   Print formatted error string
*/
static void err( wchar_t *blah, ... )
{
	va_list va;
	va_start( va, blah );
	err_count++;
	
	wprintf( L"Error: " );
	vwprintf( blah, va );
	va_end( va );	
	wprintf( L"\n" );
}
Ejemplo n.º 27
0
VOID
PrintResourceString(INT resID, ...)
{
    WCHAR szMsg[3072];
    va_list arg_ptr;

    va_start(arg_ptr, resID);
    LoadStringW(GetModuleHandle(NULL), resID, szMsg, 3072);
    vwprintf(szMsg, arg_ptr);
    va_end(arg_ptr);
}
Ejemplo n.º 28
0
void kprintf(PCWCHAR format, ...)
{
#ifndef MIMIKATZ_W2000_SUPPORT
	int varBuf;
	size_t tempSize;
	wchar_t * tmpBuffer;
#endif
	va_list args;
	va_start(args, format);
#ifndef MIMIKATZ_W2000_SUPPORT
	if(outputBuffer)
	{
		varBuf = _vscwprintf(format, args);
		if(varBuf > 0)
		{
			if((size_t) varBuf > (outputBufferElements - outputBufferElementsPosition - 1)) // NULL character
			{
				tempSize = (outputBufferElements + varBuf + 1) * 2; // * 2, just to be cool
				if(tmpBuffer = (wchar_t *) LocalAlloc(LPTR, tempSize * sizeof(wchar_t)))
				{
					RtlCopyMemory(tmpBuffer, outputBuffer, outputBufferElementsPosition * sizeof(wchar_t));
					LocalFree(outputBuffer);
					outputBuffer = tmpBuffer;
					outputBufferElements = tempSize;
				}
				else wprintf(L"Erreur LocalAlloc: %u\n", GetLastError());
				//if(outputBuffer = (wchar_t *) LocalReAlloc(outputBuffer, tempSize * sizeof(wchar_t), LPTR))
				//	outputBufferElements = tempSize;
				//else wprintf(L"Erreur ReAlloc: %u\n", GetLastError());
			}
			varBuf = vswprintf_s(outputBuffer + outputBufferElementsPosition, outputBufferElements - outputBufferElementsPosition, format, args);
			if(varBuf > 0)
				outputBufferElementsPosition += varBuf;
		}
	}
#endif
#ifndef _POWERKATZ
#ifndef MIMIKATZ_W2000_SUPPORT
	else
#endif
	{
		vwprintf(format, args);
		fflush(stdout);
	}
#endif
	if(logfile)
	{
		vfwprintf(logfile, format, args);
		fflush(logfile);
	}
	va_end(args);
}
Ejemplo n.º 29
0
void mc_abort(const wchar_t *msg, ...)
{
  va_list ap;
  va_start(ap, msg);
#if HAVE_VSYSLOG
  if(_syslog) {
	  vsyslog(LOG_ERR, msg, ap);
  } else
#endif
	  vwprintf(msg, ap);
  va_end(ap);
  exit(1);
}
Ejemplo n.º 30
0
void error(const dchar *format, ...)
{
    va_list ap;

    va_start(ap, format);
    printf("Error: ");
    vwprintf(format, ap);
    va_end( ap );
    printf("\n");
    fflush(stdout);

    exit(EXIT_FAILURE);
}