Romhacking.net

Romhacking => Personal Projects => Topic started by: Griever on September 25, 2014, 07:05:56 AM

Title: VBA-SDL-H bugfix
Post by: Griever on September 25, 2014, 07:05:56 AM
So I was summing up information for GBA debugging emulators and found, that VBA-SDL-H is the only opensource and free option for honest romhackers. Please correct me if I'm wrong.
Looks like Labmaster doesn't care about it anymore, in fact sources are hard to find nowadays. There's also a VBA-SDL-H2 available at poke community, which has some additional functions.
Anyhow, there's a bug in 'dsave' command: both address and size are read from the same command argument.
[spoiler]void debuggerDumpSave(int n, char** args)
{
  u32 address;
  u32 size;
  char *file;
  FILE *f;

  if (n==4){
    file=args[1];
    if (!dexp_eval(args[2], &address)){
      printf("Invalid expression in address.\n");
      return;
    }
    if (!dexp_eval(args[2], &size)){//should be args[3]
      printf("Invalid expression in size");
      return;
    }

    f=fopen(file,"wb");
    if(f==NULL){
      printf("Error opening file.\n");
      return;
    }

    for(u32 i = 0; i < size; i++) {
      fputc(debuggerReadByte(address), f);
      address++;
    }

    fclose(f);
  } else
    debuggerUsage("dsave");
}
[/spoiler]
The same bug passed to VBA-SDL-H2.
I wanted to update VBA-SDL-H2 code, compile emulator and release it at github and here, but I'm quite new at community policies and regulations. Is this appropriate? Won't that offense rights of Labmaster, poke-community or VBA programmers?
Title: Re: VBA-SDL-H bugfix
Post by: FAST6191 on September 25, 2014, 10:58:23 AM
no$gba debugger is now free ( http://problemkaputt.de/gba.htm#debug ), likewise there is boycott advance for another debugger (though it is inferior to both). However if emphasis is going to be on the and part then yeah (if you can find boycott advance source you are doing well).

I was unaware of the pokemon hacker fork, I shall have to look into it a bit.

Rights and policy wise it is a GPL program, comply with the GPL and nobody can really say anything. If you somehow manage to pull off something terribly offensive with it (stick malware in it.... something of that grade) then you might be made unwelcome, I do not really see that happening though. Even if someone did somehow decide to take offence (stranger things have happened) then you point at it and say "GPL", it is part of why people like the GPL and open source in general.

Edit. Forgot to mention there is regular VBA-h as well, it is more for cheats but I have no idea where you might find source code for it there days.
Title: Re: VBA-SDL-H bugfix
Post by: justin3009 on September 25, 2014, 02:30:15 PM
Speaking of which on No$GBA.  Were you actually able to get it to work?  It just instantly crashes for me every single time no matter which version I use.
Title: Re: VBA-SDL-H bugfix
Post by: Bregalad on September 25, 2014, 05:08:50 PM
Yes I made it run but sometimes when the game would crash the emulator would crash instead (which is, in my opinion a terrible behaviour for an emulator).
Title: Re: VBA-SDL-H bugfix
Post by: Griever on September 26, 2014, 06:52:14 AM
Quoteno$gba debugger is now free
That was breaking news for me, thanks.  Guess, nobody will need console tool like VBA-SDL-H, while gui emu is available.
Quote from: justin3009 on September 25, 2014, 02:30:15 PM
Speaking of which on No$GBA.  Were you actually able to get it to work?  It just instantly crashes for me every single time no matter which version I use.
It worked OK on Golden Sun. Where exactly does crash happens?
Title: Re: VBA-SDL-H bugfix
Post by: justin3009 on September 26, 2014, 02:58:45 PM
I can't even OPEN No$GBA.  It crashes on launch instantly.
Title: Re: VBA-SDL-H bugfix
Post by: FAST6191 on September 26, 2014, 07:31:57 PM
Debugger ran fine on junky vista laptop. Some people saw it gutted by their anti virus but it ran fine with several different games on a plain extract (no BIOS, no encrypted secure areas on DS games....).