Final prepares before shipping, and git merge conflicts
Been a while scince the last devlog
Since then i have:
Nesting commands dont work super well, but for simpler nesting it should work fine
I have also learnt that haskell types are super weird, somehow theres a difference between String and [Char], and i have no idea what it is
Screenshot is of it compiling without errors
I have made multiple large changes, including
Making the markdown output took a lot of time, since i basically had to rewrite every formatting function, but it went faster than with html output, probably because im better at haskell now
Several notable changes, including:
Getting the lists to work was a nightmare, i had to do some cheeky recursion thing and it was not easy. I also had to put parentheses like everywhere for the compiler to understand what ordering i wanted, but it didnt say that, it just said “Couldn’t match expected type with actual type”, and i had no idea what was going on.
Jojk now has the following features:
Ive learnt lots, most of it being that haskell is weird, but the compiler warnings are awesome. You forgot to specify the input and return type of a function? The compiler warning literally tells you the type, and gives you the exact codepiece you need to add!
I did encounter a couple of errors, but most of them were just things like haskell needing an int instead of a “maybe int”(what the hell is a maybe int?)
Jojk is a markup language im making, and im using it to learn haskell, so i anticipate a lot of issues.
Right now it takes a file as an input and outputs the file but in html format
More finishing touches. I have added:
No real issues this time around, everything mostly worked first (or second) try.
Unfortunately there are no new features, but, i have managed to remove all memory leaks and (almost all) segfaults, as well as (tried to) prevent command injection.
some things ive done are:
--help flag no longer messes everything upThis wasnt a super smooth process, as you can se in the screenshot i managed to make it even worse while trying to fix it, but i eventually figured it out.
Scout now has a readme and a security policy(SECURITY.md). Along with that scout now also has these additional features:
--report flag automatically generates a comprehensive malware analysis report and prints it to the terminal.--help flag, but it is very unstable at the moment, and the help message is, not very helpfulScout is now gcc only. Compiling with other compilers will not work due to certain GNU extensions used in the code.
The new tokenize function has a memory leak for every token it generates, but fixing that would mean having to figure out where to put the free() calls.
The program also segfaults if the second argument is blank.
Some of the things ive done since the last devlog are:
mathyy
lnsha feature, calculates the natural log of the sha256 hash of the prorgam(completely useless)The taylor series were quite problematic, as the more iterations i had, the higher the values in the factorial and power functions got, so sometimes they would overflow to infinity based on the start value, so i had to find a middle ground where the risc of overflowing was low, but it still had resonable precision. Especially for the natural log, which for higher numbers basically just returns a constant of about 10.48.
Ive also discovered some memmory leaks through valgrind, but as i discovered, fixing them breaks everything else, and i dont have the energy to fix it, so i left a comment and moved on
Scout can now read and parse json files(with the library cjson) and it also now contains a function that returns other functions!
Why cJSON?
It was easily availible with my package manager, and it looked the simplest out of all the json libraries.
how does higher-order functions benefit this project?
It dosent, the code is definitely less readable aand its completely unnecessary, but its fun!
While implementing this, i have started beef with gcc, as you can see in the attached screenshot, i have absolutely no idea what its talking about or what i did wrong and im pretty certain the compiler had a stroke, but i switched to clang for a while and when i switched back it was working again. As far as ive checked, the code is valid C, it compiled perfectly with clang, so i have no idea what happend, maybe gcc uses another C standard, or thers some weird macro in cjson that fucks things up.
The json reading will be used for pattern matching in the file with the patterns in the json file (similar to YARA, but simpler).
Scout is a CTF tool written in C that does quick analysis on files, mainly for reverse engineering and forensics CTF:s. It’s designed to be the first thing you run on a file, and it gives basic information like any potential flags and any interesting strings in the file. So far the program is able to run strings on a file, and extract potential flags and interesting strings. In the attached screenshot you can see it being run on a file called “chall”, and then underneath the contents of that file are printed out.