Madshi codehook: Double variables on createprocessex = overload

Posted on 2004-11-18
Last Modified: 2010-04-04

I have tried to createprocessex then inject dll. but delphi keeps telling me that there is no overloaded version of createprocessex.

this is the code i have atm that gives me the error 'overloaded':

 ZeroMemory(@si, sizeOf(si));
  CreateProcessex(nil,VARIABLE1, nil, nil, false, 0, nil,nil, si, pi,  VARIABLE2);

to fix the overloaded problem i have to REMOVE one variable as following:

 ZeroMemory(@si, sizeOf(si));
  CreateProcessex(nil,'C:\windows\notepad.exe', nil, nil, false, 0, nil,nil, si, pi,  VARIABLE2);

but still I want to have two variables inside it.
So any here who can help me??
thank you
Question by:Zabuza-san
    1 Comment
    LVL 14

    Accepted Solution

    Is variable1 of type PChar?

    madshi's CreateProcessEx is declared as follows:

    function CreateProcessEx (applicationName, commandLine : pchar;
                              processAttr, threadAttr      : PSecurityAttributes;
                              inheritHandles               : bool;
                              creationFlags                : dword;
                              environment                  : pointer;
                              currentDirectory             : pchar;
                              const startupInfo            : TStartupInfo;
                              var processInfo              : TProcessInformation;
                              loadLibrary                  : string             ) : boolean;

    So VARIABLE1 must be a PChar, not a String, unless you typecast it:

    ZeroMemory(@si, sizeOf(si));
      CreateProcessex(nil, PChar(VARIABLE1), nil, nil, false, 0, nil,nil, si, pi,  VARIABLE2);

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
    Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now