simple code view by Cheat Engine, but nothing found - cheat-engine

I want to find integer value code_injct on cheat engine and modify this value 43369 or else
here is my code
#include <stdio.h>
#include <Windows.h>
int main() {
int code_injct = 43971;
while (1){
printf("%d\n", code_injct);
Sleep(5000);
}
}
and I try run Cheat Engine, attach process Project1.exe, scan 43971.
But there is nothing found. What I missed?

Please, test with the newest version of Cheat Engine 6.8.3
When testing with newest version, please test with the .exe in the Visual Studio output folder, don't run the .exe from Visual Studio.
Make sure you're using VEH debugger, go to CE options -> Debugger Options -> Use VEH Debugger
If it's still not working, when selecting which window you want to inject, attach the debugger to the current process.
If none of this things are working, could you please update your question with your CE settings?

You're attached to the wrong process. You need to attach to the actual executable file, not the VS debug console.

Related

How to print in a Windows Universal C++ project

I feel so dumb asking this question but honestly I can't understand why System namespace can't be used! What am I doing wrong? Is there any other way to print a single line in the output?
(I am using Visual Studio 2015)
I can't understand why System namespace can't be used
Windows Universal app is totally different with traditional desktop app, please check Windows Runtime APIs and Win32 and COM API which lists all Win32 and COM APIs supported for use in UWP apps.
Is there any other way to print a single line in the output? (I am using Visual Studio 2015)
If you need to print message to Output window, use OutputDebugString function in UWP C++/CX project, adding #include to access it, for example:
void CPPUWPApp1::MainPage::LogMessage(Object^ parameter)
{
auto paraString = parameter->ToString();
auto formattedText = std::wstring(paraString->Data()).append(L"\r\n");
OutputDebugString(formattedText.c_str());
}
Usage:
LogMessage("Hello World!");
You could do this directly:
OutputDebugString(L"Hello World");
Notice the L in front of the string, to convert it directly to LPCWSTR.

Setting VIPS library for visual studio 2012

I am trying libvips for visual studio 2012, starting with a simple example at
http://www.vips.ecs.soton.ac.uk/supported/current/doc/html/vipsmanual/vipsmanualse1.html#x6-60001.1.1
#include <iostream>
#include <vips/vips>
int
main (int argc, char ⋆⋆argv)
{
if (argc != 3)
{
std::cerr << "usage: " << argv[0] << " infile outfile\n";
return (1);
}
try
{
vips::VImage fred (argv[1]);
fred.invert ().write (argv[2]);
}
catch (vips::VError e)
{
e.perror (argv[0]);
}
return (0);
}
What I did was:
Download and extract libvips at http://www.vips.ecs.soton.ac.uk/supported/7.34/win32/
Add to VC++ Directories->Include directories as vips-dev-7.34.1\include (vips-dev-7.34.1 is the extracted folder)
Add to VC++ Directories->Library directories as vips-dev-7.34.1\lib
Add a system path entry as vips-dev-7.34.1\bin
Basically because there are not much guide on using libvips with visual studio, so I applied the procedure that I used for OpenCV. The guide only say "All you need to do is include . This will get all of the include you need". Aparrently there are much more than that.
Upon building, the first error is "Unable to find header file "glib-object.h". Essentially, vips/vips call glib-objects "include which lies inside a subfolder of include \include\glib-2.0\glib-objects.h. I searched for a way to make VS search for all subfolders within the main include folder, it seems that such "recursive search" is not possible in VS. One has to point exactly to the folder containing header file and I may need to add all of the subfolders manually. So I tried adding vips-dev-7.34.1\include\glib-2.0 to VC++ Directories->Include directories. But then glib-objects.h calls for another glibconfig.h which is nowhere to be found within the include folder and subfolders.
Have someone sucessfully make libvips work with VS? Can you give me some advices if I miss something.
I'm the libvips maintainer. Sorry, it's very difficult to use the pre-built libvips binaries with VS, for various reasons (see below). I think your options are to use mingw instead, to cross-compile from linux (this is what I do), or to rebuild libvips yourself from source using VS (perhaps a week's work for an experienced dev?). There are some notes on the vips website about this issue.
The libvips.dll on the website has been cross-compiled from linux using mingw. It's set up for a linux-style build system with pkg-config, so you will have a lot of compiler flags to figure out in VS, and it's built against msvcrt.dll, the Windows C runtime, rather than msvcrtXX.dll, the VS runtime, so you will have endless annoying compatibility problems unless you also build against the Windows runtime.
Unfortunately VS no longer supports building against the Windows runtime. They have an internal tool which does support this mode, but it's not publicly available. I read somewhere you can coax the DDK compiler into doing this, but it's also not supported.
CoApp is an interesting project (partly supported by Microsoft) that is attempting to make building software on Windows less painful, but it's still in beta. You could maybe ask if they have a libvips packaged up for VS, or are considering making one.

Inquiry: Integrating libsndfile with Visual Studio 2010 C++. Error: libsndfile.dll not found

I am teaching myself how to read in wav files into C++ as a part of me learning C++. I have found many resources online that recommended the following library: libsnfile library
So I followed some tutorials below in testing the basic functionality of the library, but I can't get the library to compile with Visual Studio 2010.
I have searched online for the following error, but did not find anything useful for my particular error. I downloaded the libsndfile C++ windows installer found here. I used the 32bit version since I am using the win32 C++ console version. However, my Visual Studio is 64 bit. I did the following after I downloaded the installer:
I went into Visual Studio. Under my project, I did the following:
In project properties:
1. VC++
Include >> added ...\libsnfile\include
Library >> added ...\libsnfile\lib
2. C\C++
Added the following directory as additional dependencies
...\libsnfile\lib\libsndfile-1.lib
I did this to add this third party library to my project. After this, to test, I ran the following code:
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <sndfile.h>
int _tmain(int argc, _TCHAR* argv[])
{
printf("This is a test\n");
getchar();
return 0;
}
I coded that to make sure that I could access the sndfile.h in my program and everything compiled. The problem occured when I tried to implement the following code:
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <sndfile.h>
int _tmain(int argc, _TCHAR* argv[])
{
printf("This is a test\n");
//This will be the length of the buffer used to hold samples while the program processes them.
//A SNDFILE is like FILE in a standard C library. Consequently, the sf_open_read and sf_open_write functions will return an
//SNDFILE* pointer when they successfully open the specified file.
SNDFILE* sf = NULL;
/*SF_INFO will obtain information of the file we wish to load into our program. */
SF_INFO info;
/*This is where the program will open the WAV file */
info.format = 0;
sf = sf_open("C:\Users\GeekyOmega\Desktop\gameon.wav", SFM_READ, &info);
if(sf == NULL)
{
printf("Failed to open the file.\n");
exit(-1);
}
getchar();
return 0;
}
I then get a system error when I click run inside visual studio when I try to run my program. It says,
The program can't start because libsnfile-1.dll is missing from your computer.
Try reinstalling the program to fix this problem.`
I tried the 64 bit windows installer and tried that, but it didn't work. Anyone understand what I am doing run? I am running Visual Studio's 2010 on Windows 7 as my dev environment.
I apologize if I am making a silly mistake, but I would deeply appreciate if anyone could help me. I tried a few hacky fixes, as I talked about above, but nothing has worked.
EDIT: I am also aware of this thread here, but this doesn't make any sense to my current issue as I am not doing any of this path stuff that they are talking about.
Warm Regards,
GeekyOmega
I fixed the issue. For future readers, this is a very common problem, I think. I placed the .dll in the debug folder of my Visual Studio project. Visual Studio couldn't see the .dll file otherwise. After this, the program fired up as expected and ran. If this does not fix the issue for you, then I suggest something else could be going on.

Getting Vim to syntax-check boost libraries

I am a fairly novice programmer who recently started using boost. After successfully linking the libraries with cmake, I have noticed that my vim (syntastic plugin I think) which does a great job at highlighting syntax errors. But ever since i started including boost libraries, it just stops at the #include statement with (no such file / directory ) and fails to show up any syntax errors whatsoever in the rest of the file. I have search all over the place but I am unable to find a workaround which allows me to syntax check bad code prior to the compilation stage. any help will be appreciated.
I am unable to post screenshots (too low rating) but will post code for whatever it is worth
#include <iostream>
#include <boost/regex.hpp> <--------------syntax error (though it compiles fine)
#include <algorithm>
using namespace std;
void testMatch(const boost::regex& ex,const string st){
cout<<"Matching" <<st <<endl;
if(boost::regex_match(ex,st)){
cout<<"matches"<<endl
}
else cout<<"oops"; }
void testSearch(const boost::regex& ex, const string st){
cout<<"Searching"<<endl;
}
If you are using the Syntastic plugin, take a look at the file in
syntastic/syntax_checkers/cpp.vim
there are lots of language specific options that can be set, I think the one you'll want is
let g:syntastic_cpp_include_dirs=['path/to/boost/files']
this lets the sytax checker know that there are other places to look for included files besides the default ones.

can't get my code to run from a programming book(c++)

i got a new programing book (multicore programming by cameron hughes, tracey hughes).
so far i have not got one of their programs to work their book says that it should work on 99% of computers so im a little confused but at the end of each program in their book they have "compile and link instructions"... do i need to enter that? it looks something like this "C++ -o guess_it guess_it.cc". the code im runnning right now is:
#include <iostream>
#include <windows.h>
#include <string>
#include <spawn.h>
#include <sys/wait.h>
using namespace std;
int main(int argc,char *argv[],char *envp[])
{
pid_t ChildProcess;
pid_t ChildProcess2;
int RetCode1;
int RetCode2;
int Value;
RetCode1 = posix_spawn(&ChildProcess,"find_code",NULL,
NULL,argv,envp);
RetCode2 = posix_spawn(&ChildProcess2,"find_code",NULL,
NULL,argv,envp);
wait(&Value);
wait(&Value);
return(0);
}
im running windows 7(32-bit), AMD athion x2 7550 dual-core proessor, VC++ 2008 Express edition.
i get the following error : fatal error C1083: Cannot open include file: 'spawn.h': No such file or directory
anyone know why i can't get my code to run? do i need to download something? because i read the book and did not see anything about downloading anything but i might be wrong. :(
It looks like that book is using POSIX threading. Visual Studio uses Windows Threading by default, which has a completely different API.
You most likely just need to get a copy of a POSIX Thread library for Windows. That will include spawn.h and the appropriate lib files for you to use.
Forgive me if I'm misreading your level of experience here, but it sounds as though you are a complete beginner with this language.
The example compilation and link instruction in the book
C++ -o guess_it guess_it.cc
is an example of how to invoke a compiler and linker from the command line. If you're using Visaul C++ then the IDE will automate the compilation and link process for you when you click the "build" button, so you don't need to worry about doing this from the command line.
On to the error you're seeing in VC++:
The compiler is telling you that it can't find the header file spawn.h, which you've told it that your program needs in the line
#include <spawn.h>
As other on this page have mentioned, spawn.h is a file supplied by the POSIX standard libraries and contains functionality for spawning new processes.
Respectfully, it sounds to me from the way you asked your question ("compile and link instructions") as though you don't really understand what you're doing. Before you delve into multi-threading in C++, I recommend taking a step back and find a beginner's book on C++ using Visual Studio, and start from the beginning. I'm afraid you'll make very little progress unless you take the time to learn the fundamentals, and using the compiler is about as fundamental as it gets!
Good luck!

Resources