GithubHelp home page GithubHelp logo

Comments (2)

francescocaponio avatar francescocaponio commented on July 19, 2024

So, I went a little bit more deep in the file format. I think that the string reader for this section (SectionKeys) would be different from the string reader used in other places in the same PCB lib.

image

Take a look at the attached screenshot. It is the raw stream from the previous library for the SectionKeys stream.

The Int32 data read at offset 4 is the lenght of the following block, but the following 0x20 is not a blankspace, it is the string lenght instead, similarly to what the do in the raw Pin representation on the Schlib for the pin name, designator and Swap ID.

To summarize, the problems I see are two.

  • a raw char indicating the string lenght is taken as part of the string for both the libref and sectionkey read from this stream (in the beginning of the string).
  • the last char is dropped because it's taken as the string is 0 terminated while it is not.

I still didn't go as deep in your code to suggest how to edit it, or send you a PR yet, but I hope it was more clear to you what I see.

from altiumsharp.

francescocaponio avatar francescocaponio commented on July 19, 2024

What the library is doing at the moment is that it is starting reading the string at offset 8 (taking a whitespace in the beginning, you can notice that in the picture of the first comment) until offset 0x29 (reading 33 bytes) and then dropping the last one since it is assumed the string would be 0 terminated, leaving the string as VERY_LONG_USEFUL_FOOTPRINT_NAME without the number 1 at the end, with a whitespace in the beginning of the string.

from altiumsharp.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.