Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 11:16

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[REQ] Wert mit .ini bestimmen.

Discussion on [REQ] Wert mit .ini bestimmen. within the C/C++ forum part of the Coders Den category.

Closed Thread
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2012
Posts: 4
Received Thanks: 0
[REQ] Wert mit .ini bestimmen.

Hallo ich möchte einen wert in einer .asi mit einer .ini bestimmen.
Da ich aber keinerlei Kenntnisse in c++ habe kann ich das selbst nicht machen.

Ich möchte den wert *fDistance = 1500.0; (Wenn es an ist)
und den wert *fDistance = 50.0; (Wenn es aus ist)

in einer .ini bestimmen können
Ich hoffe das mir das jemand machen kann

Danke im voraus.

Code:
#include <windows.h>

#define SAMP_INFO  0x212A38
#define SAMP_SETTINGS  0x3CF

//DWORD* pChat = NULL;
DWORD* pInfo = NULL;
BYTE* ThroughWalls = NULL;
BYTE* ShowNameTags = NULL;
float* fDistance = NULL;
//---------------------------------------------------------------------------
bool KeyPressed(BYTE key)
{
	return ((GetAsyncKeyState(key)&(1<<16))!=0);
}
//---------------------------------------------------------------------------

void Thread()
{
  DWORD SampDLL = (DWORD)GetModuleHandleA("samp.dll");
  if(SampDLL){
  pInfo = (DWORD*)(SampDLL+SAMP_INFO);
  while(*pInfo==0) Sleep(1000);
  while(*(DWORD*)(*pInfo+SAMP_SETTINGS)==0) Sleep(1000);
  ShowNameTags = (BYTE*)(*(DWORD*)(*pInfo+SAMP_SETTINGS)+0xE);        
  ThroughWalls = (BYTE*)(*(DWORD*)(*pInfo+SAMP_SETTINGS)+0x5);         
  fDistance = (float*)((DWORD*)(*(DWORD*)(*pInfo+SAMP_SETTINGS)+0x2F));  
  Sleep(14000);
  DWORD OldProt;
  VirtualProtect((LPVOID)ShowNameTags,0x100,PAGE_EXECUTE_READWRITE,&OldProt);
  VirtualProtect((LPVOID)ThroughWalls,0x100,PAGE_EXECUTE_READWRITE,&OldProt);
  VirtualProtect((LPVOID)fDistance,0x100,PAGE_EXECUTE_READWRITE,&OldProt);
  VirtualProtect((LPVOID)SampDLL,0x3071B0, PAGE_EXECUTE_READWRITE, &OldProt);
   for(;;)
   {
   do{
	   Sleep(100);
   }while(!KeyPressed(VK_MENU) || !KeyPressed(VK_F3));
   do{
	   Sleep(50);
   }while(KeyPressed(VK_F3));
   *ShowNameTags = 1;
   *ThroughWalls = 0;
   *fDistance = 1500.0;
   do{
	   Sleep(100);
   }while(!KeyPressed(VK_MENU) || !KeyPressed(VK_F3));
   do{
	   Sleep(50);
   }while(KeyPressed(VK_F3));
   *ShowNameTags = 1;
   *ThroughWalls = 1;
   *fDistance = 50.0;
   }
  }
 }

//-------------------------------------------------------------------------------
int WINAPI DllMain(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
	if(reason==DLL_PROCESS_ATTACH)
	{
		 DWORD OldProt;
		 VirtualProtect((LPVOID)0x401000, 0x4A3000, PAGE_EXECUTE_READWRITE, &OldProt);
		 CreateThread(0, 0, (LPTHREAD_START_ROUTINE)Thread, 0, 0, 0);
	}
	return 1;
}
[Monstercat] is offline  
Old 10/23/2013, 22:23   #2
 
​Tension's Avatar
 
elite*gold: 110
Join Date: Jun 2013
Posts: 599
Received Thanks: 510
Also eine Ini-Datei auslesen kannst du mit
Code:
UINT WINAPI GetPrivateProfileInt(
  _In_  LPCTSTR lpAppName,
  _In_  LPCTSTR lpKeyName,
  _In_  INT nDefault,
  _In_  LPCTSTR lpFileName
);
Könntest du so anwenden:

Code:
fDistanceOn = GetPrivateProfileInt("fDistance","On",0,"FilePath..");
fDistanceOff = GetPrivateProfileInt("fDistance","Off",0,"FilePath..");
die ini müsste dann so aussehen:
Code:
[fDistance]
On=1500
Off=50
​Tension is offline  
Thanks
1 User
Old 10/23/2013, 23:12   #3
 
elite*gold: 0
Join Date: Jul 2012
Posts: 4
Received Thanks: 0
Hey danke für die schnelle Antwort
Aber grade bin ich am verzweifeln -.- ich kann Visual Studio nicht mal mehr starten...
ka why und wens ma nicht abkackt kann ich nix erstellen -.- vllt liegts daran das ich grad kompletten Systemscan mache.. vllt hat auch en virus was Kaput gemacht

Würdest du mir vllt die .asi erstellen ?
Ich wäre dir sehr dankbar
[Monstercat] is offline  
Old 10/23/2013, 23:36   #4



 
+Yazzn's Avatar
 
elite*gold: 420
Join Date: Jan 2012
Posts: 1,082
Received Thanks: 1,000
So in der Art sollte das Funktionieren:

Code:
template <typename T, typename e, typename t, typename a>
T string_to(const std::basic_string<e, t, a> &str)
{
	T result;
	std::basic_stringstream<e, t, a> stream(str);
	stream >> result;
	return result;
}

WCHAR filename[MAX_PATH];
GetModuleFileNameW(module_handle, filename, MAX_PATH);
PathRemoveFileSpecW(filename);
PathAppendW(filename, L"config.ini");
WCHAR buffer[256];
int length = GetPrivateProfileStringW(L"distance", L"on", nullptr, buffer, 256, filename);
float distance_on = string_to<float>(std::wstring(buffer, buffer + length));
length = GetPrivateProfileStringW(L"distance", L"off", nullptr, buffer, 256, filename);
float distance_off = string_to<float>(std::wstring(buffer, buffer + length));
+Yazzn is offline  
Old 10/24/2013, 07:28   #5
 
elite*gold: 5
Join Date: Sep 2006
Posts: 385
Received Thanks: 218

Quote:
Originally Posted by msdn
This function is provided only for compatibility with 16-bit Windows-based applications. Applications should store initialization information in the registry.

Man sollte meinen gut 20 Jahre nachdem sie als deprecated erklärt worden sind, sind .ini Dateien ausgestorben. Wie man sich irren kann.

Edit:
@Yazzn:
Nutzt der TE nicht pures C? Da gibt es solche tollen Sachen wie templates und stringstreams nicht.
Nightblizard is offline  
Old 10/24/2013, 13:54   #6



 
+Yazzn's Avatar
 
elite*gold: 420
Join Date: Jan 2012
Posts: 1,082
Received Thanks: 1,000
Die Registry war wohl auch nicht das, was man sich erhofft hatte.

------------------------------------------------------------------------------------------------

Der OP hat da was von cpp gesprochen, deshalb ging ich einfach mal von aus, dass der OP einen cpp compiler am Start hat.
+Yazzn is offline  
Old 10/24/2013, 19:49   #7


 
MrSm!th's Avatar
 
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,907
Received Thanks: 25,408
@ Nightblizzard
Warum sollte man auch auf kleine, schlanke Textdateien verzichten und auf die überladene Registry setzen? Wenn die API Funktionen irgendwann entfernt werden sollten, gebe ich dir mein Wort, werden halt eigene/andere Ini Parser verwendet.

@Topic
Das ist der Coding und nicht der C&P Bereich.
MrSm!th is offline  
Thanks
1 User
Closed Thread


Similar Threads Similar Threads
Entfernung bestimmen?
11/22/2012 - Infestation - 4 Replies
Guten Abend ^^ Wollt einmal nachfragen ob wer Ahnung hat wie man die Entfernung mit dem Fernglas bestimmen kann (nur für Menschen/Zombies)? :confused: Oder soll die Skala im rechten Bereich nur Deko sein? :D Wäre nice wenn wer ein ESP nutzt dies vielleicht mal auswerten könnte, an Zombies oder so? ^^ Danköö :handsdown:
Acc Wert bestimmen - Hilfe!! :D
09/02/2012 - League of Legends - 12 Replies
Moin moin :D wie der Titel schon sagt wollte ich mal ein wenig Hilfe einfordern .. :D undzwar wollte ich wissen wieviel Ihr für den Acc ausgeben würdet/ wieviel der Acc wert ist :p Daten: Server: EUW Level: 30 Games (Normal): Wins/Lose insgesamt 2600 games! :D
IP Bestimmen?
07/03/2010 - Diablo 2 - 6 Replies
ich suche nach nem tool, mit dem ich die ip selber einstellen kann worauf ich in d2 connecte, gibt es sowas und könnte evtl. jmd nen link geben? ist es safe? mir is das ewige suchen der ip zu lästig geworden und kissclonehunter is auch nich grade der burner, nie krieg ich die ip die ich suche... könnte villt einer mit sowas auskennen :)
Bestimmen Hack?
12/21/2009 - WarRock - 4 Replies
Hallo, sry wenn es falscher bereich ist, finde für Fragen an Hacks kein Therad. Kennt jemand einen Hack, der noch undecet ist und boneshot bz. headshot, telekill inv und antikick hat? telekill würde mir auch reichen. Freue mich auf ne antwort.



All times are GMT +1. The time now is 11:17.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.