News: 11 March 2016 - Forum Rules

Author Topic: VBA-SDL-H bugfix  (Read 4954 times)

Griever

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
VBA-SDL-H bugfix
« 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:
Code: [Select]
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");
}
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?

FAST6191

  • Hero Member
  • *****
  • Posts: 3554
    • View Profile
Re: VBA-SDL-H bugfix
« Reply #1 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.

justin3009

  • Hero Member
  • *****
  • Posts: 1666
  • Welp
    • View Profile
Re: VBA-SDL-H bugfix
« Reply #2 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.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

Bregalad

  • Hero Member
  • *****
  • Posts: 2763
    • View Profile
Re: VBA-SDL-H bugfix
« Reply #3 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).

Griever

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Re: VBA-SDL-H bugfix
« Reply #4 on: September 26, 2014, 06:52:14 am »
Quote
no$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.
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?

justin3009

  • Hero Member
  • *****
  • Posts: 1666
  • Welp
    • View Profile
Re: VBA-SDL-H bugfix
« Reply #5 on: September 26, 2014, 02:58:45 pm »
I can't even OPEN No$GBA.  It crashes on launch instantly.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

FAST6191

  • Hero Member
  • *****
  • Posts: 3554
    • View Profile
Re: VBA-SDL-H bugfix
« Reply #6 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....).