#💽Programming Chat v2

1 messages · Page 13 of 1

timid quartz
#

maybe I misunderstood

spare quartz
#

well yeah this makes sense

proud creek
timid quartz
#

@spare quartz

use std::thread;
use std::sync::{Arc, Mutex};

struct Client {
    token: Mutex<String>,
}
impl Client {
    fn do_thing(&self, num: u8) {
        let mut t = self.token.lock().unwrap();
        *t = format!("token{num}");
    }
}

fn main() {
    let client = Arc::new(Client { token: Mutex::new("token".to_string()) });
    
    let c1 = client.clone();
    let c2 = client.clone();
    
    let t1 = thread::spawn(move || thread(c1, 1));
    let t2 = thread::spawn(move || thread(c2, 2));
    
    t1.join().unwrap();
    t2.join().unwrap();
    
    println!("{:?}", client.token);
}

fn thread(client: Arc<Client>, num: u8) {
    client.do_thing(num);
}

this works...maybe I will do this

timid quartz
#

I still think it sucks more than just having independent functions and creating state in each thread

#

but

#

¯_(ツ)_/¯

timid quartz
#

rather than just

use std::thread;
fn main() {
  thread::spawn(|| thread());
}
fn thread() {
  let request_jar = Jar::new(Some("roblosecurity"));
  // ...
}
proud creek
spare quartz
#

ZToj

#

e:#
d:#

#

01100100
01100101

#

litearlly one bit off

#

how

timid quartz
#

@spare quartz why doesn't it play ca

spare quartz
#

do i look like a cdn expert

timid quartz
spare quartz
# timid quartz yes.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/home/miko/.ssh/github' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
spare quartz
lavish dove
#

ive goten that error a few times

spare quartz
#

is this rust

timid quartz
#

Why didn’t that embed

spare quartz
#

nooooooooo reasssonnn

timid quartz
spare quartz
#

rust coder too

timid quartz
#

what does that make the average ada coder then

#

?av 516049910622191626

upbeat badgeBOT
#
signin.aws.amazon.com
Server Avatar
timid quartz
#

I think it makes them that

#

catsune miko

timid quartz
# spare quartz

you just ignored the play I made on your name, avatar, and hatsune miku

spare quartz
timid quartz
#

one man show

spare quartz
#

AWIT

#

I NEED TO WORK ON TLS NOW

spare quartz
#

broke everything apart

timid quartz
#

soiled it

spare quartz
#

timid quartz
#

spongebob reference

#

smh uncultured

spare quartz
#

🤖

#

i only watched like

#

4 episodes of spongebob

timid quartz
#

ok time to actually start on the exe reader

#

....sike

#

doing sql isntead

spare quartz
#

okay cool

#

auth works perfetclty

timid quartz
#

open it up

spare quartz
#

hold on i need to push

spare quartz
timid quartz
#

it's no longer toulene?

#

@spare quartz

spare quartz
timid quartz
#

urghhhh

spare quartz
#

you never said open it without one

#

:3

timid quartz
#

toulene:<passwd>?

spare quartz
#

i can't give you the password

#

lemme just restart it w/o one

timid quartz
#

dangit

spare quartz
#

good enough

timid quartz
#

lolgetrolled

#

toulene:lolgetrolled doesn't work

#

(yes im base64)

#

WOW your test file laughed at me @spare quartz

spare quartz
timid quartz
#

oh

spare quartz
timid quartz
#

lolgettrolled

#

two ts

#

have fun with my .gpr file

spare quartz
#

booooooo

#

this stinksss

#

now this is a real gpr

timid quartz
#

overgrown make

spare quartz
#

timid quartz
#

overgrown make

spare quartz
#
   package Install is
      for Artifacts (".") use ("share");
   end Install;
#

i wonder what this does

timid quartz
#

yours has it too

spare quartz
#

yeah but i dont know what it do

timid quartz
#

leave it up for a sec

spare quartz
#

it is

#

im gonna go get a slushie

#

bak

timid quartz
spare quartz
#

the only two headers considered are:

#

Content-Length, Authorization

#

and authorization is only a subset

#

why do you ask

timid quartz
#

tried using it on telnet to make your server not disconnect

#

but

spare quartz
#

how is it disconnecting?

#

immediately after response?

timid quartz
#

yeah

spare quartz
#

...

#

ooooooookay

#

thats something i need to fix

timid quartz
#

yep

#

how many is it at now @spare quartz

spare quartz
#

there's a thread pool of only 50 so

#

none

timid quartz
#

oh g

spare quartz
#

are you spamming it

timid quartz
#

how did you know :3

spare quartz
#

👁️.

timid quartz
#

I thought about it at first but deliberately left the HTTP request unfinished

#

so yeah if TCP connection closes before request is finished, deallocate

#

glad I helped you catch that thumb

spare quartz
#

hmm

#

lemme look at the ada wiki on how to fix this

#

something like that

#

wait oops

timid quartz
#

like

#

3-5s

#

?

#

in case some goober decides to use telnet

#

but surely there's a way to detect on the fly when the tcp connection closes

#

like how you did it with your smtp server

timid quartz
#

@spare quartz I assume you roll your own argument parsing

timid quartz
#

oh

spare quartz
#

i need to see if i can't shorten this tree

timid quartz
#

huh neat

spare quartz
#

i wonder what this has in it

timid quartz
# spare quartz

and you said I could use GNAT extensions for the exe reader right...

#

oh wait is that different from a gnat extension

#

how do I use this

#

@spare quartz I'm not finding any resources for GNAT.Command_Line cuh

#

man this is dogshit

#

almost like nix

#

basically no docs

spare quartz
timid quartz
#

where tf is g-comlin.ads

spare quartz
#

with GNAT.Command_Line; (right click on the part after GNAT.)

timid quartz
#

this is literally just like nix

#

no docs, read source code

spare quartz
#

well in ada the source code IS the docs

timid quartz
#

THIS IS LITERALLY JUST LIKE NIX

spare quartz
timid quartz
#

this is so ass

spare quartz
#

for quite a while???

timid quartz
spare quartz
#

its good enough personally

timid quartz
#

says all the errors

spare quartz
#

press x enough times and its fine 👍

timid quartz
#

where tf does "Command_Line_Config" come from

spare quartz
#

you make it

timid quartz
#

oh it's in GNAT.Command_Line

spare quartz
timid quartz
#

this is so ass

spare quartz
#

it's fine

#

you're just not in the Ada Mindset

timid quartz
#

just look at this

#
  • well documented
  • examples given
  • easy to use
spare quartz
#
  • well documented
  • fields tell you what they do
  • easy to use
timid quartz
#

I shouldn't have to read the source code to figure out wtf shit does

#

and then figure out how to use it right on my own

spare quartz
#

the alternative is reading the ada rm

timid quartz
#

in which there's nothing about GNAT.Command_Line

spare quartz
#

wait hold on

#

AHA

#

here you go

#

wait thats

#

it

timid quartz
#

yep.

#

trust me.

#

I looked.

#

shit's ass

spare quartz
#

okay

#

blame GNU

#

they're the ones supposed to maintain this

timid quartz
#

not to mention the only way I'm learning some of the ins and outs of this shit is by asking another person

#

of which there's like one other person besides you in the ada community

spare quartz
#

hey i learned this with only learn.adacore

#

it's not that bad trust me

timid quartz
#

idfk how you found out some of the shit you know then

spare quartz
#

reading the files

#

trust me

#

they're a lot more descriptive than you'd think

timid quartz
#

hm

#

ok how to structure

#

main file -> pe record called to read -> pe record delegates to other records that represent parts of the file?

#

main file -> giant procedure that just calls other functions defined elsewhere to read certain parts?

#

a mix?

spare quartz
#

ない限り

#

U+306A : HIRAGANA LETTER NA
U+3044 : HIRAGANA LETTER I
U+9650 : CJK UNIFIED IDEOGRAPH-9650
U+308A : HIRAGANA LETTER RI

#

Han unification is an effort by the authors of Unicode and the Universal Character Set to map multiple character sets of the Han characters of the so-called CJK languages into a single set of unified characters. Han characters are a feature shared in common by written Chinese (hanzi), Japanese (kanji), Korean (hanja) and Vietnamese (chữ Hán).

timid quartz
spare quartz
#

i dunno!!! i ad lib file formats

#

strangest article ever written??

lavish dove
spare quartz
spare quartz
#

@timid quartz figured it out

#

it's not the best solution in my opinion, but it works

#
IETF Datatracker

This document specifies version 1.3 of the Transport Layer Security (TLS) protocol. TLS allows client/server applications to communicate over the Internet in a way that is designed to prevent eavesdropping, tampering, and message forgery. This document updates RFCs 5705 and 6066, and obsoletes RFCs 5077, 5246, and 6961. This document also specif...

#

which is scary looking

timid quartz
#

Also why not just copy the way you did it for your smtp server

spare quartz
#

Because …

#

all remaining copies of the latest SMTP server were destroyed

#

:<

spare quartz
spare quartz
spare quartz
#

That should be 'Read, not Input

#

annnnddd commiteddd

tidal wave
# spare quartz

Hell yeah im gonna print this shit and put it on the wall in my dorm

spare quartz
#

Is the rust compiler really that slow

lavish dove
#

It's just a frontend for every graphics API tho

lavish dove
#

Isn't tls supposed to be handled by os

#

If not why you bothering using a scary looking standard

spare quartz
#

handled by libraries usually installed on the system, like OpenSSL

#

but that's not dependable

spare quartz
#

Task 50: raised CONSTRAINT_ERROR : bad input for 'Value: "�Ѳ=!8P3�#�ilU��(+Qvs�:XM���1/

proud creek
#

i agree

spare quartz
#

￿

lavish dove
spare quartz
#

same

#

it also asks me to restart a few services using it

lavish dove
#

discovered libdrm

#

looks reall cool

#

kek

timid quartz
#

@spare quartz so like....why have out params when you just have functions

timid quartz
#

Oh and before you say multiple return items, I raise you records

spare quartz
#

out of the shower now

spare quartz
#

over just having multiple outs

#

also sometimes it just makes sense like

#
procedure Main is
  Imaginary_Stream : Stream_Access;
  A_String         : String (1 .. 32);
begin
  A_String := String'Input (Imaginary_Stream); -- ??
  String'Read (Imaginary_Stream, A_String);
end Main
timid quartz
spare quartz
#

well duh obviously out needs somewhere to go

#

but if you're using a function that returns a record with multiple fields, you ALSO need to store that record somewhere

#

and then manually := for each field

spare quartz
#

got very good groundwork in place

#
Channel := Example_Stream.Wrap_Stream;
Channel.Enable_TLS;
A'Read (Channel.Stream, BlahBlahBlah); -- Reads from the TLS stream
Channel.Disable_TLS;
A'Read (Channel.Stream_Raw, BlahBlahBlah); -- Reads from the raw socket stream
A'Write ...
lavish dove
#

w

lavish dove
spare quartz
lavish dove
spare quartz
#

ah

lavish dove
#

yeah idk

#

well it worked for me

spare quartz
lavish dove
#

Omh

spare quartz
#

i should probably redo this one day.....

#

esp cause i just started spewing accesses

#

OMG HE'S DOING IT

lavish dove
#

would teh router route traffic without a tcp port

lavish dove
spare quartz
lavish dove
#

w aera

lavish dove
#

routers have ip's ik that theres some weird protocol that will send what port is used

#

idk if router just wont route packets to my pc

#

if theres no port number

spare quartz
#

im sure it would

lavish dove
#

would it go to every pc on my network lol

lavish dove
#

unless its sending to every computer

#

cuz it doesnt know

#

wait even worse

spare quartz
#

hmm

lavish dove
#

oh I could just use ipv6 nvm

#

but that still only covers my house

spare quartz
#

i don't see a clear answer but

lavish dove
#

wont know until I try it

#

im bored and dont want to work on that yet lmao

spare quartz
#

the router would (probably) save what NAT ip called it and send back whatever it gets

lavish dove
#

theres a list of level 4 protocols in /etc/protocols folder

spare quartz
#

no clue what'd it would do on a portless/connectionless packet though

lavish dove
#

wait wtf is nat this sounds complicated

spare quartz
#

network address translation

lavish dove
#

im reading the wikipedia page

spare quartz
#

since the router only has one external ip, and it could have multiple devices, it gives them all their own internal IP and sorts what gets what itself ("router")

lavish dove
#

it looks like spectrum gives my computer an ip specificaly for a single connection and then throws it into a bucket to be reused later when its done

spare quartz
#

yeah

lavish dove
#

but how would that work

#

wait but 192.x isnt in the actual ip header

spare quartz
#

i think it issss

#

at least the one the router sees in the internal network

lavish dove
#

oh nice

spare quartz
#

it just rewrites it to the external ip (nat)

#

and decides who to send it to when a response is back

lavish dove
#

ya

spare quartz
#

maybe it just handles it as if the router is the device?

#

like an ICMP request would have the router be the device handling it instead of a fwd'd computer

lavish dove
#

that sounds like how it actually works

#

but then the router just discards it

spare quartz
#

im talking mostly on ancedotal knowledge so i might be wrong

lavish dove
#

im allways on anecdotal knowledge

#

lmao

#

man I want to just get a bunch of switches and pi's and write an entire network stack lmao

lavish dove
#

NAT

#

im looking at it and everything is just mapping a port to a private/virtual ip

#

it seems like its superseded by some DHCP thing though which my router has version numbers listed for

#

oh nope dhcp is completely different

#

but supersecedes it

#

lol

spare quartz
#

DHCP is for allocating internal ips and some other stuff i dont know about

lavish dove
#

oh

#

the wikipedia page says computers just ask for internal ip

#

over udp with dhcp protocol

#

woah my router runs on linux

#

damn thats actually cool

spare quartz
#

yeah most do

#

a really slimmed down ver

lavish dove
#

headless linux

#

impossible to ssh cuz theres no shell lmao

spare quartz
#

i know theres certain ones you can exploit and open a shell on with stuff like telnet

#

but i've got virtually no exp there

lavish dove
#

sounds like hacker

#

oh damn everyones asleep

#

only my phone and laptop have internal ip's for some reason

#

Dynamic NAT
Dynamic NAT allocates public IP addresses from a pool to devices on a local network on a first-come, first-served basis.
but from reading this doesnt seem true

#

damn I jsut realized thats ai hallucination lmao

spare quartz
#

was this from google search ai

lavish dove
#

it was below it

#

from some random website

#

taht was probably ai generated lmao

#

crazy cuz i tried doing the chatbot thing on my rtx 2050 and it ran faster than chatgpt.com and was smarter lmao

#

yeah nat's built on ports

#

nat wont be helping the packet get to my pc

spare quartz
#

router either discards/handles it itself then

lavish dove
#

i think it either discards or broadcasts it

#

idk how it would handle it tiself

spare quartz
#

the only one i know where it'll handle it is icmp

#

a ping request for example

lavish dove
#

oh eah

#

I cant send data over icmp though

#

wait Ican but it will allways end up at the router

#

and is meant to be garbage anyways

#

wait I forgot

lavish dove
spare quartz
#

Pasting some links here for safekeeping

#

and don’t even THINK about calling me a rust… user… just cause your language is interesting doesn’t mean I’d ever use it!!!(*)

lavish dove
#

Haha

timid quartz
#

atp why are you stealing katsumi’s pfp

#

@lyric mesa PFP theft

lyric mesa
timid quartz
#

atprustages

proud creek
#

rust virus

timid quartz
#

you should get infected too

lavish dove
#

I tried to infect myself but there too many compile errors

spare quartz
#

this was my idea…….

timid quartz
#

Terry learned that the hard way

spare quartz
spare quartz
proud creek
spare quartz
#

hmm

#

it is time... to write

spare quartz
#

alright

#

ive had a brilliant idea

#

no more +1 or -1

#

update nevermind its bad!!

lavish dove
#

and I still go to stackoverflow because chatgpt will hallucinate answers for me

#

like I actually haved to wrestle with chatgpt to get useful answers on some random things

#

but ollama exists and llama feels smarter

#

or atleast its been more useful

spare quartz
#

Floating point exception (core dumped)

lavish dove
spare quartz
#

normal division doesn't prescribe a value for dividing by 0

lavish dove
#

it just 0

spare quartz
#

no, it's undefined

lavish dove
#

oh

#

isnt that 0

spare quartz
#

undefined is undefined

lavish dove
#

undefined is nothing is zero is 0

spare quartz
#

okay undefined is something

lavish dove
#

woah

spare quartz
#

it's just... not defined, it's not a usable value

lavish dove
#

I looked it up

#

why does divide by zero give a page fault

#

lmao

spare quartz
#

wha

lavish dove
#

I was looking in the manual

spare quartz
#

it's supposed to give an fpu error 😭

lavish dove
#

no this is normal division on like rax or something

spare quartz
#

oh

lavish dove
#

without the dont fault bit set or something

spare quartz
#

udiv or whatever

lavish dove
#

why cant we use rax

#

as floating point

#

why does fpu have to be special

spare quartz
#

what exception is DE again

lavish dove
#

divide error

spare quartz
#

it's hardware level stuff they want to be fast instead of just manually doing it with bits n stuff in the regular registers

spare quartz
lavish dove
#

woah theres 512 bit registers

lavish dove
#

im looking at 1.3.6 exceptions in the intel manual

#

and it says " as an example, divide by zero gives an exception" and then it shows a page fault

spare quartz
# lavish dove woah theres 512 bit registers

AVX-512 are 512-bit extensions to the 256-bit Advanced Vector Extensions SIMD instructions for x86 instruction set architecture (ISA) proposed by Intel in July 2013, and first implemented in the 2016 Intel Xeon Phi x200 (Knights Landing), and then later in a number of AMD and other Intel CPUs (see list below). AVX-512 consists of multiple extens...

#

i don't think i have AVX-512 on my computer 😭

lavish dove
#

wait no I was surprsied that they were part of teh fpu

lavish dove
#

well I used to have 256

#

now i have avx-512

spare quartz
#

lemme get my cpuid

lavish dove
#

I dont think the name is avx-512

#

see 4_2

#

sse_42

#

sse4_2

spare quartz
#

i'm pretty sure sse is obsoleted as part of avx

lavish dove
#

oh avx

spare quartz
#
 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl tsc_reliable nonstop_tsc cpuid extd_apicid pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext perfctr_core ssbd ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves clzero xsaveerptr arat npt nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload umip vaes vpclmulqdq rdpid fsrm
#

shhh you don't get to see my cpus bugs

lavish dove
#
                          opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 f
                          ma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misa
                          lignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_
                          pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb
                          sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoi
                          nvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsa
                          ve_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm```
#

I dont have mmx

#

wait I have mmx and you dont

spare quartz
#

hold on are you intel or amd

lavish dove
#

amd

spare quartz
#

oh weird

#

im amd too

lavish dove
#

what cpu

#

Vendor ID: AuthenticAMD
Model name: AMD Ryzen 5 7535HS with Radeon Graphics

spare quartz
#

5500GT,
CPUID reports as

processor       : 11
vendor_id       : AuthenticAMD
cpu family      : 25
model           : 80
lavish dove
#

your newere than me

#

CPU family: 25
Model: 68

#

amd is dropping cpu features cuz compilers jsut arent using them fr fr

spare quartz
#

🙏

lavish dove
spare quartz
#

yeah but the CPUID should still report the same

lavish dove
#

no hyperv is shit

spare quartz
#

let me get WMIC open

#

oh i forgot this is unbearable to read

lavish dove
#

its cuz your terminal isnt large enough

#

imagine if wmic cpu | notepad works

#

and then you can make the font smaller if itw orks

#

lol

spare quartz
lavish dove
#

aw man

spare quartz
#

forced to use >>

lavish dove
#

why is windows adding so much linux stuff

#

windows isnt linux get over it microsoft

spare quartz
#

wdym

lavish dove
#

windows added sudo

spare quartz
lavish dove
#

and also command prompt doesnt have | but > is from multics I think

spare quartz
#

yeah

#

command prompt is just an MS-DOS emulator at heart though

lavish dove
#

I really feel like it isnt an ms-dos emulator

#

and its more useful than powershell fr

spare quartz
#

i think powershells more powerful

lavish dove
#

powershell is a linux emulator fr fr

spare quartz
#

it's just a lot more clunkier to use

lavish dove
#

well powershell feels more powerful because everythings documented

#

cmd you haved to have advanced knowledge gained from teh depths of the internet

spare quartz
#

(which is really just because microsoft sucks at documenting programs in System32)

lavish dove
#

microsoft docs are shit 😭

#

directx example doesnt even work

spare quartz
#

this sudo sucks

#

it doesn't even open a shell in SYSTEM like PsExec64

lavish dove
#

it gives admin

spare quartz
#

yeah but that's nothing

#

with PsExec64 you can literally delete ntoskrnl.exe

lavish dove
#

dyamn

spare quartz
#

this is what a REAL shell looks like

lavish dove
#

authority/system is crazy

spare quartz
#

you can actually taskkill your own explorer and open the SYSTEM one in your session

#

doesn't last a while but you can technically have a SYSTEM "user"

lavish dove
#

woa

#

windows has root

spare quartz
#

heres an image with the SYSTEM explorer open

#

it's quite broken but apps you installed globally will be there

lavish dove
#

woah

#

wiat

#

intel is workign on a new extension

#

for more registers

lavish dove
lavish dove
#

bro just nonchalantly

#

did that

spare quartz
#

i've done it like once ago

#

years ago

#

i'm 99% sure it doesn't brick my pc

lavish dove
#

imagine if it just sees the file not looking right and copies it

#

when you startup

#

and it would brick if it didnt do that

#

lol

lavish dove
#

why is cuda so shit man

#

like nvidia forces you to fucking use this x thing

#

meanwhile opencl workso n fucking everything

spare quartz
#

huh

#

ntoskrnl.exe isn't a "native application" (it doesn't link to ntdll.dll)

lavish dove
#

well cuh it runs ntdll.dll

spare quartz
#

it does depend on bootvid, hall, and kdcom though

#

no idea what kdcom is

lavish dove
#

com port

#

for debugging

spare quartz
lavish dove
#

windows prints entire event long to com if you have kernel debug on I think

spare quartz
lavish dove
#

no way windows using bios to boot no way

#

lol

#

wait

spare quartz
#

thats gotta be a compat thing

lavish dove
#

I mean microsoft had to change the uefi spec themselves

#

so windows could boot

#

so it was even possible to use eufi

#

cuz it was just so shi

#

lol

spare quartz
lavish dove
#

because they are just so convenient

lavish dove
spare quartz
#

Intel 5-level paging, referred to simply as 5-level paging in Intel documents, is a processor extension for the x86-64 line of processors.: 11  It extends the size of virtual addresses from 48 bits to 57 bits by adding an additional level to x86-64's multilevel page tables, increasing the addressable virtual memory from 256 TB to 128 PB. The ext...

lavish dove
#

thought that went only to 51 bits

#

lmao

spare quartz
#

fsdkmngksmdfs

#

tried to view deps of notepad.exe

lavish dove
#

average behavior

#

HEY I COULDVE USED THIS

#

WHEN I WAS LEARNING PAGING

#

so many shit graphs and then wikipedia just comes up with one

spare quartz
#

yeah wikipedias a really good resource sometimes

lavish dove
#

I didnt even look at 5 level paging because amd doesnt ahve it

spare quartz
#

actually good graphs of whats going on instead of a non-linear weird spec

lavish dove
#

yea

spare quartz
#

no way

#

the funny function

lavish dove
#

dear god

#

harderror

spare quartz
#

user level forced bsods 💪

#

apparently it's a good way to display messages on the screen outside of the usual windows env

#

undocumented though

lavish dove
#

using ntraiseharderror as a way to printdebug

spare quartz
#
#

the way people figure this out is beyond me

lavish dove
#

they dissassemble the entire windows kernel and then read through the assembly and figure out how it works

spare quartz
#

windows.h is already bad and they want to go even deeper

#

oh cool

#

ntdll.dll also provides a little C lib too

lavish dove
#

w

#

libc is legit annoying

spare quartz
#

huh

#

that can't be right

lavish dove
#

and why hasnt intel made a memcopy instruction yet

lavish dove
spare quartz
#

wouldn't surprise me

#

the simple disk format menu was written like

#

20 years ago

#

and hasn't changed

lavish dove
#

1988 is 2 years after windows 1.0

#

also 5/11 5:11

#

5/11 5:11 means its definitely intentional lmao

#

but I cant find anything on what 511 means

spare quartz
#

naw its gotta be some epoch/bit thing

lavish dove
#

and nothing happened on 5/11

lavish dove
#

unless its a memory address

spare quartz
#

what i mean is it might be encoded differently from the usual int

#

like in pkzip

lavish dove
#

why would it be

spare quartz
#

¯_(ツ)_/¯

lavish dove
#

fr

spare quartz
#

im not a pe32 doctor

lavish dove
#

I swear to god its a reference raaah

lavish dove
#

cant find a thing even saying linker timestamp

spare quartz
#

maybe it's in a section? if pe has those

lavish dove
#

it does

#

theres a linker version

#

yeah idk

spare quartz
#

oh wow

#

apparently GNAT statically links executables by default

#

-shared made it go from 3 MB to 281 kb

lavish dove
#

damn

#

tiny ahh windows program

spare quartz
#

oh

#

it also breaks the executable

#

😁

#

at least the one on linux works

#

probably doesn't run cause im missing GNAT on windows

lavish dove
#

oof

#

bruh im gonna compile my kernel with -pie so I dont haved to bother anymore lmao

#

weird ahh virtual memory

spare quartz
#

raised ADA.IO_EXCEPTIONS.USE_ERROR : Unable to get modification time of the file "C:\Users\Adenosine3Phosphate\Downloads\Auto-GCAS_Saves_Unconscious_F-16_PilotΓÇöDeclassified_USAF_Footage.webm.480p.vp9.webm"

#

aaaaaaaaaghhhhghg

lavish dove
#

lmao

spare quartz
#

apparently its an error in these two

#

i just don't know what

lavish dove
#

damn they in the same place

#

now that im trying to compile with pie I haved to somehow convince ld to work

#

oh im not even using ld lmao

spare quartz
#

it looks like this is some sort of windows problem instead of ada

#

apparently with file names using unicode it just errors when trying to get modification time

lavish dove
#


Disassembly of section .data:

00000000 <.data>:
   0:    e9 3b 04 00 00           jmp    0x440```
#

uhm idk if tats position independent or not

#

it does jmp 0x440 as if the program is just at 0 instead of being anywhere it wants

#

cc1: error: code model kernel does not support PIC mode

#

bruh

#

GLOBAL_OFFSET_TABLE

#

WHY DOES THAT EXIST

#

why??

#

apparently x86 has some relative jumping thing

#

so jmp rel 0x40 jumps forward 0x40 ez pz

#

but gcc cant use that cuz gcc is too smart apparently

spare quartz
#

aha

#

found you

#

ohhh

#

it's cause they were using GetFileAttributesExA

#

GetFileAttributesExW ftw

spare quartz
#

compiling gcc for the 9 billionth time

timid quartz
#

@spare quartz what the hell

#

I know that's a lot of images

#

but

#

this shit is little endian apparently/?

#

little endian on 2-byte boundaries

#

also why is it 16#455000# when it should have an additional null byte what

#

Yeah I print the index and it’s at 132 not 133 (starts at 128)

#

Unless it needs to start at index 129…?

timid quartz
#

yeah it does because ADA USES 1-INDEXING

timid quartz
#

@spare quartz is there a fairly clean way to do bit vectors in ada

#

namely reading a bit vector into a record

#

so like

type Flag_Record is record
  Flag_1 : Boolean;
  Flag_2 : Boolean;
  Flag_3 : Boolean;
  Flag_4 : Boolean;
end record;
Flag := 2#0110#;
--  Take binary flag -> put into struct
#

or do you just have to brute force it

lavish dove
spare quartz
timid quartz
spare quartz
timid quartz
#

multiple...full bytes...

spare quartz
#

..?

#

Is the record supposed to be 4 bits, or..?

spare quartz
#

The attribute typ'Deref(expr) where expr is of type System.Address yields the variable of type typ that is located at the given address. It is similar to (totyp (expr).all), where totyp is an unchecked conversion from address to a named access-to-typ type, except that it yields a variable, so it can be used on the left side of an assignment.

#

Oh what

#

Reading the GCC manual and everything in the Ada manual is marked as “followed.” But when it’s onto annex H…

lavish dove
#

bye bye partition

proud creek
timid quartz
spare quartz
timid quartz
#

its 2 bytes mb

#

that one

spare quartz
#

how big is the structure in the file? if it's packed-

#

oh

timid quartz
#

the "Characteristics" is just a bit vector

spare quartz
#

with Size => 16;

#

i encourage you to add a representation clause as well

timid quartz
#

so uhh

#
type Characteristics is record
  --  ...
with Size => 16
with Representation => Unsigned_16
end record;

?

spare quartz
#

a representation clause determines how the record is structured in memory (and stream wise aswell)

#

assuming the file's binary structure isn't packing it in with other data it should read fine

#

(the "record" on the bottom is a rep. clause)

timid quartz
#

ic ic...

#

neat

spare quartz
#

cause otherwise the compiler could theoretically make your record weird in the interest of speed/memory

#

GCC generally doesn't do anything extreme, but... the added assurance is nice

#

also god i'm mad at GCC

#

tried* to compile a mingw cross for 14.2.0 again and it failed like every other attempt

#

all i can do is wait until it's available on apt

#

the shell must grow

timid quartz
#

:haha:

timid quartz
spare quartz
#

ITS NOT A MAKEFILE

timid quartz
# spare quartz
type Characteristics is record
      Stripped_Relocations, Is_Executable, Stripped_Line_Nums,
        Stripped_Symbols, Aggressive_WS_Trim, Large_Addr_Aware,
        Bytes_Reversed_Lo, Is_32_Bit, No_Debug_Info, Is_Removable,
        Is_Net, Is_FS, Is_DLL, Only_Uniprocessor,
        Bytes_Reversed_Hi : Boolean;
   end record;
#

this

#

is gonna be big

spare quartz
#

OH

#

it's one of thoseee

timid quartz
#

y e s

#

any wise words

spare quartz
#

if you want to be lazy and not write a clause out for that

#

with Size => 16, Pack; you can throw these aspects on it

#

of course the compiler can change the structure to whatever it wants, but it shouldn't... hopefully

timid quartz
#

mm

#

compilers like to do funny things sometimes

spare quartz
#

if you're compiling with -O2/3 i don't think it'd try anything silly

#

maybe with -Ofast or -march but i don't think that's likely

timid quartz
#

actually

#

I should write out a clause

spare quartz
#

prepare for tediousness

timid quartz
#

mm nvm there's only one reserved bit

spare quartz
#

oh yeah one thing that won't affect you here but just something you should know

timid quartz
spare quartz
#

you unfortunately can't overlap record fields onto each other in a rep clause (which adds a bit of difficulty when dealing with embedded stuff) but you can always just delegate to using Unsigneds and shifting

timid quartz
#
pragma Pack (R);
for R'Size use 49;

?

spare quartz
timid quartz
#

o

spare quartz
#

a lot of pragmas are obsolescent in favor of aspects (with ...) but certain ones like Warnings are still used

#

scpsl server list error againnnnnn

timid quartz
#

nowhow do I read it...

#

from a stream...

#

nvm

#

...nvmnvm

spare quartz
#

The_Record_Type'Read (Stream, A_Record_Variable) procedure
The_Record_Type'Input (Stream); function

timid quartz
#

"error: component "Characteristics" cannot be used before end of record declaration"

spare quartz
#

show record type

timid quartz
#
   type Characteristics is record
      Stripped_Relocations, Is_Executable, Stripped_Line_Nums,
        Stripped_Symbols, Aggressive_WS_Trim, Large_Addr_Aware,
        Reserved, Bytes_Reversed_Lo, Is_32_Bit, No_Debug_Info,
        Is_Removable, Is_Net, Is_FS, Is_DLL, Only_Uniprocessor,
        Bytes_Reversed_Hi : Boolean;
   end record with Size => 16, Pack;
spare quartz
#

you probably named a field the same as your type

timid quartz
#

OH

spare quartz
#

nono

timid quartz
#

yeah I did

spare quartz
#

the- yeah

timid quartz
#

teehee

spare quartz
#

so anger

#

vsc rich presence shows the adb as a text file

timid quartz
#

aaand it didn't work right

#

h i typed all the bits in order

#

maybe I have to type them in reverse order...

#

because little endian...

#

wait no

spare quartz
#

is the file in LE?

timid quartz
#

if it's LE then the lsb should be the first one

#

maybe the file is BE

spare quartz
#

if the structure is right i'd say just use a rep clause

timid quartz
#

no PEs are LE

spare quartz
#

the more i type the more i think im gonna be kicked from this server for being afk

timid quartz
#

...I might have to

spare quartz
#

(will not change endian)

timid quartz
spare quartz
#

actually no it will change endian huh

spare quartz
#

what's the record showing in binary, and whats the actual value

timid quartz
#

how can I print the record as binary lol

spare quartz
#

either Unchecked_Conversion or just 'Image it and type it out

timid quartz
# spare quartz either Unchecked_Conversion or just 'Image it and type it out

(STRIPPED_RELOCATIONS => FALSE,
IS_EXECUTABLE => FALSE,
STRIPPED_LINE_NUMS => TRUE,
STRIPPED_SYMBOLS => FALSE,
AGGRESSIVE_WS_TRIM => FALSE,
LARGE_ADDR_AWARE => TRUE,
RESERVED => FALSE,
BYTES_REVERSED_LO => FALSE,
IS_32_BIT => TRUE,
NO_DEBUG_INFO => FALSE,
IS_REMOVABLE => FALSE,
IS_NET => FALSE,
IS_FS => FALSE,
IS_DLL => FALSE,
ONLY_UNIPROCESSOR => FALSE,
BYTES_REVERSED_HI => FALSE)

spare quartz
#

00100100 10000000

timid quartz
#

though if I read an Unsigned_16 it shows a different value

spare quartz
#

oh?

timid quartz
#

I think

#

lemme check

#

2#1000101110#

#

how can I make it output all the bits

#

and not trim

#

cause it omitted like 6 zeroes

spare quartz
#

i dunno, string ops or something in integer io

spare quartz
#

what about the parent record

timid quartz
#

the parent record doesn't have a size attribute

spare quartz
#

are you reading into it or just reading it entirely

timid quartz
#

I'm manually reading the other fields in the parent record

spare quartz
#

hm

timid quartz
spare quartz
#

yeah that's really weird

#

if you can't figure out what bits its reading off, just use an unchecked_conversion

#

(i'd reccomend putting the unchecked conv in a custom 'Read)

timid quartz
spare quartz
#

what is

timid quartz
#

using the conversion thing

#

idk why it's misreading bits tho

spare quartz
#
function Convert is new Ada.Unchecked_Conversion (Source => Unsigned_32, Target => Characteristics_Flags);
...
H.Characteristics := Convert (Unsigned_32'Input (S));
spare quartz
timid quartz
#

Unsigned_16

#

yeah I do know

spare quartz
timid quartz
#

it appears to be the correct place

spare quartz
#

hmm

timid quartz
# spare quartz hmm
coff_header.adb:1:09: warning: unit "Ada.Unchecked_Conversion" is never instantiated [-gnatwu]
coff_header.adb:11:16: error: subtype mark required in this context
coff_header.adb:11:16: error: found "Unchecked_Conversion" declared at a-unccon.ads:20
coff_header.adb:11:38: error: incorrect constraint for this kind of type
coff_header.adb:21:28: error: expected type "Characteristics_Flags" defined at coff_header.ads:5
coff_header.adb:21:28: error: found type "Convert" defined at line 10
#
   procedure Read_Header (S : Stream_Access; H : out Header) is
      type Convert is
        new Ada.Unchecked_Conversion (Source => Unsigned_16,
                                      Target => Characteristics_Flags);
   begin
spare quartz
#

it's a generic function

#

you have to use function

#

not type

timid quartz
#

ok this time

#

it read the thing correctly.

spare quartz
#

neat

timid quartz
#

is executable: TRUE

#

ughh that sucks tho unchecked conversion bad.

spare quartz
timid quartz
#

I could force alignment to 1

spare quartz
#

but think about the poor cpu!!!!!!!!

timid quartz
#

nvm there is no such...

#

attribute..

spare quartz
#

the names a bit misleading though, its more like Unchecked_Copy

timid quartz
#

do I still need with Size => 16, Pack; here?

spare quartz
#

yes

#

otherwise copying the unsigned_16 into the record may produce weird results

timid quartz
spare quartz
#

(you might get a trinary boolean!!!)

timid quartz
#

computers should have used base 3...

#

No/Maybe/Yes

spare quartz
#

technically valid in ada.... up until you use it

timid quartz
# timid quartz

I may change this and similar to use the fancier method though

#

with the funny clause

timid quartz
spare quartz
#

most likely an example type of Boolean with size 1

timid quartz
#

custom type then...

spare quartz
#

but its not needed cause you're on an LE computer

timid quartz
#

ill flip ur bits

spare quartz
#

timid quartz
#

type Bit is mod 2 ** 1 with Size => 1;

#

hm

#

that should be ok

spare quartz
#

(you could've just said new boolean 😭)

timid quartz
#

smh

spare quartz
#

but that's fine if you're expecting to do like, ...

#

shifts or rotations on a bit type ...

timid quartz
#

maybe

#

idk

#

also grr where is Low_Order_First_Unsigned

spare quartz
#

que

#

if you're talking about a type i don't think it exists anywhere

timid quartz
spare quartz
#

just use the regular Low_Order_First as its argument

#

what're you using it on

timid quartz
#

oh

#

CONSTRAINT_ERROR

timid quartz
spare quartz
#

(i've never really known what bit_order was for in all seriousnes.........)

spare quartz
timid quartz
#

raised CONSTRAINT_ERROR : coff_header.ads:7 invalid data
Load address: 0x1086bf000
Call stack traceback locations:
0x1086c0a57 0x1086c0bd3 0x1086c0346 0x1086e5007 0x7ff803c382cb

spare quartz
#

INVALID DATA!!!! THIS MF HAS A GOOFY BOOLEAN 🚨

#

also wow your stacktrace is... weird.. are you using symbolic traceback in your binder

#

or do you intend to use addr2line

timid quartz
#

idfk

timid quartz
#

sadge

#

uGHHH unchecked_conversion it is...

spare quartz
#

i might try and write an exe reader myself to see if i could try and get something working
-# in rust

#

but not now!!!!

timid quartz
#

IN RUST!!

#

you should do ada lsp first

spare quartz
#

❌❌❌❌❌

#

yeah sure

timid quartz
spare quartz
#

i would ask if i should use libadalang or try and make my own parser but like

#

nopppeee

timid quartz
#

ugh if only this was C

spare quartz
#

libadalang is >6 years old and they haven't even completed it

timid quartz
#

C structs map so cleanly onto memory

spare quartz
#

so do ada recrods...

timid quartz
#

Obviously not…

#

Can’t even map a bit vector corrrctly

spare quartz
#

i think you just need a few more aspects

timid quartz
#

like what

spare quartz
#

umm

#

size.. objec_size...

timid quartz
#

is this in bits or bytes

spare quartz
#

bits

timid quartz
#

Size => 16,
Object_Size => 16,
Bit_Order => System.Low_Order_First,
Pack;

spare quartz
#

more aspects bro.... more aspects.......

#

in all seriousness i really don't know why it's not representing right

spare quartz
#

forgot to say this but when i said a custom 'Read i mean like

#
for A'Read use Custom_Read;
timid quartz
#

ah ic

spare quartz
#

where Custom_Read is a procedure that follows the semantics defined by 'Read

timid quartz
spare quartz
#

im too scared

#

there's probably gonna be a programmer with 90 years of experience saying my computer is all wrong

timid quartz
#

what size is boolean anyways

#

its probably like

#

2 bits

spare quartz
#

like 1 or 8

timid quartz
#

honestly it might be 8

spare quartz
#

i think the Size is 1, but the Object_Size is 8

timid quartz
#

grrrrrrrr maybe that's why it's not representing right

spare quartz
#

REMINDS ME

#

if i ever do a third jvm

timid quartz
#

coff_header.ads:6:61: error: Object_Size must be 8, 16, 32, or multiple of 64

spare quartz
#

i should decide wehter to -

spare quartz
#

well thats interesting...

timid quartz
spare quartz
#

i dunno!!!!!

#

just keep using unchecked_conversion

#

it's probably the best bet

timid quartz
#

ugh unchecked_conversion is CRINGE

#

it's UNCHECKED

spare quartz
#

and????

#

your record consists of bits it's not like it'll care

timid quartz
#
typedef struct {
  unsigned int flag1 : 1;
  // ...
} characteristics_t;
#

i bet this would work just fine

spare quartz
#

flag1 is an int!!!

#

misalignment incoming!!!

timid quartz
#

yeah but : 1 dictates size

spare quartz
#

uggghhghhghghg

#

hold on

#

lemme try something

timid quartz
#

im going to bed but I will watch

spare quartz
#

0b1110001100011100

timid quartz
#

I have 2 pages of Japanese to write by Wednesday morning diesghost

spare quartz
#

bayachao reference

timid quartz
#

anyways what are you trying hmm

spare quartz
timid quartz
#

I swear I always have issues with bit vectors/fields in languages that aren’t C

spare quartz
#

this is the one thing ada should have in the bag which is why im so confusd about it

#

uhhh crap how do i write binary to a file in shell

timid quartz
#

Google

#

goog

spare quartz
#

mmgmgnfh lazy

#

ill just do it in ada and then siwthc

timid quartz
spare quartz
#

END_ERROR...???

spare quartz
#

oh oops

#

i was deleting the file

#
timid quartz
#

heh

#

Also @spare quartz new css update dropped https://youtu.be/A89FMtIkWKc

CSS just got a brand new official logo. Let's take a look at some of the coolest new features available to HTML and CSS programmers in 2024.

#webdevelopment #programming #thecodereport

💬 Chat with Me on Discord

https://discord.gg/fireship

🔗 Resources

How to deal with CSS https://youtu.be/ouncVBiye_M
Code this, not That... CSS Edition http...

▶ Play video
#

anyways I sleep, I will see your results in the morning

spare quartz
#

weeeeeirrdd

spare quartz
#

okay yeah

#

'Read just seems to be really poor at reading records like this

#

@timid quartz

pragma Ada_2022;

with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO;

with Ada.Text_IO;

with Example;

procedure Basic_Exe_Reader is

   F : File_Type;
   S : Stream_Access;

   R : Example.Example;

begin
   Open (F, In_File, "bbso");
   S := Stream (F);
   Example.Example'Read (S, R);
   Ada.Text_IO.Put_Line ("Checked Read: " & R'Image);
   Close (F);
end Basic_Exe_Reader;
with Ada.Streams;

package Example is

   type Bit is new Boolean with
     Size => 1;

   type Example is record
      A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P : Bit := False;
   end record with
     Size => 16;

   for Example use record
      A at 0 range 0 .. 0;
      B at 0 range 1 .. 1;
      C at 0 range 2 .. 2;
      D at 0 range 3 .. 3;
      E at 0 range 4 .. 4;
      F at 0 range 5 .. 5;
      G at 0 range 6 .. 6;
      H at 0 range 7 .. 7;
      I at 1 range 0 .. 0;
      J at 1 range 1 .. 1;
      K at 1 range 2 .. 2;
      L at 1 range 3 .. 3;
      M at 1 range 4 .. 4;
      N at 1 range 5 .. 5;
      O at 1 range 6 .. 6;
      P at 1 range 7 .. 7;
   end record;

private

   procedure Read_Example
     (Stream :     not null access Ada.Streams.Root_Stream_Type'Class;
      Item   : out Example);
   for Example'Read use Read_Example;

end Example;
with Ada.Unchecked_Conversion;

package body Example is
   procedure Read_Example
     (Stream :     not null access Ada.Streams.Root_Stream_Type'Class;
      Item   : out Example)
   is
      type U16 is mod 2**16 with
        Size => 16;
      function Convert is new Ada.Unchecked_Conversion (U16, Example);
   begin
      Item := Convert (U16'Input (Stream));
   end Read_Example;
end Example;

#

giant message but basically here's what you should do

#

probably should note down 'Read is bad for records in my head somewhere

#

DEFAULT 'READ

proud creek
#

truly limited by our time...

spare quartz
#

i love ada types

#

so clean .....