Hi guys. Im a noob programmer trying to make a trainer. This is just for hobby. I been using borland c++ builder. I made my dialog and button. I need the button to when pressed access a process and change the value of 5 offsets. I have the offsets and the values they need to be changed to. As well as the process id for the program. I been looking all over on how to insert this into borland and what command line to use. This is what I have so far. I just started looking at vb two days ago and got that fast :p and c++ today but c++ is much harder. Any help is appreciated. My MSN is (email snipped) and AIM: Sars3D

//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
        TButton *Button1;
private: // User declarations
public:  // User declarations
        __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif

Dani AI

Generated

Short answer for : from a Borland C++ Builder VCL button you must call the Win32 APIs — OpenProcess, (optionally) ReadProcessMemory to follow pointer chains, WriteProcessMemory to change bytes, then CloseHandle. The usual flow is: open the target PID with PROCESS_VM_OPERATION | PROCESS_VM_WRITE (and PROCESS_VM_READ if you need to dereference pointers), compute the target address (module base + offsets or a resolved pointer chain), write the value, and close the handle. Run your trainer with the same bitness as the target process and with appropriate privileges (elevated if the target is elevated). Be aware of anti-cheat/ToS issues when working with games.

A minimal example (put this inside your Button->OnClick handler after including <windows.h>):

#include <windows.h>

void PatchValue(DWORD pid, uintptr_t address, DWORD newValue)
{
    HANDLE h = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_WRITE, FALSE, pid);
    if (!h) return;
    SIZE_T written = 0;
    WriteProcessMemory(h, (LPVOID)address, &newValue, sizeof(newValue), &written);
    CloseHandle(h);
}

To follow a pointer chain: start at the module base + first offset, ReadProcessMemory that address to get the next pointer, add the next offset, repeat until you reach the final address, then call WriteProcessMemory. Always check return values and use GetLastError when a call fails.

For : yes — make sure you have a VCL project and put your code in the button OnClick (double-click the button in the Form Designer to create the handler). For : "Stack overflow" is almost certainly from huge local allocations and uninitialized variables (for example a three‑dimensional String array declared locally will blow the stack). Also fix logic bugs like incorrect if condition syntax, wrong loop headers, and accidental use of == where you meant =. Use smaller data structures, heap allocation (std::vector or new), initialize counters, and step through with the debugger. As hinted, post readable, formatted code when asking for help.

Recommended Answers

All 3 Replies

Am I being thick or something?

The concept is so basic that I'm not sure that you have
even got a Borland IDE open! You are using an IDE?

regards

Bob

commented: Yes, you waited 3 years to add nothing worth reading -2
commented: You have done to other threads...if your going to dredge up old threads at least post something meaningful +0

i have some Problem with my program who made from borland C++ builde 6

this is my list program

//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit2.h"
#include "Unit3.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm2 *Form2;
const masukan=100;
//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm2::Button1Click(TObject *Sender)
{
Application->Terminate();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Button2Click(TObject *Sender)
{
Form3->Show();
}
//---------------------------------------------------------------------------




void __fastcall TForm2::Button4Click(TObject *Sender)
{
int loop, loop2, palike, pali, max = 6, atas=0,bawah, awal,panjang,ran=0,indx=0;
String rantai, rantai2[100], palindrome[100][100][100];
int jumlah[100][100];
rantai = AnsiString(Edit1->Text);
        for (loop=0;loop<100;loop++){
            if (rantai[loop]=='a' ||'A'){
                rantai2[loop]= "T";
                panjang++;
            } else if (rantai[loop]=='t' ||'T'){
                rantai2[loop]= 'A';
                panjang++;
            } else if (rantai[loop]=='c' ||'C'){
                rantai2[loop]= 'G';
                panjang++;
            } else if (rantai[loop]=='g' ||'G'){
                rantai2[loop]= 'C';
                panjang++;
            }else break;
        }
        for (loop=0;loop<panjang;loop++){
            awal = loop;
            pali=0;
                bawah=1;
            for (loop2<panjang;loop2=0;loop2--){
                if (rantai[awal] == rantai2[loop2]){
                    palindrome[palike][atas][pali] == rantai[loop];
                    palindrome[palike][bawah][pali] == rantai2[loop2];
                    pali++;
                    awal++;
                                indx=bawah;
                    jumlah[palike][indx]=jumlah[palike][indx]+1;
                } else {
                    if (jumlah[palike][indx] <=1){
                        palike=palike;
                    }else {
                        palike++;
                        bawah++;
                                }
                }
            }
                if (bawah>ran){
                        ran=bawah;
                }else ran = ran;
        }
for(loop=0;loop<=palike;loop++){
        for(loop2=0;loop2<ran;loop++){
                Memo1->Lines->Add(AnsiString(rantai[loop][ran]));
        }
}}
//---------------------------------------------------------------------------

error "Stack overflow"....
what happen with my program?
is anyone can help me??

Put your code in the code tag first.At least make it readable.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.