flat assembler
Message board for the users of flat assembler.
Index
> Projects and Ideas > linux data recovery program....need help |
Author |
|
vid 06 May 2007, 20:17
all you need should be in ext2 driver in linux sources
|
|||
06 May 2007, 20:17 |
|
arafel 07 May 2007, 20:09
|
|||
07 May 2007, 20:09 |
|
theoldnyx 09 May 2007, 17:00
well guys i got most of the parts but only one piece is missing i got the block number of the deleted file so what i want to do is to write an asm code to seek to this block copy the data to another destination after searching i was n't able to find how to do so through assembly i got only one book called IMB PC assembly language and programming the code and interrupts are in this book but it was written for windows so any one know how to do it in assembly
|
|||
09 May 2007, 17:00 |
|
Dex4u 09 May 2007, 19:13
One thing i am not sure about, from reading your topic, is will your data recovery be run from a linux distro or are you coding on bear metal ( eg: no OS ) ?.
If its on top of linux try this: If it with no OS let me know and i will give example. Last edited by Dex4u on 10 May 2007, 17:20; edited 1 time in total |
|||
09 May 2007, 19:13 |
|
theoldnyx 09 May 2007, 21:05
yes it's on top of linux and thanks for the system calls but i still unable to understand how to use sys_lseek or read i mean those are for files how can i use it for the hdd to read certain block?
thanks |
|||
09 May 2007, 21:05 |
|
Dex4u 10 May 2007, 19:19
First i have deleted that link because it seems, to have been spammed .
The way i would get info would be too, take a look at "system.inc" in the fasm source code for linux, there examples of all you need, in there. Here is a simple example of how i would do it, (note: not tested) of Move the file-pointer to the end of the file, with lseek. Code: ; Some setup code goes here. mov eax,5 ; eax = function 5 (open a file) mov ebx,fil ; ebx = pointer to the file to open mov ecx,2 ; opening flags (0=r/o 1=w/o 2=r/w) int 80h ; call linux test eax,eax js FileError mov dword[handle],eax mov ebx,[handle] ; file handle mov ecx,ecx ; zero ecx xor edx,edx ; zero edx mov dl,2 ; seek to end call lseek ; call function mov dword[FileSize],eax ; Save file size ; Some more code would go here.;******************************************************; lseek ;****************************************************** lseek: mov eax,19 ; function number (19 lseek) int 0x80 ; call linux retFileError: mov eax,1 xor ebx,ebx int 80h fil db "test.txt",0handle dd 0FileSize dd 0 Please not, i normal do not code in linux, but if i did i would code it like the above, i do use linux . [EDIT] I just reread you ? and this may help: http://www.linux.com/howtos/SCSI-2.4-HOWTO/rawdev.shtml |
|||
10 May 2007, 19:19 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.