Author Topic: Finding / listing programs  (Read 25344 times)

0 Members and 1 Guest are viewing this topic.

Offline Broseph Radson

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 295
  • Rating: +20/-1
  • Its 0x1A4 somewhere
    • View Profile
Finding / listing programs
« on: September 27, 2010, 11:53:32 am »
Would this be possible? Would i need to find the location of the programs then point a Text( or Output( to the names? our could Axe just put a list of the programs into a string in 8 char blocks?

EDIT: Ill check on this tomorrow. Wont have computer access till tomorrow morning.
« Last Edit: September 27, 2010, 12:14:46 pm by Broseph Radson »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Finding / listing programs
« Reply #1 on: September 27, 2010, 01:46:20 pm »
I actually wrote a program that does exaclty this in Axe, I wrote it as part of my Optimizer program.  I'll see if i can get the source code up in a sec

SirCmpwn

  • Guest
Re: Finding / listing programs
« Reply #2 on: September 27, 2010, 06:43:24 pm »
Yeah, I have a routine, I'll post it as soon as I can get it off my calc.  It gets a list of programs as well as information about each, including archived state and such.

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Finding / listing programs
« Reply #3 on: September 27, 2010, 08:33:29 pm »
How exactly is this done?

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Finding / listing programs
« Reply #4 on: September 27, 2010, 08:38:28 pm »
i'm guessing there's an address in ram that begins where all the programs are stored, and then the first few bytes of the program indicate the size of said program, whether it's archived etc. then program name/data. so to get all the names, you would have a loop reading off the program name, copy it to a safe ram area, then skip ahead [size of program] bytes to the next program.


Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Finding / listing programs
« Reply #5 on: September 27, 2010, 10:03:00 pm »
i'm guessing there's an address in ram that begins where all the programs are stored, and then the first few bytes of the program indicate the size of said program, whether it's archived etc. then program name/data. so to get all the names, you would have a loop reading off the program name, copy it to a safe ram area, then skip ahead [size of program] bytes to the next program.

I believe their programs may read from the VAT (Variable Allocation Table), which contains information about every data structure on the calculator, whether it's a variable, list, program, app, etc.

Offline Broseph Radson

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 295
  • Rating: +20/-1
  • Its 0x1A4 somewhere
    • View Profile
Re: Finding / listing programs
« Reply #6 on: September 28, 2010, 08:46:40 am »
If you dont already have it, you should get CalcSys. It has a built-in hex editor, and it lets you view the program VAT and go directly to a program's address in the Hex Editor.

If you can figure out what any of the information means, theres 10 bytes of data, then the name of the program, then more data. So, for example, I have a program called "A." It starts at 7BC0 and the name begins (and ends, since its only 1 byte) at 7BCB.

Calcsys: http://www.ticalc.org/archives/files/fileinfo/97/9781.html

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Finding / listing programs
« Reply #7 on: September 28, 2010, 11:50:34 am »
How does the program start and end looks like into memory? Is it always the same? If so, I guess it might not be too hard to detect.

Offline Broseph Radson

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 295
  • Rating: +20/-1
  • Its 0x1A4 somewhere
    • View Profile
Re: Finding / listing programs
« Reply #8 on: September 28, 2010, 12:03:02 pm »
They seem to all start with FC, but idk what they end with. I guess that all depends on the size of the program, so if the programs are all together with no data between them, you should be able to find an FC, skip ahead 10 bytes for the name, then (assuming they are all together) skip ahead the number of bytes in the program -10 -the length of the name, and be at another program, and so on, or simply skip to the next FC (assuming its only at the beginning and not anywhere else in the program)

Also, quick modify is awesome.

« Last Edit: September 28, 2010, 12:05:07 pm by Broseph Radson »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Finding / listing programs
« Reply #9 on: September 28, 2010, 12:04:38 pm »
Oh thanks. Are programs the only thing that can start with FC? I wonder if they end with 0?

Offline Broseph Radson

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 295
  • Rating: +20/-1
  • Its 0x1A4 somewhere
    • View Profile
Re: Finding / listing programs
« Reply #10 on: September 28, 2010, 12:14:42 pm »
Well it seems that symbols also start with FC, but the 3rd and 4th bytes of programs seems to always be 00 05

Edit: 3rd byte changes. 4th byte seems to stay 05 in all programs

EDIT: and again, im wrong. That also changes.

Ill be back later. Class is almost over
« Last Edit: September 28, 2010, 12:18:20 pm by Broseph Radson »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Finding / listing programs
« Reply #11 on: September 28, 2010, 12:31:57 pm »
Darn, that seems a bit more complicated than I think x.x

I'll have to study WikiTI for a bit, I think, if I can manage to find info on 8xp file structure there. Otherwise, I guess maybe one of the advanced ASM programmers like BrandonW, Thepenguin77 or Calc84maniac might know into in-depth details on 8xp BASIC file structure.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Finding / listing programs
« Reply #12 on: September 28, 2010, 03:20:28 pm »
They don't end with anything specific actually.  There is a length byte somewhere in the VAT entry for a program that tells you how long the name is, and you can calculate where it ends from there.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Finding / listing programs
« Reply #13 on: September 28, 2010, 03:44:01 pm »
Oh ok, but what about the entire program lenght?

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Finding / listing programs
« Reply #14 on: September 28, 2010, 04:28:48 pm »
Oh gotcha, the program i believe is just started with the length in 2 bytes, followed by the program data and thats it, nothing at the end.