MAKING ADDY LOGERR!

Posts 1–10 of 10 · Page 1 of 1
MAKING ADDY LOGERR!
Log.cpp


Code:
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include <stdio.h>

#pragma warning ( disable : 4996 )

using namespace std;

ofstream ofile;
char dlldirectory[320];

char *GetDirectoryFile(char *filename)
{
	static char path[320];
	strcpy(path, dlldirectory);
	strcat(path, filename);
	return path;
}

void __cdecl Writelog(const char *fmt, ...)
{
	if (ofile != NULL)
	{
		if (!fmt) { return; }
		va_list va_alist;
		char logbuf[256] = { 0 };
		va_start(va_alist, fmt);
		_vsnprintf(logbuf + strlen(logbuf), sizeof(logbuf)-strlen(logbuf), fmt, va_alist);
		va_end(va_alist);
		ofile << logbuf << endl;
	}
}

void logging(HMODULE hDll){
	DisableThreadLibraryCalls(hDll);
	GetModuleFileName(hDll, dlldirectory, 512);
	for (int i = strlen(dlldirectory); i > 0; i--) { if (dlldirectory[i] == '\\') { dlldirectory[i + 1] = 0; break; } }
	ofile.open(GetDirectoryFile("pongping88.txt"), ios::app);
}


Here's the error

Code:
Error	1	error C2678: binary '!=' : no operator found which takes a left-hand operand of type 'std::ofstream' (or there is no acceptable conversion)	C:\Users\User\documents\visual studio 2013\Projects\Addy Logger\Addy Logger\Log.cpp	24	1	Addy Logger
	2	IntelliSense: no operator "!=" matches these operands
            operand types are: std::ofstream != int	c:\Users\User\Documents\Visual Studio 2013\Projects\Addy Logger\Addy Logger\Log.cpp	24	12	Addy Logger

@CaiozinhoFC1 @RamoXO @dreek1 @Diolegend. @ForeverRush @ComboDance
U are doing it wrong.
If u saw the code on https://www.mpgh.net/forum/showthread.php?t=282401 then u forget to create the headers and the Main.cpp.
And that is just a base u should modify it because Xtrap or XC3 maybe detect it.
Also u will need to learn C++ to be able to modify it.
WARNING: Its JUST a base u shouldn't copy paste.
change :
Code:
if (ofile )
{

}
Quote Originally Posted by ComboDance View Post
change :
Code:
if (ofile )
{

}
What do you mean with this? the code is saying if ofile isnt equal to NULL then:
if (!fmt) { return; }
va_list va_alist;
char logbuf[256] = { 0 };
va_start(va_alist, fmt);
_vsnprintf(logbuf + strlen(logbuf), sizeof(logbuf)-strlen(logbuf), fmt, va_alist);
va_end(va_alist);
ofile << logbuf << endl;
Soo why it is != NULL the error?
Quote Originally Posted by ComboDance View Post
change :
Code:
if (ofile )
{

}

I got thus error please help

Code:
Error	1	error C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.	c:\Users\ANGEL\Desktop\Loggger\Log.cpp	17	1	Logger
         Error	2	error C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.	c:\Users\ANGEL\Desktop\Loggger\Log.cpp	18	1	Logger
In this part ..

Code:
char *GetDirectoryFile(char *filename)
{
	static char path[320];
	strcpy(path, dlldirectory);
	strcat(path, filename);
	return path;
}
Quote Originally Posted by imrflick View Post
I got thus error please help

Code:
Error	1	error C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.	c:\Users\ANGEL\Desktop\Loggger\Log.cpp	17	1	Logger
         Error	2	error C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.	c:\Users\ANGEL\Desktop\Loggger\Log.cpp	18	1	Logger
In this part ..

Code:
char *GetDirectoryFile(char *filename)
{
	static char path[320];
	strcpy(path, dlldirectory);
	strcat(path, filename);
	return path;
}
Search a little before post pls!
https://stackoverflow.com/questions/...default-in-vis

If it helps u give Thanks!
Quote Originally Posted by imrflick View Post
I got thus error please help

Code:
Error	1	error C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.	c:\Users\ANGEL\Desktop\Loggger\Log.cpp	17	1	Logger
         Error	2	error C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.	c:\Users\ANGEL\Desktop\Loggger\Log.cpp	18	1	Logger
In this part ..

Code:
char *GetDirectoryFile(char *filename)
{
	static char path[320];
	strcpy(path, dlldirectory);
	strcat(path, filename);
	return path;
}
add this At the top
Code:
#pragma warning(disable:4996)
this Engr. Ellang cant even search properly dude you literally c & p yet you cant solve those error yourself
replace the last #include <stdio.h> by #include <iostream>
stdio.h is for fopen function and similar it's the C standard IO functions
iostream contains the definitions for C++ standard IO classes such as std::endl
fstream is ok for C++ standard IO classes such as std:fstream;
add using std:fstream; after the includes
add using std::ios; after the includes
add using std::endl; after the includes

Code:
char *GetDirectoryFile(char *filename)
{
	static char path[260];
 	GetFullPathName(filename, 260, path, NULL);
	return path;
}
Also lower the error level in your compiler settings.
Code:
project properties -> C/C++ -> General -> Warning Level
Posts 1–10 of 10 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us