Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 11:02

    GreyCat on master

    Bump copyright year (compare)

  • 08:47
    generalmimon labeled #820
  • 06:42
    KOLANICH commented #819
  • 01:28
    trejkaz opened #820
  • Oct 27 23:18

    generalmimon on master

    LICENSE: update URL links accor… (compare)

  • Oct 27 22:34
    GreyCat commented #819
  • Oct 27 22:31
    GreyCat commented #819
  • Oct 27 22:31
    GreyCat commented #819
  • Oct 27 22:02
    generalmimon commented #819
  • Oct 27 21:51
    generalmimon commented #819
  • Oct 27 21:46
    generalmimon commented #819
  • Oct 27 12:54
    KOLANICH synchronize #339
  • Oct 27 12:54
    KOLANICH synchronize #318
  • Oct 27 12:54
    KOLANICH synchronize #311
  • Oct 27 12:54
    KOLANICH synchronize #343
  • Oct 27 12:54
    KOLANICH synchronize #314
  • Oct 27 12:54
    KOLANICH synchronize #317
  • Oct 27 12:54
    KOLANICH synchronize #316
  • Oct 27 12:54
    KOLANICH synchronize #313
  • Oct 27 12:54
    KOLANICH synchronize #319
Asecta
@Asecta
No problem, thanks for your time!
Petr Pučil
@generalmimon

I'm examining the snippet you posted

well, it seems totally OK

I'm hesitant to post it publicly though because I'm reversing a game's save files, and I'm not as familiar with copyright law as I should be :)

would you send me it privately then?

Asecta
@Asecta
Sure thing
Asecta
@Asecta
Thanks for solving my problem Petr! And thanks to everyone here for kaitai, it's amazing :D
Petr Pučil
@generalmimon
@Asecta thanks for these kind words :heart:
pibion
@pibion
@XVilka is there any particular part of the project you'd like to know about? The Cryogenic Dark Matter Search homepage is at https://supercdms.slac.stanford.edu/, but there's not a lot of detailed information on data formats there :)
Anton Kochkov
@XVilka
@pibion I am more interested in this conversion project, also I am curious what is used currently to work with those
pibion
@pibion
@XVilka right now every experiment writes their own data acquisition code and custom data analysis code.
It's a bit of a nightmare.
Anton Kochkov
@XVilka
I see
Thanks for explanations
Dominick Reba
@fudgepop01
congrats on the new release!
Super glad to see 0.9 come to fruition - there are a LOT of cool things there :D
Petr Pučil
@generalmimon

congrats on the new release!

thanks :+1:

Mikhail Yakshin
@GreyCat
BTW, linux.org.ru announce got approved — https://www.linux.org.ru/news/opensource/15955935
Petr Pučil
@generalmimon
:+1:
Petr Pučil
@generalmimon

https://www.linux.org.ru/news/opensource/15955935

I'm quite disappointed with the low level of responses there - there are a few meaningful ones, but nearly a half are beside the point

Anton Kochkov
@XVilka
It's usual LOR after all
Mikhail Yakshin
@GreyCat
BTW, somebody posted a news annonce on opennet.ru too: https://www.opennet.ru/opennews/art.shtml?num=53912
pibion
@pibion
@GreyCat apologies for constantly pinging about a letter of collaboration - do you have any thoughts on this?
Stefanos Mandalas
@sealmove
I'd like to point out that reference.html had some useful information which are not explained by KSY diagram or user guide. For example the way type lookup works isn't explained anywhere.
dgelessus
@dgelessus

This is art: https://www.sultanik.com/pocorgtfo/#0x16

This PDF is a Shell Script That Runs a Python Webserver That Serves a Scala-Based JavaScript Compiler With an HTML5 Hex Viewer; or, Reverse Engineer Your Own Damn Polyglot

(you get one guess which Scala-based JavaScript compiler with an HTML5 hex viewer it is)

(note: this will only work correctly if your system has Python 2 installed and available as python in the shell)
Mikhail Yakshin
@GreyCat
@dgelessus Actually, we should probably a link to that somewhere around "awesome kaitai"
Mikhail Yakshin
@GreyCat
@pibion Thanks for reaching out again! I believe your proposal in general makes sense. Let me reach out to you in private message to confirm your e-mail.
pibion
@pibion
Thanks @GreyCat !
Mikael Falkvidd
@mfalkvidd

Hi.
I have some trouble creating a calculated value. This is my ksy:

  - if: heartbeat_settings == 0xC0
    id: decivolts_bcd
    type: bcd(2,4,false)
    instances:
        voltage:
            value: decivolts_bcd.as_int / 10.0

But the instance is not allowed at this level. The value ix 0x30. decivolts_bcd.as_int is 0x1E (30 decimal) which is correct. But I want to expose the voltage value, which is 3.0. Could anyone give me a pointer to how to do this correctly?

Mikhail Yakshin
@GreyCat
seq and instances should be on the same level, i.e. type level
Judging by - if: ..., first three lines are likely part of seq
So, the answer is to unindent instances by 2 levels
Mikael Falkvidd
@mfalkvidd
Thanks. But if I move instances up 2 levels I get Call stack: undefined TypeError: this.decivoltsBcd is undefined whenever the if clause returns false.
Mikhail Yakshin
@GreyCat
Then you probably need to wrap voltage in the same if as you have with decivolts_bcd?
The key here is to understand that there's no real complicated inheritance / nesting patterns
There are just two separate attributes — voltage and decivolts_bcd
They're completely independent, so if they need some safeguards to avoid calculating, it should be applied to both
If you want them to be somewhat tighter coupled, you're supposed to take them away into a separate type
Mikael Falkvidd
@mfalkvidd
How do I wrap multiple things into the same if?
Mikhail Yakshin
@GreyCat
Something like
  - if: heartbeat_settings == 0xc0
    id: voltage
    type: my_voltage
types:
  my_voltage:
    seq:
      - id: as_bcd
        type: bcd(2, 4, false)
    instances:
      as_float:
        value: as_bcd.as_int / 10.0

How do I wrap multiple things into the same if?

You can't, that's exactly what I'm talking about

Once you feel like you need to do that, you need to extract them into a separate type
(as shown above)
Mikael Falkvidd
@mfalkvidd
Very elegant solution, I'll go with that. Thanks!
Mikael Falkvidd
@mfalkvidd
I see that the Web IDE has appended the common Bcd parser at the end of the generated JScode (due to my ksy's imports statement). The parser works fine when parsing a binary that does not use Bcd. But when the if clause matches and the parser wants to use Bcd, I get Uncaught TypeError: Bcd is not a constructor. I have a test page at http://mjo.se/test2.html if anyone wants to take a look.
Petr Pučil
@generalmimon
@mfalkvidd I know, it's a bug in Web IDE, just press Ctrl + Enter to run the parsing again and it should work
see https://github.com/kaitai-io/kaitai_struct_webide/issues/59#issuecomment-692319965 for a lengthy elaborate on this issue, if you're curious why it happens
yeah, and I also wrote it here in Gitter a while ago: :point_up: September 13, 2020 18:45

Note: on a "cold start" (i.e. the first time you compile the spec with imports on that page), you'll unfortunately usually get a TypeError: Bcd is not a constructor. This is not limited to absolute imports, the relative imports fail exactly the same way at first. It's just another separate bug I discovered while testing it.

The solution is just to compile the spec again (by pressing Ctrl + Enter for example). Then should everything work normally until you reload the page.

Mikael Falkvidd
@mfalkvidd
Thanks. I manually rearranged the order in the js file and now it works.
Petr Pučil
@generalmimon

Thanks. I manually rearranged the order in the js file and now it works.

it's unnecessary, but OK :smile: