View Single Post
Old 04-24-2005, 10:45   #11 (permalink)
arsh0r
Insane Poster
 
Join Date: May 2002
Age: 39
Posts: 76
Member: 12407
Status: Offline
Thanks Meter: 0
i didn't succed in reading files correctly, but i made an addition to at+cgsn:
Code:
void Binary(const char* str) {
	char buf[128];
	int iFileHandler;
        unsigned int iError;
        unsigned int iFileSize;
	dword addr = strtoul(&str,8);
	char* paddr = (char *)addr;
	word blocks = strtoul(&str,4);
	
	sprintf(buf, "0:\\%08X.bin\0", addr);
	// create file if it does not exist:
	iFileHandler = fopen(buf, A_Create, P_WRITE, &iError);	
	fclose(iFileHandler, &iError);
	
	iFileHandler = fopen(buf, A_WriteOnly, P_WRITE, &iError);	
	if (iFileHandler != -1) {
		while (blocks != 0) {		
			// search the end of the file
			iFileSize = lseek(iFileHandler, 0, S_END, &iError);
			// add an line
			fwrite(iFileHandler, paddr, 0x400, &iError);		
			paddr += 0x400;
			blocks--;
		}
	}
	// close the file
	fclose(iFileHandler, &iError);
	
	sprintf(buf, "%08X.bin saved\r\n", addr);
	SendATAnswerStr(buf);
	return;
}
it can dump n x 0x400 bytes from ram. when i dump 0x400 * 0x400 bytes = 1MB, phone freezes for about 10 seconds. the maximum size that can be written by one fkb.write is 0xF00 = 60 any idea to make this faster and not freezing the phone? by the way how large is the RAM?
  Reply With Quote
 
Page generated in 0.07318 seconds with 8 queries