Page 2 of 2

Re: [New tool] PureLibrary Explorer

Posted: Thu Sep 24, 2015 6:59 am
by idle
Nice work and I'm sure it'll be very handy.

Re: [New tool] PureLibrary Explorer

Posted: Thu Sep 24, 2015 9:09 am
by RSBasic
Very nice, thanks for sharing :!:

Re: [New tool] PureLibrary Explorer

Posted: Thu Feb 25, 2016 5:38 am
by Lunasole
impresses, seems you learned PB internals very well. Though I'm a bit disappointed there are no any hidden functions inside :)

Re: [New tool] PureLibrary Explorer

Posted: Thu Feb 25, 2016 6:56 am
by Keya
Lunasole wrote:impresses, seems you learned PB internals very well.
just trying to get my stupid head around things lol. The file formats i just figured them out with a hex editor, theyre not obfuscated or compressed or anything so it was straight forwad

Re: [Tool] PureLibrary Explorer

Posted: Wed Oct 27, 2021 12:20 pm
by infratec
If the procedure GetPurelibType(file$)

is replaced by:

Code: Select all

Procedure.s GetPurelibType(file$)       
  Protected hFile.i, *sMagicBuffer, sMagic.s, sType.s, sInternal.s
  hFile = ReadFile(#PB_Any, file$, #PB_File_SharedRead)
  If hFile
    
    *sMagicBuffer = AllocateMemory(5)
    If *sMagicBuffer
      
      ReadData(hFile, *sMagicBuffer, 4)
      sMagic = PeekS(*sMagicBuffer, 4, #PB_Ascii)
      If sMagic = "ERUP"
        FileSeek(hFile,4)
        ReadData(hFile, *sMagicBuffer, 4)
        If PeekL(*sMagicBuffer) = 'EDLL'
          sType = "EDL"
          FileSeek(hFile,$0D)
        ElseIf PeekL(*sMagicBuffer) = 'LSO1'
          sType = "LSO"
          FileSeek(hFile,$0D)
        Else
          FileSeek(hFile,8)  
          ReadData(hFile, *sMagicBuffer, 4)
          sType = Chr(PeekA(*sMagicBuffer+3)) + Chr(PeekA(*sMagicBuffer+2)) + Chr(PeekA(*sMagicBuffer+1))
          FileSeek(hFile,$14)
        EndIf
        sInternal = ReadString(hFile,#PB_Ascii)
        CloseFile(hFile)
        ProcedureReturn sType + "|" + sInternal
      EndIf
      
      FreeMemory(*sMagicBuffer)
    EndIf
    
  EndIf
EndProcedure
replace SetReturns(sTxt.s) with:

Code: Select all

Procedure.s SetReturns(sTxt.s)
  Protected offset.i, *pchar.Character = @sTxt + StringByteLength(sTxt) - SizeOf(Character)
  Repeat
    *pchar - SizeOf(Character)
  Until *pchar\c = ' '
  offset = (*pchar - @sTxt) / SizeOf(Character)
  ProcedureReturn Left(sTxt, offset) + " retn " + Right(sTxt, Len(sTxt) - offset - 1)
EndProcedure

You can remove or comment the following lines in AppMain:

Code: Select all

  ;   If SizeOf(Character) = 2
  ;     MessageRequester("Compile Error","My bad, Unicode not supported - please use Ascii compile"):
  ;     End
  ;   EndIf  
Then it works with PB 5.73 :mrgreen:

Re: [Tool] PureLibrary Explorer

Posted: Fri Oct 29, 2021 9:52 pm
by mpz
Hello Infratec,

a nice tool. I test it put it looks that "deepscan" doesnt work on my win 10 pc. I klick on a lib and then the deepscan button, but the deep scan windows is empty...

Do you have a solution?

Greetings Michael

Re: [Tool] PureLibrary Explorer

Posted: Sat Oct 30, 2021 12:14 am
by chi
If you start PureLibrary Explorer with the IDE (Tools), you could change the line

Code: Select all

sPurelibsPath = #PB_Compiler_Home + "purelibraries"
to

Code: Select all

sPurelibsPath = GetPathPart(GetEnvironmentVariable("PB_TOOL_IDE")) + "PureLibraries"
so you don't need to recompile on ever new release and you're able to inspect the libraries of the current PB version you are working with.

Btw. thanks for sharing, Keya 8)

Re: [Tool] PureLibrary Explorer

Posted: Sat Oct 30, 2021 12:35 am
by chi
mpz wrote: Fri Oct 29, 2021 9:52 pm I test it put it looks that "deepscan" doesnt work on my win 10 pc. I klick on a lib and then the deepscan button, but the deep scan windows is empty...

Do you have a solution?
Did you put some text into the Find: stringgadget? Like Find: window + DeepScan

Re: [Tool] PureLibrary Explorer

Posted: Sat Oct 30, 2021 9:38 am
by infratec
It's not written by me 8)

I only modified it that it works with newer PB versions.

But yes, you have to insert a word like 'window' in the search field.

Re: [Tool] PureLibrary Explorer

Posted: Sat Oct 30, 2021 4:16 pm
by mpz
thanks for the help,

i think it was a problem of the missing help file...


:D

Greeting
Michael