Remote Administration Tool Research forumRemote Administration Tool Research forum
  Remote Administration Tool Research forum
Register Social Groups Mark Forums Read

Go Back   Remote Administration Tool Research forum > Programming > Source Code help

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-12-2009, 10:44
Member
 
Join Date: Mar 2009
Posts: 94
DigitalNemesis is on a distinguished road
[c++] Runtime Resource Adding

I'm Trying to make a "builder" for my crypter.

But i have a problem that with hours of googleing msnding i cannot solve...

When i add a resource to my dropped stub the droped file ends up smaller insize (and doesnt work).

(im adding not replacesing as the number of resources im going 2 need is unknow at the time of compiling my stub as i have to split the payload into maybe resources so its not detected.)

The code im using is below.

Code:
BOOL addResource(char* szFileName, LPBYTE lpData, DWORD dwSize, int id)
{
    HANDLE hUpdateRes = BeginUpdateResource(szFileName, FALSE);
    if (hUpdateRes == NULL)
    {
        MessageBox(NULL,"BeginUpdateResource()","ERROR",MB_OK);
        return FALSE;
    }
    BOOL result = UpdateResource(
        hUpdateRes,
        RT_RCDATA,
        MAKEINTRESOURCE(id),
        MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
        (LPVOID)lpData,
        dwSize
    );

    if (!result)
    {
        MessageBox(NULL,"UpdateResource()","ERROR",MB_OK);
        EndUpdateResource(hUpdateRes, TRUE);
        return FALSE;
    }
    if(EndUpdateResource(hUpdateRes, FALSE))
    {
        return TRUE;
    }
    return FALSE;
}
i put it into a method to try and isolate the problem but i with no luck.
Am i doing it wrong? i have tryed to look at sources for builders (only finding cryptic) and could not find a solution...

Thanks in advance, DigitalNemeis
Reply With Quote
  #2 (permalink)  
Old 06-12-2009, 11:23
Junior Member
 
Join Date: May 2009
Posts: 7
Zer0Flag is on a distinguished road
I hope this link will help you a bit :
Code:
http://www.codeproject.com/KB/cpp/UpdateResource.aspx
Greetz Zer0Flag
Reply With Quote
  #3 (permalink)  
Old 06-12-2009, 11:35
Member
 
Join Date: Mar 2009
Posts: 94
DigitalNemesis is on a distinguished road
Quote:
Originally Posted by Zer0Flag View Post
I hope this link will help you a bit :
Code:
http://www.codeproject.com/KB/cpp/UpdateResource.aspx
Greetz Zer0Flag
thanks man, i found that one on google already, but ill double check my stuff on it XD i got the cast to (LPVOID) from that page
Reply With Quote
  #4 (permalink)  
Old 09-12-2009, 12:07
Member
 
Join Date: Mar 2009
Posts: 94
DigitalNemesis is on a distinguished road
still cant get it working can any one help me
I'm guess im doing this part right then... maybe my PE has something wrong with it?? no clue... Im use g++ compiler...
Reply With Quote
  #5 (permalink)  
Old 09-12-2009, 16:03
Junior Member
 
Join Date: May 2009
Posts: 7
Zer0Flag is on a distinguished road
I got some errors when I wanted to use the resource type like you. I just changed it into "RT_RCDATA" ( yes with the "" ) and it worked.


else try this one:
Code:
void addResource(char* szFileName, LPBYTE lpData, DWORD dwSize, int id){
   HANDLE hResource = BeginUpdateResource(szFileName, FALSE);
   if (NULL != hResource){
     if (UpdateResource(hResource, 
        "RT_RCDATA", 
        MAKEINTRESOURCE(id), 
        MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 
        (LPVOID) lpBuffer, 
        dwFileSize) != FALSE)
     {
        EndUpdateResource(hResource, FALSE);
     }
  }
}
Greetz Zer0Flag
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help about adding usb spread on projects kari Trojan discussion and general help 0 09-07-2009 14:37
Adding a stealer in a program? VitaminX Source Code help 1 19-05-2009 23:40
Adding a digit OD_ Delphi help 1 25-08-2006 04:42
Adding parameters to a procedure ratws Delphi help 6 28-09-2005 23:58
Adding VNC capabilities to a RAT ratws Delphi help 7 29-07-2005 16:14


All times are GMT +1. The time now is 18:19.


vBulletin Version is 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.