#Solved thanks to helps :)
Somethings example: a += 1;Quote:
Just a question, why not #include <thread> and #include <thread> and then use std::thread and std::this_thread::sleep_for or std::this_thread::sleep_until with std::chrono::seconds (1)?
I cannot reproduce that behavior. The reason is somewhere else. Maybe in //Somethings?
Quote:
Show your whole code.
#include <windows.h>
#include <tlhelp32.h>
#include <shlwapi.h>
#include <tchar.h>
#include <conio.h>
#include <stdio.h>
#include <Windows.h>
#include <stdio.h>
#include <cstdlib>
#include <iostream>
#include <time.h>
#include <tlhelp32.h>
#include <string>
#include <string.h>
#include <iostream>
#include <windows.h>
#include <stdlib.h>
#include <cstdlib>
#include <string>
#include <Shellapi.h>
#include <windows.h>
#include <string.h>
#include <string>
#include <time.h>
#include <iostream>
#include <iostream>
using namespace std;
#include <fstream>
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
#include <windows.h>
#include <tlhelp32.h>
#include <sys/stat.h>
#pragma comment (lib, "user32.lib")
int val = 0;
void mythread(){
while(1){
val += 1;
If(val = 10000){
exit(0);
}
Sleep(1000);
}
}
void mythread2(){
while(1){
int val;
ReadProcessMemory(GetCurrentProcess(),(LPVOID)0x513612,&val,sizeof(val),NULL);
If(val > 500){
exit(0);
}
Sleep(50);
}
}
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)mythread2, NULL, NULL, NULL);
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)mythread, NULL, NULL, NULL);
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
Thx padmak.Quote:
That's possibly the worst code i've seen in a while. That doesn't even compile, I don't know what you are trying to achieve with this code..
Shouldn't you learn the basics first?
Padmak