Jump to content

Alternate Of Autoit Code in C++


Sabeeh
 Share

Recommended Posts

Please tell me the alternative of these three commands in c++
my compiler visual studio c++ 2012
; Allocate enough space (in our space) for the new module
Local $tModule = DllStructCreate("byte[" & $iOptionalHeaderSizeOfImageNEW & "]")

; Get pointer
Local $pModule = DllStructGetPtr($tModule)

; Headers
Local $tHeaders = DllStructCreate("byte[" & $iOptionalHeaderSizeOfHeadersNEW & "]", $pHEADERS_NEW)
Edited by Sabeeh
Link to comment
Share on other sites

What About This?

is It Ok?

typedef unsigned char BYTE;
BYTE* tModule=new BYTE[optionalHeaderSizeOfImage];

//Get pointer
LPVOID pModule = &tModule;

BYTE* tHeader = new BYTE[optionalHeaderSizeOfHeaders];

memcpy(&tHeader,&pHEADERS_NEW,sizeof(tHeader));
//Write headers to $tModule

memcpy(&tModule,&tHeader,sizeof(tModule));
Edited by Sabeeh
Link to comment
Share on other sites

He wants to be spoonfed.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

auto $pModule = new BYTE[$iOptionalHeaderSizeOfImageNEW];
auto $pHeaders = reinterpret_cast<BYTE*>($pHEADERS_NEW);
 

That is not C++ code.

What makes you say that?

EDIT:

edited since poster deleted post.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

oops sorry for that

i'm android developer not c++ developer i did c++ programming for one year about 2 years before now i started it again thats why i'm not too good in c++

and thanks trancexx for your RunBinary.au3 script and for your reponse

Edited by Sabeeh
Link to comment
Share on other sites

Trancexx please read my code carefully

auto $pModule = new BYTE[$iOptionalHeaderSizeOfImageNEW];

this should be

auto $tModule = new BYTE[$iOptionalHeaderSizeOfImageNEW];

and what about this?

; Get pointer
Local $pModule = DllStructGetPtr($tModule)

Please make it clear.

Edited by Sabeeh
Link to comment
Share on other sites

Trancexx please read my code carefully

auto $pModule = new BYTE[$iOptionalHeaderSizeOfImageNEW];

this should be

auto $tModule = new BYTE[$iOptionalHeaderSizeOfImageNEW];

and what about this?

; Get pointer
Local $pModule = DllStructGetPtr($tModule)

Please make it clear.

C++ is obviously not AutoIt.

Depending on what needs to be done it can be written:

int $some_size = 100;
auto $tStruct = new BYTE[$some_size]; // DllStructCreate("byte[" & some_size & "]")
auto $pStruct = &$tStruct; // DllStructGetPtr($tStruct)

$tStruct[23] = 37; // DllStructSetData($tStruct, 23, 37)

auto $twenty_third_element = $tStruct[23]; // DllStructGetData($tStruct, 23)

... but it also doesn't have to.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

trancexx i know that autoit is not c++.

but if i'm right then i think we can do every thing in c++ that we can do in autoit?

i just asked you for alternate code of autoit in C++ sorry but you are confusing me or you misunderstand my question

thanks for your response now look what i'm asking

 

i do that how you did now its ok

//Local $tModule = DllStructCreate("byte[" & $iOptionalHeaderSizeOfImageNEW & "]")
auto $tModule =new BYTE[$iOptionalHeaderSizeOfImageNEW ];

//Local $pModule = DllStructGetPtr($tModule)
auto $pModule = &$tModule;
but please tell me what about this how i can do this in c++
  1. $pHEADERS_NEW is pointer from your Runbinary.au3 file

    Local $tHeaders = DllStructCreate("byte[" & $iOptionalHeaderSizeOfHeadersNEW & "]", $pHEADERS_NEW)

trancexx one more thing please can you add me on fb? please please

my fb username: sabeeh.suh

Edited by Sabeeh
Link to comment
Share on other sites

trancexx i know that autoit is not c++.

but if i'm right then i think we can do every thing in c++ that we can do in autoit?

i just asked you for alternate code of autoit in C++ sorry but you are confusing me or you misunderstand my question

 

thanks for your response now look what i'm asking

 

i do that how you did now its ok

//Local $tModule = DllStructCreate("byte[" & $iOptionalHeaderSizeOfImageNEW & "]")
auto $tModule =new BYTE[$iOptionalHeaderSizeOfImageNEW ];

//Local $pModule = DllStructGetPtr($tModule)
auto $pModule = &$tModule;
but please tell me what about this how i can do this in c++
  • $pHEADERS_NEW is pointer from your Runbinary.au3 file

    Local $tHeaders = DllStructCreate("byte[" & $iOptionalHeaderSizeOfHeadersNEW & "]", $pHEADERS_NEW)
trancexx one more thing please can you add me on fb? please please

my fb username: sabeeh.suh

C++ is light years away from AutoIt.

Btw, I already showed you how to do that thing with $pHEADERS_NEW, here's $t version:

auto $tHeaders = reinterpret_cast<BYTE*>($pHEADERS_NEW);
Facebook is reserved for my friends.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

auto $tHeaders = reinterpret_cast<BYTE*>($pHEADERS_NEW);

trancexx sorry again for you asking you but i need to know one more thing your code work well for variables not working for structs

now what can i do for that

Local $tIMAGE_DOS_HEADER = DllStructCreate("char Magic[2];" & _
"word BytesOnLastPage;" & _
"word Pages;" & _
"word Relocations;" & _
"word SizeofHeader;" & _
"word MinimumExtra;" & _
"word MaximumExtra;" & _
"word SS;" & _
"word SP;" & _
"word Checksum;" & _
"word IP;" & _
"word CS;" & _
"word Relocation;" & _
"word Overlay;" & _
"char Reserved[8];" & _
"word OEMIdentifier;" & _
"word OEMInformation;" & _
"char Reserved2[20];" & _
"dword AddressOfNewExeHeader", _
$pPointer)

this is not working

Syntax Error:
IMAGE_DOS_HEADER $imageDosHeader;
$imageDosHeader= reinterpret_cast<IMAGE_DOS_HEADER>($pPointer);

Any idea about that

Edited by Sabeeh
Link to comment
Share on other sites

trancexx, <snip> you are great thanks

i already told you that i'm not c++ developer i'm android developer

 

 

if struc pointer t then its like Polymorphism

auto whatever = reinterpret_cast<IMAGE_DOS_HEADER*>($pPointer);
then i can't use . operator to access members its ok i will use –> operator to dereference the pointer

whaterver->member;
thanks again for help

i converted all of your RunBinary.au3 Code in c++ but some part of code still need some changing

Edited by Melba23
Removed full name
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...