• 0 Posts
  • 11 Comments
Joined 2 years ago
cake
Cake day: June 16th, 2023

help-circle

  • So the basic purpose of a library is to allow code that does some useful thing to be easily used in multiple programs. Like say math functions beyond what is in the language it self or creating network connections.

    When you build a program with multiple source files there are many steps. First each file compiled into an object file. This is machine code but wherever you have calls into other files it just inserted a note that basicly says connect this call to this part of another file. So for example connect this call to SquareRoot function in Math library.

    After that has been done to every file needed then the linker steps in. It grabs all the object files combines them into one big file and then looks for all the notes that say connect this call to that function and replaces them with actual calls to the address where it put that function.

    That is static linking. All the code ends up in a big executable. Simple but it has two big problems. The first is size. Doing it this way means every program that takes the squareroot of something has a copy of the entire math library. This adds up. Second is if there is an error in the math library every program needs to be rebuilt for the fix to apply.

    Enter dynamic linking. With that the linker replaces the note to connect to the SquareRoot function in math library with code that requests the connection be made by the operating system.

    Then when the program is run the OS gets a list of the libraries needed by the program, finds them, copies them into the memory reserved for that program, and connects them. These are .so files on Linux and .dll on Windows.

    Now the os only needs one copy of math.so and if there is a error in the library a update of math.so can fix all the programs that use it.

    For GPL vs LGPL this is an important distinction. The main difference between them is how they treat libraries. (There are other differences and this is not legal advice)

    So if math.so is GPL and your code uses it as a static link or a dynamic link you have to providd a copy of the source code for your entire program with any executable and licence it to them under the GPL.

    With LGPL it’s different. If math.so is staticly linked it acts similar to the GPL. If it’s dynamicly linked you only have to provide the source to build math.so and licences it under LGPL. So you don’t have to give away all your source code but you do have to provide any changes to the math library you made. So if you added a cubeRoot function to the math library you would need to provide that.


  • For ntsc vhs players it wasnt a component in the vcr that was made for copy protection. They would add garbled color burst signals. This would desync the automatic color burst sync system on the vcr.

    CRT TVs didn’t need this component but some fancy tvs would also have the same problem with macrovission.

    The color burst system was actually a pretty cool invention from the time broadcast started to add color. They needed to be able stay compatible with existing black and white tv.

    The solution was to not change the black and white image being sent but add the color offset information on a higher frequency and color TVs would combine the signals.

    This was easy for CRT as the electron beam would sweep across the screen changing intensity as it hit each black and white pixel.

    To display color each black and white pixel was a RGB triangle of pixels. So you would add small offset to the beam up or down to make it more or less green and left or right to adjust the red and blue.

    Those adjustment knobs on old tvs were in part you manually targeting the beam adjustment to hit the pixels just right.

    VCRs didn’t usually have these adjustments so they needed a auto system to keep the color synced in the recording.




  • Years ago there was a commit to the Linux kernal that strangly had no author. This got some attention of several of the developers.

    Looking into the code that had to deal with network transmission. there was a section that if you tried to get network access in a unusual way had a check that was written something like this.

    If (usr_permission = ROOT) … Instead of If (usr_permission == ROOT) …

    The first giving the user root if invoked and the second checking to see if the user was root.

    It’s widely thought this was the NSA or some other intelligence agency trying to backdoor lin Linux.



  • If you are trying to steel credentials from people with power and money passengers in first class are a good target.

    Where else are you going to find a cluster of people like that that are using the wifi and are going to be there for hours. It’s about as optimal as I can think of.

    Even better if you are targeting a spefic company. Just pick flights out of the headquarters for that company.

    If you want to attack say Microsoft pick a flight from Seattle to DC. Pretty good odds of a Microsoft high up being on the flight and wanting to use the wifi for work.




  • Electrolytic capacitors use the chemistry to make a very high dielectric allowing the plates to get very close and increase the capacitance and decrease the size.

    A cell in a battery is a capacitor then converts the charge on the plates into chemical energy and vice versa allowing much more energy storage and a flat operating range as the plates charge is replenished by the chemical reaction.

    This article doesn’t go into details but it sounds like the breakthrough is a much better dialectic then storing energy in a chemical reaction.