| View previous topic :: View next topic |
| Author |
Message |
PSPfreak!

Joined: 14 Nov 2007 Posts: 34
|
Posted: Wed Nov 14, 2007 11:11 pm Post subject: copy file to Flash0 |
|
|
i was searching around and all i could find was to copy files, may i be pointed in the right direction on how to copy a file from the memorystick to flash because these havent worked for me. when it flashes stuff like .bmp's it doesnt flash :(
| Code: | int fileCopy(char* inSrc, char* inDest) {
SceUID tempSrc = sceIoOpen(inSrc, PSP_O_RDONLY, 0777);
if(!tempSrc)
return -1;
SceUID tempDest = sceIoOpen(inDest, PSP_O_WRONLY | PSP_O_CREAT, 0777);
if(!tempDest) {
sceIoClose(tempSrc);
return -2;
}
char tempData[1024];
int tempRead = sceIoRead(tempSrc, tempData, 1024);
int tempWritten;
while(tempRead > 0) {
tempWritten = sceIoWrite(tempDest, tempData, tempRead);
if(tempWritten != tempRead) {
sceIoClose(tempDest);
sceIoClose(tempSrc);
sceIoRemove(inDest);
return -3;
}
tempRead = sceIoRead(tempSrc, tempData, 1024);
}
sceIoClose(tempDest);
sceIoClose(tempSrc);
return 1;
}
|
| Code: | void CopyExecute(const char* zFileSrc , const char* zFileDest)
{
check(zFileSrc);
if (exist == 1)
{
int fd1,fd2,len;
fd1 = sceIoOpen(zFileSrc, PSP_O_RDONLY, 0);
fd2 = sceIoOpen(zFileDest,PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC, 0777);
if(fd1 < 0)
{
doBlit("Error : some files are missing.");
}
else
{
while(1)
{
len = sceIoRead(fd1, buf, BUFSIZE);
if (len == 0) break;
sceIoWrite(fd2,buf,len);
}
}
sceIoClose(fd1);
sceIoClose(fd2);
}
else
{
printf("Source file does not exist.");
}
}
|
thanks |
|
| Back to top |
|
 |
Cpasjuste
Joined: 29 May 2005 Posts: 214
|
|
| Back to top |
|
 |
.::Albandu51::.
Joined: 04 Oct 2007 Posts: 12
|
Posted: Thu Nov 15, 2007 2:22 am Post subject: |
|
|
Yes its good that someone would find a solution and shows.
Trad by Google xD |
|
| Back to top |
|
 |
PSPfreak!

Joined: 14 Nov 2007 Posts: 34
|
Posted: Thu Nov 15, 2007 5:05 pm Post subject: |
|
|
| sorry, but im actually using the 1.50 kernel (i think) |
|
| Back to top |
|
 |
Pyridoxine
Joined: 28 Jul 2007 Posts: 2
|
Posted: Sat Nov 17, 2007 1:46 am Post subject: |
|
|
Here you go... This is Flashmod it's like the second Flasher to come out... It's open source and the Write Function for it should still work...
http://www.nobis-development.com/flashmod.php |
|
| Back to top |
|
 |
Cpasjuste
Joined: 29 May 2005 Posts: 214
|
Posted: Sat Nov 17, 2007 4:13 am Post subject: |
|
|
| This doesn't sole the 3.71 fw problem :/ |
|
| Back to top |
|
 |
PSPfreak!

Joined: 14 Nov 2007 Posts: 34
|
Posted: Sat Nov 17, 2007 9:25 am Post subject: |
|
|
| Cpasjuste wrote: | | This doesn't sole the 3.71 fw problem :/ |
yea but i really was looking for a 1.50 kernel app, so thanks Pyridoxine, i'll see if it will work |
|
| Back to top |
|
 |
PSPfreak!

Joined: 14 Nov 2007 Posts: 34
|
Posted: Sat Nov 17, 2007 11:10 am Post subject: |
|
|
woohooooo it works thanks mate, umm... would you happen to know anything about were the 1.50 version is in flash becuase i would like to change it with letters in it. every time i try to decrypt something it comes up corrupt and when i try to hex-edit it, i cant find 1.50. grrrr
e.g. i want to change to something like this, just not these letters 1.50 AB, 1.50 CD
im useless ahaha |
|
| Back to top |
|
 |
PSPfreak!

Joined: 14 Nov 2007 Posts: 34
|
Posted: Mon Nov 19, 2007 5:12 pm Post subject: |
|
|
| anybody!!!!! sorry for posting under this though. if i dont get any replies until tomorrow i'll put under a different thread, so sorry anywayz |
|
| Back to top |
|
 |
Pyridoxine
Joined: 28 Jul 2007 Posts: 2
|
Posted: Mon Nov 19, 2007 8:47 pm Post subject: |
|
|
You want to change your version number I'm guessing... That should be in...
flash0:\vsh\etc\version.txt
For 1.50 atleast... Later on they started to encrypt there Version number in:
flash0:\kn\vshctrl.prx |
|
| Back to top |
|
 |
PSPfreak!

Joined: 14 Nov 2007 Posts: 34
|
Posted: Wed Nov 21, 2007 4:01 pm Post subject: |
|
|
| Pyridoxine wrote: | You want to change your version number I'm guessing... That should be in...
flash0:\vsh\etc\version.txt
For 1.50 atleast... Later on they started to encrypt there Version number in:
flash0:\kn\vshctrl.prx |
thx mate i'll give it a try now |
|
| Back to top |
|
 |
PSPfreak!

Joined: 14 Nov 2007 Posts: 34
|
Posted: Thu Nov 22, 2007 5:29 pm Post subject: |
|
|
| Pyridoxine wrote: | You want to change your version number I'm guessing... That should be in...
flash0:\vsh\etc\version.txt
For 1.50 atleast... Later on they started to encrypt there Version number in:
flash0:\kn\vshctrl.prx |
ok it works.........but GRRRR when i try to flash the files they dont write/copy, i tried the codes i had before and this one
| Code: | void write_file(const char *readpath, const char *writepath)
{
int fdin;
int fdout;
fdin = sceIoOpen(readpath, PSP_O_RDONLY, 0777);
if(fdin >= 0)
{
int bytesRead = 1;
fdout = sceIoOpen(writepath, PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC, 0777);
bytesRead = sceIoRead(fdin, write_buffer, sizeof(write_buffer));
while((bytesRead > 0) && (fdout >= 0))
{
sceIoWrite(fdout, write_buffer, bytesRead);
bytesRead = sceIoRead(fdin, write_buffer, sizeof(write_buffer));
}
if(fdout >= 0)
{
sceIoClose(fdout);
}
if(fdin >= 0)
{
sceIoClose(fdin);
}
}
}
|
this works in the same app and flashes correctly, but doesnt flash after it finished with the other stuff.
any idea's
edit: btw im copying from ms0 to flash0 again |
|
| Back to top |
|
 |
becus25
Joined: 24 Aug 2007 Posts: 2
|
Posted: Wed Nov 28, 2007 4:07 am Post subject: |
|
|
On 3.7x the SceMode isn't 0777.
It is 511 or 0511 . I have reversed a small part of kernel addon but now I don't remember the value of SceMode.
Try with 511 or 0511. |
|
| Back to top |
|
 |
Mashphealh
Joined: 28 Nov 2007 Posts: 18
|
Posted: Wed Nov 28, 2007 4:50 am Post subject: |
|
|
| becus25 wrote: | On 3.7x the SceMode isn't 0777.
It is 511 or 0511 . I have reversed a small part of kernel addon but now I don't remember the value of SceMode.
Try with 511 or 0511. |
And if you want run the app on vsh mode put the eboot on /psp/game/update . If you don't put it on them, the app should run on user mode. Try first run the app from UPDATE folder using vsh mode, if it works try then on user mode.
-=Double post=-
On 3.7x you can perfectly do dumps of files using the SceMode 0777 but with this mode won't work write files on the flash {folders (kd, module, etc..)}. |
|
| Back to top |
|
 |
Cpasjuste
Joined: 29 May 2005 Posts: 214
|
Posted: Wed Nov 28, 2007 5:57 am Post subject: |
|
|
| Hum very cool for me (for a 3.71 file manager that is in my next homebrew). I was unable to write to flash0 with all (lot of) the test i have tried. I will try this tomorow. |
|
| Back to top |
|
 |
Cpasjuste
Joined: 29 May 2005 Posts: 214
|
Posted: Sun Dec 02, 2007 9:02 am Post subject: |
|
|
| even with the scemode set to 0511, i'm still unable to write to flash0 in my usermode homebrew (flash0 reassigned rw in kernel mode) while it's possible in the background via psplink :x |
|
| Back to top |
|
 |
PSPfreak!

Joined: 14 Nov 2007 Posts: 34
|
Posted: Wed Dec 05, 2007 5:15 pm Post subject: |
|
|
| becus25 wrote: | On 3.7x the SceMode isn't 0777.
It is 511 or 0511 . I have reversed a small part of kernel addon but now I don't remember the value of SceMode.
Try with 511 or 0511. |
im actually using the 1.50 kernel btw if that changes anything lolz |
|
| Back to top |
|
 |
PSPfreak!

Joined: 14 Nov 2007 Posts: 34
|
Posted: Thu Dec 13, 2007 7:00 pm Post subject: |
|
|
[quote="Mashphealh"] | becus25 wrote: |
-=Double post=-
On 3.7x you can perfectly do dumps of files using the SceMode 0777 but with this mode won't work write files on the flash {folders (kd, module, etc..)}. |
i had a look in Dark_AleX's / moonlight's 1.50 poc src and he had 0777 useing it to write stuff, and it works?? |
|
| Back to top |
|
 |
brin_vg
Joined: 03 Oct 2007 Posts: 17 Location: A pineapple, under the sea
|
Posted: Fri Dec 14, 2007 6:03 am Post subject: |
|
|
[quote="PSPfreak!"] | Mashphealh wrote: | | becus25 wrote: |
-=Double post=-
On 3.7x you can perfectly do dumps of files using the SceMode 0777 but with this mode won't work write files on the flash {folders (kd, module, etc..)}. |
i had a look in Dark_AleX's / moonlight's 1.50 poc src and he had 0777 useing it to write stuff, and it works?? |
That's for 1.50 kernel. 3.7X kernel the sceMode's different. |
|
| Back to top |
|
 |
PSPfreak!

Joined: 14 Nov 2007 Posts: 34
|
Posted: Fri Dec 14, 2007 12:13 pm Post subject: |
|
|
| brin_vg wrote: | | i had a look in Dark_AleX's / moonlight's 1.50 poc src and he had 0777 useing it to write stuff, and it works?? |
That's for 1.50 kernel. 3.7X kernel the sceMode's different.[/quote]
im using the 1.50 kernel & the codes from the src, but they write only prx's & .bmp's...........i think the problem is with flashing the .dat & .txt |
|
| Back to top |
|
 |
PSPfreak!

Joined: 14 Nov 2007 Posts: 34
|
Posted: Thu Dec 20, 2007 9:55 am Post subject: |
|
|
| anybody know how to copy .dat & .txt to flash0 ???? |
|
| Back to top |
|
 |
|