Exetools  

Go Back   Exetools > General > Source Code

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 10-03-2016, 13:27
ontryit ontryit is offline
Friend
 
Join Date: Nov 2011
Posts: 172
Rept. Given: 127
Rept. Rcvd 17 Times in 14 Posts
Thanks Given: 439
Thanks Rcvd at 70 Times in 43 Posts
ontryit Reputation: 17
Question

Quote:
Originally Posted by Insid3Code View Post
Inaccessible folder inspired from "WinMend Folder Hidden" work.

PHP Code:
#include <windows.h>
#include <ntdll.h>

#ifdef _WIN64
char *captionMsg "64-bit Application";
#else
char *captionMsg "32-bit Application";
#endif

char *statusMsg "FAILED!";

#define MAIN_FOLDER L"\\??\\C:\\Winmend~Folder~Hidden"

wchar_t *folders[] = {
    
MAIN_FOLDER,
    
MAIN_FOLDER L"\\..." ,
    
MAIN_FOLDER L"\\...\\cn"
};

void Report(NTSTATUS NtStatuschar *msgwchar_t *path) {
    
char buffer[256] = {0};

    if (
NtStatus == 0)
        
statusMsg "SUCCESS";

    
sprintf(buffer,
            
"Task:\t%s\nPath:\t%S\nStatus:\t0x%X (%s)",
            
msg,
            
path,
            
NtStatus,
            
statusMsg);

    if (
NtStatus == 0)
        
MessageBoxA(NULL,
                    
buffer,
                    
captionMsg,
                    
MB_ICONINFORMATION);
    else
        
MessageBoxA(NULL,
                    
buffer,
                    
captionMsg,
                    
MB_ICONERROR);
}

int main() {

    
NTSTATUS NtStatus;
    
HANDLE hTarget;
    
UNICODE_STRING ObjectName;
    
OBJECT_ATTRIBUTES ObjectAttributes;
    
IO_STATUS_BLOCK IoStatusBlock;

    for (
int x 03x++) {
        
RtlInitUnicodeString(&ObjectNamefolders[x]);
        
InitializeObjectAttributes(&ObjectAttributes,
                                   &
ObjectName,
                                   
OBJ_CASE_INSENSITIVE,
                                   
NULL,
                                   
NULL);

        
NtStatus NtCreateFile(&hTarget,
                                
FILE_READ_DATA FILE_WRITE_DATA,
                                &
ObjectAttributes,
                                &
IoStatusBlock,
                                
NULL,
                                
FILE_ATTRIBUTE_HIDDEN,
                                
FILE_SHARE_READ FILE_SHARE_WRITE,
                                
FILE_CREATE,
                                
FILE_DIRECTORY_FILE,
                                
NULL,
                                
0);

        
Report(NtStatus"Creating folder..."folders[x]);
        
NtClose(hTarget);
    }

    for (
int x 2>= 0x--) {
        
RtlInitUnicodeString(&ObjectNamefolders[x]);

        
InitializeObjectAttributes(&ObjectAttributes,
                                   &
ObjectName,
                                   
OBJ_CASE_INSENSITIVE,
                                   
NULL,
                                   
NULL);

        
NtStatus NtDeleteFile(&ObjectAttributes);
        
Report(NtStatus"Deleting folder..."folders[x]);
    }

    return 
0;

Binary and source attached.
Bro, can you translate the code in Delphi language?
Also create mirror outside, i can't download from the attachment.
THx

//ontryit
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 On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Track Folder Changes TheDutchJewel General Discussion 0 02-11-2017 02:44
folder security settings... MrCape General Discussion 5 08-23-2002 14:29


All times are GMT +8. The time now is 23:05.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )