[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: GIGAPOUT_green.jpg (59 KB, 736x796)
59 KB
59 KB JPG
What are you working on, /l/oli?

Serious edition
Previous: >>>/l/102056521
>>
>trying tensorflow plugin for gstreamer
>the example crashes at runtime
oh I hate this shit so fucking much
>>
>>102091953
https://medium.com/@souravchoudhary0306/exploring-the-inner-workings-of-garbage-collection-in-golang-tricolor-mark-and-sweep-e10eae164a12
sounds straightforward enough
>>
I'm trying to make a YouTube browser in tkinter that will be able to use yt-dlp and then a media player instead of streaming video.
I'm having issues trying to embed the video widget though. And the pip install for tkvideoplayer is broken so I'm seeking alternatives
>>
>>102092039
my constexpr arrays are not constepxr anymore ;_;
>>
this thread is going to get nuked
>>
>process exits
>main thread closes handles and frees pages
>if a worker thread accesses his pages the existing process crashes
>I could devise a complicated setup in which the main thread tries to lock a threads context and frees it
>or I could just close the handle and leave the memory be
Listen, it's not my fault the application doesn't want to return to main, alright?
>>
>>102092530
its constover
>>
>>102092734
do you have a signals system?
>>
>this dumb fucking nigger said "process exits"
>and how the fuck does it exit if not all of the threads exit

larpers are actually incredible.
>>
>>102092801
By the OS? Sure. But why bother, honestly, if all I need to do is to make sure the FDs are properly flushed and closed? Let the threads write into invalid FDs; it shall not bother me.
>>
>>102092871
Did he mean "child process"?
>>
>>102092871
You not knowing how process cleanup works is showing.
>>
>>102092734
Unix systems are "Worse is Better." Threads were bolted on and not done properly. I can tell you're using C and Unix or a Unix-like OS because no other OS has this problem.
>>
>>102092921
>I can tell you're using C and Unix
You would tell wrong. I know what the problem is, and that it's a me-problem. I was merely thinking about the best course of action.
>>
Whats something I can program on my own that is considered advanced in C# but at the same time won't take a long time to make and requires only 1 person to develop?
>>
>>102092986
Acceptance that you're meant to wageslave.
>>
>>102092901
i have written process cleanup nigger, i have a pexit call that simply sets sigkill on the calling thread's father process.
Then the scheduler code is going to check for that on get_next_thread().
Threads dont need to deallocate anything because i go through the pagetree and free the memory manually, i do filemappings with a long structure pointed to by the descriptor entry (loonix had big vulnerabilities with this for a long time)
you are a fucking nigger, god i wish you would just die desu
>>
>>102092921
indeed, unix has weird thread-inheritance shit too like a "father thread" being killed killing all threads it spawned which is just.. ok
>>
>>102093022
Man, those are sure a lot of completely irrelevant words. Unfortunately (for you) I have to flush buffers, so whatever toy project you worked on has no relevance to my code at all.
>>
not to say htat somehow thread attribtues inheritance is silly... you never fucking know on dpt.
>>
>>102093072
and because i am an actual programmer i flush buffers by setting cr3 you dumb nigger
actually get the fuck out of my face already, you cant into concurrency
>>
>>102093090
>i flush buffers by setting cr3
That's nice, but I'm talking I/O buffers. Y'know, so that output that is meant to be written to an FD actually gets written, rather than dying together with the process? Yeah, I figured your toy project didn't have to deal with those. You probably just flush always, like the neanderthal that you secretly are.
>>
>>102093138
how hard could it be for you to just set SIGBLOCK and release it when an IO is done? retard.
>>
>>102093223
Sure, I could do that. But I'm not going to, simple as that.
>>
>>102093138
>>102093223
>say you are not using C and Unix or a Unix-like OS
>you are actually using C and Unix or a Unix-like OS
Why do C programmers lie like this?
>>
>>102093265
You not understanding reality doesn't mean people lie to you, my dear schizo-kun.
>>
>>102093265
offer an alternative to IO segmentation
>>
>>102093280
What did you say before? Let me remind you.
>>102092981
>>I can tell you're using C and Unix [or a Unix-like OS because no other OS has this problem.]
>You would tell wrong.
So you said you were not using C and Unix or a Unix-like OS, now you are saying things specific to C and Unix.
>>
>>102093265
>WEEEEEEEEEEEE SIGNALS ARE UNIX YOU ARE NOT LE CREATIVE
unix ate low-hanging fruit, should i starve because of ideology?
>>
>>102093356
when was C even mentinoed? go write context switches in python i guess.
>>
just use a sane language and RAII
that's literally all it takes
hell, fucking use __atttribute__((cleanup)) instead of whatever the fuck you are doing
>>
>>102093356
>now you are saying things specific to C and Unix
No, anon said those Unix-specific things. I can intercept the exiting process, and I could wait until I/O has been completed, but I won't do that.
>>
>>102093370
>>102093265
flags signals mutex atomic deregister upwoot firefox.
>>102093331
it was always all just Mozilla
>>
>>102093385
Do destructors get called for global objects upon exit? Because if not, then your post is 100% worthless.
>>
mailing
>>
File: 1724689900540.jpg (169 KB, 1434x1096)
169 KB
169 KB JPG
Is asdf trustworthy? I've been working on projects written in different kinds of languages (Kotlin, Python, Node) and usng different CLI tools to manage each project separately (sdkman, nvm, pyenv). I can't containerize them for now, so i wonder if switching to this would be more appropiate.
>>
>>102092039
>tranime picrel
>/l/oli
i aint telling you shit faggot op
fuck your gay ass thread
>>
I am confused about what's so complicated here, why not use cancellation in your threads
>>
>>102093726
Laziness.
>>
Also if you're doing I/O on Windows there are many better solutions than just making loads of threads
>>
>>102093799
I don't have a choice about the number of threads. The only important thing here is that their outputs get flushed once before the end.
>>
>>102093799
thank you fellow redditor, upvoted!
>>
>>102093543
1. we've largely moved past global objects as a species
2. yes they are
>>
>>102093908
No they wouldn't. Only the pointer that goes out of scope gets destructed.
>std::vector
Over my dead, cold body.
>>
File: 93287409823.jpg (417 KB, 750x750)
417 KB
417 KB JPG
Is it okay to code in bed?
>>
>>102093908
>we've largely moved past global objects
>>
File: almost_32_bytes.png (24 KB, 840x302)
24 KB
24 KB PNG
Reminder that C++ and Rust can't write a simple ASCII line without falling all over each other.
>>
>>102094832
post the original code that compiled to this
>>
>>102094985
That IS the original code.
>>
>>102094985
just ignore the retarded wintoddler, he's optimizing memory accesses for... Windows terminal to take 10 seconds to print one line. https://github.com/microsoft/terminal/issues/10362
>>
>Windows terminal
At least you haven't lost your ability to make up utter nonsense. Really makes it easy for everyone to laugh at you.
>>
>>102093543
libc provides atexit that allows you to register stations in a global state that get called on exit, what do you think?
>>
File: file.png (59 KB, 696x701)
59 KB
59 KB PNG
>Some guy shits on my open source project
>"I'm going to fix [all of the tradeoffs that make my project fast], and I'm going to make it faster [despite making premature architecture decisions that make O(n^2) the best case performance]!"
>It comes out
>It's 500x as slow as my plugin
>Still gets attention, he claims he isn't going to sleep until it's faster
>A few months out
>I stole all his features
>I doubled my performance again out of spite
>He hasn't updated it in a month
>His last update was complaining about "premature optimization"
This brings me joy
>>
File: final_version.png (35 KB, 1530x968)
35 KB
35 KB PNG
>>102095239
You sound like someone who would be good at writing a registry dumper that finishes in less than 10 seconds.
>>
>>102095279
Good job anon, I don't know if I could do it in 10 seconds but I bet I could do it faster than the other guy
>>
File: absolutely_disgusting.png (90 KB, 1903x970)
90 KB
90 KB PNG
>>102095307
You won't know until you try. Previous versions ran for 16 minutes.
>>
>>102095239
yeah, but did you consider that I just spammed pip install, node install, and chatgpt'd my way to doing that without even needing to set down my mouse to type?
>>
>>102095239
based
>>
>be me
>using shitty project
>doesn't have any of the features i need
>could really do with it being 50% faster
>make some shitty ripoff in a couple of hours
>make some posts about how much better it is
>the retard falls for it
>>
>>102095403
Thanks for the free motivation and dopamine, sucker
>>
File: file.png (235 KB, 450x442)
235 KB
235 KB PNG
>>102095351
>>
>>102095279
are you using the win32 api to query the values? wouldn't it be faster to just parse out the data yourself from the binary file directly?
>>
File: permission_denied.png (2 KB, 342x974)
2 KB
2 KB PNG
>>102095464
Good idea. Why don't you try that out yourself and tell us how that went?
>>
File: >see a wintoddler ITT.jpg (7 KB, 247x204)
7 KB
7 KB JPG
>he can't read files from """his""" system
KEK
>>
>>102095531
Wtf? Its literally a fucking metal box how dare it claim it is acting on behalf of some superior authority to me
>>
>>102095531
is this one of the retarded file locking issues on windows? lmao
>>
File: nt_authority.png (2 KB, 264x128)
2 KB
2 KB PNG
>>102095563
It's the kernel, stupid.
Seriously though, if you find a way I'm all ears.
>>
What does it mean to be "proficient" in a programming language? Does that mean to know the basics in a programming language? How do you prove you're proficient in a programming language?
>>
>>102095638
Registry dumper.
>>
>>102095616
so it is a retarded windows file locking issue lol. i dont think anybody has trouble reading /proc/ on linux on other hand...
>>
>>102095701
>he doesn't know about the NT namespace
You have a lot to learn.
>>
>>102095616
>It's the kernel, stupid.
I dont care what it calls itself i dont bow to it
It will obey me or I will break it
>>
File: easy.png (2 KB, 462x42)
2 KB
2 KB PNG
>>102095735
Easy.
>>
What do you need a registry dumper for
>>
>>102095616
Write a kernel driver which exposes it as a serial device?
>>
>>102095928
it's xer autistic useless passion project
>>
File: dump.png (89 KB, 1894x989)
89 KB
89 KB PNG
>>102095928
Find out what has changed in between two dumps.
>>
File: what_the_actual_fuck.png (42 KB, 1076x952)
42 KB
42 KB PNG
>>102095946
I'm not gonna touch the kernel with a ten-foot pole. Windows userspace is retarded enough for my tastes.
>>
Print out your entire registry on paper and decorate your room with it
>>
>>102095950
aren't you worried abut leaking something important with all these screenshots you're posting?
>>
File: format.png (148 KB, 1894x966)
148 KB
148 KB PNG
>>102095983
No, I know which type of information may be compromising. This stuff is harmless.
>>
>>102096012
An actual value your project could provide would be documentation for register data that is or could be used for fingerprinting a machine or that otherwise has opsec significance. I have to imagine Microsoft has a lot of treachery hidden in plain sight.
>>
>>102095983
like the numeric user id? lol
>>
>>102097446
If that fingerprint doesn't change, then how is anyone to find it except directly comparing dumps from different machines? Who would trust each other with that information?
>>
File: 1723746565863917.jpg (151 KB, 670x632)
151 KB
151 KB JPG
>>102095972
>>102096012
>>102097786
on linux this is just
ls /etc
>>
File: 1724708220622.jpg (473 KB, 1920x1760)
473 KB
473 KB JPG
>>102095447
What does Fire Man has to do with this meme though
>>
File: adventofregex.jpg (150 KB, 918x371)
150 KB
150 KB JPG
more like Advent of RegEx, amirite
>>
I just realized that my function call is ambiguous.
I allow function declarations with a "main" param and n secondary ones, in which case the call syntax becomes mainarg@function(otherargs). I was also allowing the traditional call syntax function(args). the ambiguity is that a@b(c) could both be the application of b with arguments @a and c, and the application of the output of the functor b(c) with argument @a.
now, how could I adjust the syntax? at the moment I'm leaning towards adding a "call" keyword for functions without a mainarg, so in the functor's case you'd have to type a@(call b(c)). my reasoning is that I predict most function definitions will use a main argument so I'd rather add syntax to the less used type of call
>>
>>102092086
making it work was left as an exercise to the reader
>>
>>102098661
classic rubber duck moment, I realized that I can reuse the @ symbol, this time as prefix, instead of "call"
>>
Rust syntax is better than C++ syntax, it's beautiful, stop rejecting the truth
>>
>>102092039
What do you think when you see someone use -fpermissive?
>>
>>102098826
lisp syntax is better than rust or c syntax
>>
>>102098880
doesn't everyone use fpermissive? locking yourself to one compiler seems like a kind of shit idea. it's not like you're the linux kernel where you need to own and modify your own compiler
>>
nevermind i didnt know the full effects of the flag, i thought it was just "you dont need to declare extern stuff"
-fpermissive considered harmful.

>>102099355
>locking yourself to one compiler
I dont know much about msvc but at least on linux everybody has both clang-llvm and gcc installed
>>
>>102098826
>rust syntax is better than [the abominable black speech of mordor]
the lowest of low bars
>>
blessed digits are about to arrive
>>>102099999
>>
>>102092039
I need help with C my dudes.
Is there a way to simplify this, so I wouldn't have to type printf("The X is %f", answer); for every case?
>>
>>102099778
const char *str;

...

case '+':
answer = firstNumber + secondNumber;
str = "sum";
break;

...

// At the end
printf("The %s is %f\n", str, answer);
>>
time to peel the veil and see that because the compiler cant generate splicing it is going to bloat the binary to have 20 copies of the same string when you scale up
>>
>>102099820
Thanks. I had that idea but it wasn't working, didn't realize I needed an asterisk.
>>
purge generals from the catalog
>>
>>102099946
This thread hardly gets any posts anymore so it's not even really a general
Ironic that it's dying the same death as /prog/
>>
How much time do you program a day? I just started a new wage slave job and don't have a lot of time.
>>
>>102100053
I stopped a long time ago but not immediately when i started waging
I have 0 motivation to complete projects, its probably the caffeine
>>
Worshiping Moloch works but at what cost?
>>
this is going to sound austistic, brace
but what language is arguably the easiest to go from having an idea in my head to pounding it out onto code, skipping as much of the design process and going into protoyping as rapid as possible? I feel like I still spend alot of time putting an idea on paper and then translating that into logic blocks and then syntax when I just really want to straight to syntax and live test the code as I go along. I keep coming back to Python, but is there something even more ready to prototype than Python?
>>
>>102100506
Javascript, duh
Also you should write tests and interfaces before you even write code, TDD, blah blah blah
>>
>>102100270
>its probably the caffeine
Sure keep blaming the coffee. I've been on and off caffeine, sleeping, not sleeping, whatever, and I still program. It's not the coffee.
>>
>>102100053
Every day. I love programming. I was made for this. My open source project is just successful enough.
>>
Just don't ever use the registry. Pretend like it doesn't exist.
>>
>>102100506
Common Lisp
>>
>>102100506
Common Lisp
>>
>>102100506
For me it's C++, but I think the real answer is that the language doesn't matter as long as you know it well and you've done enough programming such that your thoughts natively map to programming-ish constructs. I spend very very little time doing the actual translation from mental model to source code because the mental model already starts out structured pretty much the same as the source code ends up being structured.

Also note that frequently when people say "I want a language that's good for rapid protoyping", what they actually mean is that their mental model is full of massive high level chunks such as "crawl a website and download all the images into folders according to a regex filter", and they're not actually talking about the language semantics at all but rather just looking for something that has a ton of libraries so they can find one that will do exactly what they want with minimal effort. If that's your case then yeah python is probably a good choice. But if the *outer* interfaces of your system - the things that you can do by calling into libraries, etc. - are all already well defined and set up, and you're just talking about translating the mental model pertaining to the *inner* part of the program that you have control over, then I don't think language really matters.
>>
>>102100506
Javascript for web shit
LuaJIT if you need speed
Bash if you need a quick and dirty system script
Python for everything else because of the standard library
>>
Back when I cared about programming, lock-free algorithms were the hot new thing. I've been working in the industry since then, which has completely destroyed my interest in programming, but now I'm starting to wonder, what's the current hot new thing?
>>
>>102100633
How did it work out for you when you pretended that taxes don't exist? Or the day-night cycle?

>>102098826
It's not beautiful, it's not the truth, and it's not better either.
>>
>>102101047
"AI"-"""""assisted""""" ""programming"".
>>
So what exactly is a variable in Python?

is it a class with variables and 100s if not thousands of methods?
>>
my app is working, i started to implement bulk conversion, now that user can turn other formats to webp in bulk
the app will be free and closed source, i don't like licensing problems
>>
>>102102200
are you using winui?
>Encode WebP (bulk)
you are a war criminal
>>
File: 5247069805478011780_121.jpg (102 KB, 1061x718)
102 KB
102 KB JPG
now i need to do some optimizations for very large collections, let say i have 1000 image, so i should create 10 collections from it and run them all in parallel ?
>>102102222
yes i use WinUI 3 (C#), it's nice but i'm not the best ui designer, i'm planning for more ui changes like using a validation textbox to ensure the user use a valid path, changing some icons, adding a few more options etc
there are many things i want to do but for now i'll create an okish ui with good ux then i'll try to improve the ui
some things can be better but i'm limited to libwebp functionalities, i inspired the whole idea from thio joe
https://youtu.be/8czf2lc1nXI?si=3YeQSjPpos_07YtL&t=519
>>
>>102101047
GPGPU for AI but like really abstracted because the mathfags can't handle actually writing GPU code
if you actually want to write GPU code lockfree shit does actually have some relevance considering GPUs have a fuckload of hardware atomic instructions and multiple levels of sync
>>
>>102099953
>Ironic that it's dying the same death as /prog/
im not seeing any le pedophile sage, shitjizz spam, or ads offering me free sex and discount on shoes or jewelry
>>
>>102103763
DESU I could do with some underage sex tourism ads. Not because I would ever engage in it (of course), but simply because I like to watch miserable moralfags having hilarious meltdowns.
>>
>>102100506
clojure. especially the "live test the code as I go along" part.
https://youtube.com/watch?v=C-kF25fWTO8&t=2m18s
>>
File: 1709011404471417.png (866 KB, 1279x720)
866 KB
866 KB PNG
g-guys is malloc good for you?
>>
>__func__ is a string literal, not a token
Why don't we put boomers into concentration camps again?
>>
>>102104270
its shit
use arenas to make your programs simpler and most likely faster
https://www.rfleury.com/p/untangling-lifetimes-the-arena-allocator
https://www.youtube.com/watch?v=TZ5a3gCCZYo
>>
>>102104291
Because the preprocessor has no concept of a function.
>>
>>102104317
If that was the case __func__ wouldn't exist, either.
>>
>>102104311
sugoi!
that man in the video is so handsome I will listen to whatever he says
>>
>>102104322
__func__ exists in the compiler. It's basically as-if the function has a variable called __func__ with the correct value filled out at the top.
>>
i wanted to write a cool program but it sucks and i hate myself for it and i dont have enough passion to fix it
>>
>>102104311
>insufferable fag likes insufferable man
wow how surprising
>>
>>102104581
elaborate
>>
>>102104355
Sounds like a miserable excuse by miserable men.
>>
>>102092039
what's some c# project to get me start in a wageslaving job? (I don't have anything to show in my CV)
I haven't done any significant programming before. I think reading c# and dotnet reference before doing anything might be a good idea?
>>
>>102104585
this guy has a super combative tone on twitter, especially if you tell him that arenas don't actually solve everything. the anon that usually links to him is also an insufferable character who has been shitting up /dpt/ for over a year now with his combative tone and lack of nuance.
>>
>>102104686
>arenas don't actually solve everything
Like?
>>
>>102104713
nigga some things dont have well-defined statically intelligible lifetimes. often you want to cache things and you want to decide how evict things from the cache so that it doesn't take up too much memory, that's actually a form of memory management that arenas unsurprisingly do not solve.
>>
>>102104762
>some things dont have well-defined statically intelligible lifetimes
Sounds you should just place them into a dedicated arena.
>but you can't do that with my hyper-specialized thingamabobs
Like?
>>
>>102104802
>Sounds you should just place them into a dedicated arena.
How does that fix anything? If I have a thing that needs a lot of memory and whether it should be present or not is dependent on user interaction, then how would putting that thing in its own arena be any different compared to allocating a block of memory with malloc and freeing it at some later undecidable point?
>>but you can't do that with my hyper-specialized thingamabobs
>Like?
huh? If you're working on real software with user interaction this is a real problem that you encounter often.
>>
>i don't like the guy because he has super combative
>i will start all my posts from insulting the person im responding to
XD
>>
>>102104888
show me where I hurt you, you poor thing. quote the horrible insults I hurled at you.

now you don't want to argue technicalities anymore btw?
>>
>>102104862
>How does that fix anything? If I have a thing that needs a lot of memory and whether it should be present or not is dependent on user interaction, then how would putting that thing in its own arena be any different compared to allocating a block of memory with malloc and freeing it at some later undecidable point?
its automated you fucking dweeb

the absolute state of /lgbt/dpt

kill this faggot ass thread with fire
>>
>>102104940
what part is automated you fucking dweeb?
>>
>>102104862
>how would putting that thing in its own arena be any different compared to allocating a block of memory with malloc and freeing it at some later undecidable point?
This is what his talk (admittedly) doesn't cover, at least at the point that I'm at, but I'll still explain it:

1) Control over placement. You are the one who decides what is placed onto your arenas, including your dedicated one. There is no indiscernible behind-the-scenes algorithm that may have placed some smaller object right next to your big one that would prevent you from cleanup or decommit.
2) Control over translations. Let's say your big one is so big that you talk Gebibyte ranges, and you have a CPU that was made in the last fifteen years - well, do you feel like constantly evicting address translations because your indiscernible behind-the-scenes algorithm didn't tell the OS that you'd really like to use 1-GiB pages? I usually assume that 4-KiB TLBs only cover 4096 entries (16 MiB coverage at most), which wouldn't nearly be enough for such a big one.

>this is a real problem that you encounter often
For the third time: like???
>>
>>102104568
consider this attempt a prototype to test the waters and start from scratch
>>
>>102104960
the allocation and the freeing you fucking dweeb
also im not a socially awkward person so you might want to find another aggressive sounding yet inane insult for me.
you absolute malingerer
>>
>>102104762
>nigga some things dont have well-defined statically intelligible lifetimes.
just put the thing inside the "longest" closest arena you have
>f I have a thing that needs a lot of memory and whether it should be present or not is dependent on user interaction
no one cares your program will waste some memory, just put everything inside an arena that has a lifetime of the user interaction and thats it
you know sizes don't know lifetimes? use specialized arenas with a freelist
don't know sizes and know lifetimes? put a cap on a size, use arena with a freelist? cant put a cap (or cap is too large) yea you probably need a different allocator
>>
thoughts on codecrafters?
>>
>>102104998
Oh, also:
3) Control over commitment. You're luckily if you don't write programs for it, but your individual fortune doesn't change the fact that Windows is a very popular OS, and that this popular OS's kernel doesn't do background commits - you have to call VirtualAlloc(MEM_COMMIT) yourself if you want some reserved ranged to be backed up by memory, you can't just access the page so that the kernel will commit the memory now. How does malloc solve this issue? By not dealing with it at all, it just MEM_RESERVE | MEM_COMMIT's all memory it returns. Your big one that could end up not being so big in hindsight could've wasted 95% of your 4-GiB allocation because you trusted malloc and were betrayed for it. In contrast your arena can reserve a huge amount of virtual address space in the beginning and then piecemeal the commits with a function that compiles to a no-op on Linux because Linux overcommits per default.
>>
Is "495dd28d-aa61-494b-8613-c802c9095a83" a string or a UUID?
80% of json users got this wrong!
>>
>>102104568
You have to accept that this is part of the process. I'm working on an app and even if it's just a few hundred lines of code, I've had to rehaul the fundamentals three times, breaking everything and making me miserable. Just keep at it.
>>
>>102105000
this attempt is my third time of writing it from scratch
>>
>>102104998
>>102105073
>There is no indiscernible behind-the-scenes algorithm
You are conflating using arenas with just knowing how memory works and being a competent low-level efficiency-oriented programmer that isn't afraid of it.
>Control over translations
>Control over commitment
Same issue... Using huge pages is orthogonal to using arenas. VirtualAlloc and arenas aren't the same thing.
>like???
I already gave you the caching example. Others include streaming in areas in a level, recycling entity memory in a game, concurrent access to some piece of data... Here's a nice CONCRETE example: https://www.youtube.com/watch?v=HIVBhKj7gQU. In the latter part of this talk, the naughty dog guy explains how you'll need to think a little harder than just using an arena if you're trying to pipeline multiple frames.
>>102105004
>im not a socially awkward person
I highly doubt that

Anyway you are peak Dunning Kruger. The freeing isn't automated, and neither is the allocation, because it is undecidable by definition. What difference does it make if you have a single large allocation (think framebuffer or texture) or a separate "arena" that only contains that thing. Either way you have to take special care of the lifetime of that thing, i.e allocate memory and free it at some unknown point in time,.
I won't respond to you anymore because you are confidently and aggressively wrong.
>>102105028
If we had infinite memory, nobody would be talking about this in the first place, no? And if all the memory your program is using can fit in a gigabyte then none of this fucking matters. Just do whatever. But people writing databases for example certainly don't have this luxury.


When did a certain class of programmers start fanboying over arenas so hard? Holy shit. Arenas aren't a silver bullet, neither is OOP or what any programming "influencer" is selling you.
>>
>>102105103
as long as every attempt furthers your understanding of the problem at least you're learning in the best way to learn, though after n attempts it's also normal to just want something good out of your work. when I feel like that I just take the L and look up what are the "proper" architectures and abstractions to use to tackle it, and I'll usually reach for some good libraries if there are any. this second phase is also educational so I don't complain
>>
>>102104762
you showed how much of a brainlet you are.
Physical memory != virtual memory.
Commit 2 gigabytes for your 64byte-per-member arena and boom.
>>
>>102105206
>Anyway you are peak Dunning Kruger. The freeing isn't automated, and neither is the allocation, because it is undecidable by definition
fucking lmao what a retard
stop posting here
delete your computer
take up sheepherding

and now ill make it a non-homonem:
>with arena allocators all you need to do is to create then destroy an arena
>all memory management is abstracted away
>and can happen at random moments without a problem

you are retarded
and therefore you will never achieve anything in life <3
you might as well just stop trying
>>
>>102104802
you are the worst programmer ever kek

>>102104762
that is solved automatically with a timed evict_cycle()
>but i cant into 20 nanosecond syscalls
ok lol
>>
>>102105295
>sad homonem
worthy of a homofag
---

thats lgbtposters for you btw
they reject reality as a mater of sexual orientation
they reject reality in all the other aspects of life
>>
>>102105206
>You are conflating using arenas with just knowing how memory works and being a competent low-level efficiency-oriented programmer that isn't afraid of it.
... and? You specifically asked:
>how would putting that thing in its own arena be any different compared to allocating a block of memory with malloc and freeing it at some later undecidable point?
, and I gave you three reasons why. Two and a half if you're on Linux, even though madvise(MADV_POPULATE_WRITE) can help you avoid context switches due to page faults, which has a similar semantic to MEM_COMMIT.

Or are you specifically asking for arenas allocated by malloc on Linux? Sure, here's number
4) Avoidance of malloc/free calls. They DO have an overhead, specially in a multi-threading environment with allocations that go over the per-thread threshold (see glibc for an example).

>using an arena (singular)
You - you do know you can use multiple arenas at the same time, right? If you know how long the lifetimes of a bunch of objects are you can place those objects into the same arena and free them all at once.
>inb4 but what's the benefit of that
Again, number 4).
>>
>>102101920
No it's an instance of a class, i.e., an object
>>
>>102105295
At least I program, unlike nocodeshitters like you.
>>
>>102105334
Oh, actually there's two more reasons:
5) Overhead. malloc uses a portion of the memory allocated by the kernel to manage its own state, as well as doing alignment padding as the allocator needs to be suitable for all occasions (meaning SSE/AVX instructions, which have aligned accesses). It's small, but they're there.
6) Bugs. Use-after-free and double-use are usually the entry vectors for taking over control of a program.
>>
>>102105355
i program more than you and produce better code than you.
>powerless seething
lol
>>
>>102105456
Proof? No, the voices in your head screaming against reality don't count.
>>
>>102105272
how is any of what you said relevant to the post you're replying to
>>102105277
good job conceding that I'm right. sneed retard. you will never be employed and you will never do anything of note.
>>102105295
what's an evict_cycle() and what does it have to do with arenas?
>>102105334
>>102105419
using an arena to suballocate memory has nothing to do with how you source that memory in the first place. I can malloc a block of memory and suballocate it with an arena.


I liked it better when this thread was filled with beginners who at least weren't so fucking annoying and arrogant. Unironically I think most of the arena posters here are unemployed & underageb&
>>
>>102105481
>you will never do anything of note.
hopefully
i consume my own code so its not like i would want to be noticed mr webshitter who doesnt even know what an arena allocator is
>>
>>102105481
>I can malloc a block of memory and suballocate it with an arena.
Reason 1 (don't control where it's placed, increases chance that reallocation triggers a relocation), 2 (unwanted TLB evictions), 3 (allocation is automatically committed even if you don't end up using all the memory on Windows) and 5 (small, but still) why you shouldn't.
I personally liked it when people actually read other people's posts, unlike you.
>>
>>102105525
>t. lgbtgroid doesnt realize you can batch allocate
you all got dysfunctional egos. also d&k forte
do knitting instead of programming
or idk, become male prostitute. anything but programming
>>
>batch allocate
Has nothing to do with anything.
>>
>>102105525
I was asking about the difference between having a single thing in an arena over a block allocated from malloc or just using malloc directly (there is no difference). I admit I should have been clearer about this instead of just saying that your posts don't actually answer the question. 4 and 5 don't matter because you're doing the malloc anyway. But it would indeed have been better if I had been more explicit in my question.
>>
>>102105574
imagine caring about yous
also its has everything to do with that since you dont resize and you can have a hard cap to how much memory youre using.

youre devoid of imagination, lgbtgroid
a textbook sub 80iq nigger. only white. and without a cock if you went through with the bottom op
>>
what a shit fucking thread
>dpt
>lgbtourists screaming at you abt things they know shit about
kill this thread with fire
>>
>>102105602
>the difference between having a single thing in an arena over a block allocated from malloc or just using malloc directly
Yeah, that would be number 4, avoidance of calls. There's no atomic_forced_read or checks if only one thread exists, iterating through other arenas to find a spot to place your stuff into, no probes or prefetches or anything like that: https://github.com/lattera/glibc/blob/master/malloc/malloc.c#L3011
>>
>>102105660
You are doing exactly one malloc either way. Either you allocate the thing straight-up or you allocate an "arena" for the thing. Either way it boils down to one malloc and one free in this situation. My original point is that there is inherent complexity to having expensive things with undecidable lifetimes and that you cannot magically get rid of it with arenas or whatever else. I think that is reasonably intuitive to say.
>>
We went from osdev Chads discussing operating systems development to retarded larpers discussing memory management.

/dpt/
>>
>>102105660
why the fuck would you wanna do that?
>nuh ill scrounge around for the couple megs thats wasted at the cost of having to make everything thread safe
*sigh/groan*
>>
>>102105707
you started with an lgbthread
so thats what you got
dpt is dead
>>
>>102105707
post your osdev project anon.
>>
>>102105696
So you're talking about a scenario where you only have one object whose lifetime you have to worry about, that doesn't grow or shrink, whose size is already perfect to begin with. Yeah, in that case wrapping that thing into an arena managing malloced memory just adds function call overhead, but that's not because it's just such an incredibly complicated thingamabob, but because it has a, to quote >>102104762,
>well-defined statically intelligible lifetime

You could as well place it onto the stack then, if it was large enough. No need to bother malloc with it.
>>
>>102105789
>that doesn't grow or shrin
actually
that sounds like the perfect job for a batch-allocated arena

you dont have anything to change to the code if you accept negative values
just use one arena for your object and thats it
>inb4 wasted memory
bitch i will kill you with a fork
if youre mem constrained you dont abstract away your mem management
arenas are an organizational measure, not an optimizing one
>>
More of a maths question, but

>exactly store a number in base A, with N digits after the decimal point
>convert to base B

How many digits of accuracy can now be guaranteed?
>>
>>102105886
extremely dependent on how you represent your number internally, and even then, it depends on the actual value of your number.

if youre using floats thats around 8 numbers. or was it doubles? something of that order
you can check that by dividing by 10 and seeing where your number gets wonky
>>
>>102105872
I'm still in search for these hyper-specialized thingamabobs though.
>>
>>102105930
you mean a resizable object?
that would be a structure with a vla at the end
>>
>>102105957
>you mean a resizable object?
No, I mean things for which an arena doesn't solve everything: >>102104713
>>
>>102104311
>arena allocator
So it's just a container for smaller allocations that you can throw away in one step. If you've ever done a more complicated program, you've coded this yourself already. No need to call it the new arena allocator. Old news.
>>
>>102105976
thats a tough one
arenas absolutely suck if theyre used across threads/processes
but then you just use one arena per thread/process
and with shared memory you destroy the arena in the process that created it
>>
>>102106012
>arenas absolutely suck if theyre used across threads/processes
That's not specific to arenas though. malloc has the same issue, with the adage that it's *the* allocator, and as such can't ignore the issue. With arenas you can simply say "don't do that".
>>
>>102106039
yeah...
its really hard to find a situation that would justify saying that arenas are obsolete or plainly wrong, that couldnt be countered with "skill issue" and or "rtfm".
>>
>>102106091
So much for "combative tone" and "lack of nuance", then.
>>
>>102106110
>the C-ultist, when in his natural environment
in an adult conversation, theres no need for either
>>
>>102105735
shitty repo because i cant into open source so i privated it, i will make a ruckus on /g/ when the time comes dont worry.
>>
>>102105723
>lgbthread
politics have fried your brain
I want TTD as much as the next guy but anime is for White Men.
>>
>>102106133
>adult tone
>on a digital basket-weaving board
>>
>>102105996
I write my own custom allocator for any project that isn't trivial. That's the beauty of C, you're not limited by what the inventors of the language came up with.
>>
>>102106145
lgbt includes pedos.
and tranime slice of life posters goon to representations of children.
>inb4 they dont
they dont see a problem with provoking a flurry of goonposting in each one of their threads.
they are pedos. theresfore MAP. therefore lgbt.

>>102106150
wicker is a fascinating material whose working involves spatial imagination and materials science understanding.
>>
>>102105886
i would guess you need a reference number, eg. 256, and then you can calculate in how many bytes you can store that, i think (by looking at hexa and binary) the formula to convert from one to the other is log()√2 rounded down (bases 2-16, lengths 8-2)
>>
File: 1724008493381873.jpg (784 KB, 1200x1698)
784 KB
784 KB JPG
>>102092039
>>
>>102106196
weebs would never touch a child in real life, they went down the internet pipeline of degeneracy because there wasnt a woman around they could fuck but that is different from cutting your dick off and posting yourself jumping on the XXX_DRAGON_XX_COOMERS9000 dildo.
>>
>>102106145
>>102106221
case in point
also:
>nn sexo
used to be funneh and interesting when we didnt have pubes yet.
goonposters just got stuck at that stage of mental development.

don get angry i call you retards.
its a accurate, descriptition you are develompentally retarded
>>
>>102106233
>there wasnt a woman around they could fuck
There were plenty, even considered attractive by most males, that I never cared for.
>>
>>102106197
it is rounded up you homosexual child-diddling frankensteinian retard
>>
>>102106233
from my perspective i dont give shit abt your sexual orientation
i have no problem chatting with a full on degenerate, thats how i learned about how things go in your brains (collectively)

no, its just that you have nothing interesting to say. and i find it boring. also youre very disagreeable people. just like here.>>102106221.
you just cant stand that other people have fun without your involvement.

otherwise feel free to touch all the children you can, and then to get lynched by an angry mob for all i care
>>
File: yes_and.png (28 KB, 120x190)
28 KB
28 KB PNG
>>102106271
>child-diddling
>>
>>102106259
stop eating onions then you lowT fuck

>nooooo but i had to [insert silly activity that failed regardless of how much effort you put in due to unlucky circumstances]
a tale as old as time.
>>
>>102106295
Never had söy in my life.
>>
>>102106283
>get lynched by an angry mob
Now that simply doesn't happen. If it was, then there wouldn't be any incentive to let the child alive.
>>
>powershell
no one man should have all this power.....
>>
>>102103102
how does one begin graphics programming
>>
File: lgbtrashed.jpg (157 KB, 624x827)
157 KB
157 KB JPG
>>102106371
touch grass
>>
File: GV0DGcHXEAEZLfZ.jpg (92 KB, 720x719)
92 KB
92 KB JPG
How can i create a custom smart pointer in C++? Is there any resource online?
>>
>>102106482
See? The state protects us and punishes the assailants.
>>
>>102106574
its another class of crime,
but 95% of murders go unpunished
>>
>daily programming thread
>most of the posts are just two posters yelling past one another
>often both are retarded in equal measure
>weird s*arty and /pol/ rejects derailing the thread with politics and freak talk
>ctrl+f lgbt 10 matches
>everybody is an expert on C and memory management
>but when a first year cs student alberto ravioli vel pastarroni posts his 50 LOC C program the same C experts can't even tell what's wrong with it
>yet they still keep talking about concepts they don't really understand because youtube recommended them a video about it
>probably watched it on their phone
It's like watching a comedy skit.
>>
>>102106645
>dpt thread
>What are you working on, /l/oli?

>nuuuh why are you noticing things
also imagine caring about you's
>>
At least the arena shill has shut up.
>>
File: gandalf.jpg (83 KB, 406x450)
83 KB
83 KB JPG
>>102106680
>t. filtered by arena allocators
what are you even doing here in the first place
if not getting btfod?
>>
>>102106645
>>yet they still keep talking about concepts they don't really understand because youtube recommended them a video about it
projecting much?
>>
>>102106688
Can't btfo me. I'm invincible.
>>
File: kernighan-on-c-3.png (259 KB, 850x400)
259 KB
259 KB PNG
>>102106705
something something saul alinsky rules for radicals
in this case- picrel
>>
File: sudo.png (215 KB, 1600x2000)
215 KB
215 KB PNG
>>102106713
i dont need to lift a finger
you do all the work yourself

its in line with the rest of your inclinations towards self destruction and such
>>
>>102106645
>the same C experts can't even tell what's wrong with it
Are you referring to the omomondo garbage from the previous thread? Because that's what you get when you write your garbage with variable names in a language no one with a triple-digit IQ speaks, and that isn't copy+pastable into a file to run through a compiler to show the problem immediately.

PS: I hope you fail all your classes and become a manwhore to survive on the streets of Rome.
>>
>>102106732
You are just a shit programmer.
>>
>>102106727
>sudo
>Not writing your own superuser command.
weakling
>>
I'm an exceptional programmer. That's why I didn't waste my time on your undebuggable garbage - to teach you a lesson.
>>
>>102106753
>more wild projections
>>
>>102106777
>>102106777
BASED TRIPS OF TRUTH

PASTANIGGERS BTFO BTFO BTFO BTFO
>>
>>102106777
We're all exceptional programmers here, kek.
>>
File: sudo-smug.png (186 KB, 1280x720)
186 KB
186 KB PNG
>>102106775
laziness is a natural imperative for all living beings.
hard work, like putting effort into learning is as unnatural as homosexuality is
>>
Maybe we should start a daily friendly programming general.
>>
>>102106832
dont post moetrash and other lgbt magnets and you will be good
>>
>>102106777
Maybe if you took more lessons instead of trying to teach them you would not be such a shit programmer.
>>
>>102106832
just post fucking GITS
everyone knows GITS
everyone watched GITS
and if they didnt you tell em to lurk more bc theyre newfags

is that really such a fucking problem?
>>
>>102106853
So did you fix it?
>>
>pastanigger still hasnt done his homework
lmao
>>
File: ensh.jpg (21 KB, 600x326)
21 KB
21 KB JPG
>>102092039
working on building a replacement to splunk. fuck you splunk, you cost $1000/1gb minimum.
>>
>>102106900
>>102106916
>so desperate to protect their fragile egos that they immediately created a straw man to distract themselves
That's sad.
>>
Do non-anglo people write code in native?
t. non-anglo who always codes in anglo.
>>
>didn't answer the question
That's even sadder.
>>
they actually get writing shitty algorithms as homework LMAO
insane.
>>
>>102106981
>>102107024
>so assblasted he stopped mentioning the post he's replying to
So not only are you a shit programmer, you are a big baby as well. I guess that checks out.
I genuinely hope you stay just the way you are, and that you keep posting here forever. This is a perfect containment zone for untouchables like you. You stink.
>>
How to beat my lazyness and start to learn coding further?
>>
>STILL hasn't fixed his code
>>
>>102098826
/g/ is full of nocoders that have never even gone fast fizzbuzz in both C++ and Rust so no wonder they don't see the benefits of Rust
>>
>>102106977
I only did so once, it was a project for my govt and the domain was very bureaucratic and technical, so in that particular case it was just better to stick to the exact terminology
>>
>>102092039
i love C++
template <typename T, (T*)(sing_getter)(void), typename Y, (Y)(action)(class... akk_params)>
Y evil_template_monstrosity(akk_params){
>>
>>102107101
further than what?
>>
saves some 30 lines of code
>>
>>102107130
cope
>>
>>102107130
I'll be content with a line of ASCII: >>102094832
>>
>>102107150
further than my current knowledge
>>
>>102107197
>No real answer
You are lazy indeed.
>>
>>102107197
pick a topic and you will get to the creme of the crop in less than a year if you are autistic
You need to have good resilience to confusion though
>>
>only project I can think of building is a gameboy emulator
>have realised I'm not al that interested in emulation, doing a chip-8 emulator kind of scratched the itch

Might try to stand up a simple static blog on digital ocean or something but other than that I'm out of ideas

Wtf do I build, /dpt/?
>>
>>102107322
neural network from scratch in rust, with no dependencies
>>
>>102107316
> pick a topic
what topic?
> You need to have good resilience to confusion though
what confusion?
>>
>>102107228
Yeah. I'd like to beat it.
>>
>>102107322
registry dumper
>>
>>102107378
with arena allocator
>>
>>102107378
>registry dumper
I see this here almost daily, is it really that hard or is it a meme?
>>
>>102107378
>>102107388
witness, the birth of a /g/ meme
>>
File: decimal_writer.png (10 KB, 800x270)
10 KB
10 KB PNG
>>102107392
No one has done it so far and posted about it but I. Make of that what you will. ¯\_(ツ)_/¯
>>
File: double_regger.png (304 KB, 571x525)
304 KB
304 KB PNG
>>102107412
You're way late, mate.
>>
>>102107438
fair, i even saw your picrel on the log but it didnt click
>>
File: stil_not_much.png (10 KB, 700x350)
10 KB
10 KB PNG
>>102107428
I should probably add that there were people who claimed they had worked on it, but didn't provide enough proof for me to consider it being real. One particular nocodeshitter claimed 2 seconds, but surprisingly dropped off the face of the earth when I asked for the size of the dump (should be over 400 MiB in UTF-8 and include as much as system/NT authority has access to, which you can usually get with a CMD launched with the trusted installer user). Most of the time they can't even tell what the most infuriating problem is.
>>
>>102095239
Why did you accept the pull request in the first place?
>>
>>102107322
Nothing, you have no passion
>>
File: 1718771050574889.jpg (9 KB, 225x225)
9 KB
9 KB JPG
How do I find happiness in working on something that doesn't matter to me?
Every time I try getting good at programming, I try to do something practical with my life and it either gets stalled by learning curve, proprietary/undocumented pieces, or cost.
How do I find joy in a shitty but simple virtual project that has no use case
>>
>>102107980
It wasn't PR, he thought he could do better rewriting it from scratch. It's a whole new project.
>>
>>102108136
To be fair, it's not like nothing new can come out of such rewrites. I thought I'd be able to rewrite Skein in AVX2 once upon a time, too. Still got beat by 15%.
>>
>>102108108
You don't, because you are performatively lazy and void of passion
>>
>>102108108
mate you need to get on a high.
The noble high is "passion", then there are dirty highs:
Money.
Intellectual masturbation.
Terry sharing his story.

Pick one or come up with your own, it doesnt really matter why, the only thing that matters is that something keeps you going and the more personal it is the better because nobody, not even God, can take it away while you breathe
>>
>>102108193
Maybe you should end your life already
>>
trips for >>102108193 's suicide stream

>verification not required
>>
>>102108194
I get that, I have many skills and passion projects in other areas, I have been trying to work in programming projects for them where I can but I run out of the will
>>
>>102108108
you're either the kind of person who had fun drawing a picture that he then threw in the trash, or you wouldn't get it
>>
Any VHDL fag here?
I am trying to implement SPI in VHDL (currently the slave) and I feel like I don't really understand some signal handling.
I want to only watch for SCLK when nCS is 0. ChatGPT told me something like this:
process(SCLK, nCS)
begin
if nCS = '0' then
-- Clock edge detection and data latching only when nCS is active
if rising_edge(SCLK) then
-- Handle data capture or processing on the rising edge
end if;
end if;
end process;


Is this "good" VHDL kode? I've never seen something like that to have the rising_edge inside another if
>>
>>102108188
Yeah like I said, I stole some features and it's been good motivation.
The problem is he doesn't take the time to understand tradeoffs. His technical promises make his solution slower, revealed by the smallest amount of testing and analysis. He had a laundry list of minor complaints (now all solved) which he treated like the end of the world and never posted a ticket. He's been hoarding bugs (or just made them up) and saying his software has less bugs (it doesn't).
So I would rather a rewrite done by someone who is willing to analyze the problem and capable of making an actual alternative.
>>
>>102107322
>>102107101
I diagnosis you two with retard. Don't come here unless you're daily programming
>>
>>102095612
Every OS has default file permissions that forbid users from reading and writing system databases that contain other user's data. It's no more retarded than preventing users from reading the password index on Unix.
>>
>>102108525
Probably not synthesizable. In my experience GPT-chan can't write HDL code for shit.
>>
>>102108108
>proprietary/undocumented pieces
I never want y'all faggots complain about undocumented pieces ever again, Jesus
fucking Christ.
>>
>>102108958
>In my experience GPT-chan can't write HDL code for shit.
That's exactly my experience, too. That's why I am asking lmao.
Tfw gotta find VHDL jerb. AI won't take that
I just cheated and will do it like this:
https://surf-vhdl.com/spi-slave-vhdl-design/
>>
>>102109059
>AI won't take that
Most likely the big HDL houses are all trying to make their own fine-tuned LLMs that they're going to charge out the wazoo for so it remains to be seen.
>>
>>102108770
yeah but this happens as root on windows.
>>
>>102108993
nigger we burn those, you cant burn your little binary
>>
swift is such a fucking shitlang, i regret deciding to go for a native frontend so much but i'm too deep in it now
>>
>>102109059
You can model anything statistically
>>
>>102110114
You can simulate almost anything, but not put it practically on hardware
>>
>>102110882
Computers are fast
>>
>>102111222
Very good repeating numbers, but my cock can give white sauce very fast, too
>>
>>102111222
And software is slow: >>102095972
>>
>>102110001
Swift is one of the better modern langs though. What issues have you had?
>>
I'm trying to reverse engineer a WinBatch program for which I don't have the source code. I figured out that there's a function in an auxiliary DLL that's always called with the unobfuscated source code as a parameter.
How do I go about patching the DLL to dump the source code somewhere? Do I have to replace the assembly?
>>
I am going insane here, can someone point me in the right direction.

I implemented the mod function in my own programming language.

mod 10 7 // should return 3


but 50% of the time it returns 7

HOW the fuck does even happen?
>>
>>102112013
>I am going insane here, can someone point me in the right direction.
sure, just let me just grab my crystal ball and take a look at what you're doing wrong
>>
>>102111993
If it's a .NET DLL, it's trivial to decompile it

If you have a native DLL, you need to write your own DLL which exposes the same functions as the original one so it can be linked. I think the tool that can show exported DLL functions is called dumpbin, pretty sure it comes with Visual Studio. Then implement the function in question yourself, make it dump the argument somewhere and replace the original DLL with yours.
>>
>>102112066
I was hoping there is a common mistake when it comes to compilers and doing arithmetic.

If not then I just have to give up because nobody is going through thousands of lines of code of a language some guy on 4chan made.
>>
>>102112013
Skill issue
>>
>>102112095
kek based skill issue poster
>>
>>102112081
It's a native DLL. I tried shimming every function in the DLL, but it looks like there's a few calls to functions other than the one I care about before mine and the program errors out. If there's a way to LoadLibrary my DLL and the original one at the same time and have mine overwrite the other one, I guess that would work but I don't think it's possible.
>>
>>102112082
Is your shitty "compiler" written in one giant function of thousands of lines? Just post the mod function implementation retard
>>
>>102112150
objdump, and make sure that you properly assign the ordinals via DEF file:
LIBRARY DNSAPI.DLL
EXPORTS DnsFree = _DnsFree @46
EXPORTS DnsQuery_UTF8 = _DnsQuery_UTF8 @94
EXPORTS DllMain @95
>>
>>102112013
Try calling it again maybe it will give a different answer
>>
>>102112150
>>102112081
Wait I'm dumb, I can LoadLibrary a copy of the original library and pass off any function calls. Since stdcall pushes arguments on the stack, I don't think I need to care about getting the correct number of arguments for every function except the one I care about.
>>
>>102112298
>Since stdcall pushes arguments on the stack
stdcall isn't relly relevant anymore unless it's a 32-bit binary. If it's 64 bit the first four parameters are passed in RCX, RDX, R8, and R9: https://learn.microsoft.com/en-us/cpp/build/x64-calling-convention?view=msvc-170
>>
>>102112327
It's a 32-bit DLL because my vendor is a dinosaur that is compiling everything in 32-bit in current year
I think it's because they have some legacy Fortran code from the 80s holding them back
>>
>>102112266
There is no mod implementation fuck face. I wrote the mod function in the language itself.

mod a b = a - (b * (a / b))

mod 10 7 return 3 half the time and 7 the other half of the time.
>>
>>102112150
This is a bit beyond my personal expertise, but there's something called an Import Address Table which stores the actual addresses of DLL functions. It should be possible to overwrite the address of a function in the IAT. You can load your own DLL under a different name and then change the address of the original function in the IAT with your function

Or you could also use something like Minhook, maybe
>>
>>102112343
OK, in that case stdcall is relevant. Doesn't change the fact that some DLLs import via ordinals, and that they better match what the importer expects.
>>
File: ryd99o3gvj4y.png (153 KB, 400x350)
153 KB
153 KB PNG
LADS I did it. Compiler bug is fixed. Mod function works now. Thanks for helping.
>>
>>102112356
Hence "compiler", except it's even worse than I imagined.
Inspect the lifespan of the value atoms/objects/whatever passed as arguments.
>>
>>102112356
Then just loop until you get the right answer
>>
>>102112465
>his compiler has a built in mod function
BLOAT
>>
>>102112530
You don't even know what a compiler is
>>
>>102112449
>Compiler bug is fixed.
Those are "fun" where that's defined as "makes you think you're going insane".
>>
>>102112572
It works so I don't care.
Next I am working on implementing closures.
>>
>>102112356
irrelevant but its funny how moving to another register and subtracting the remainder of the division is faster than doing the multiplication stuff again
>>
Today I learned that the best way to rape Intel CPUs specifically is to use the LOOP instruction, which is smaller in general and much faster on AMD CPUs: https://uops.info/table.html?search=loop&cb_lat=on&cb_tp=on&cb_SNB=on&cb_IVB=on&cb_HSW=on&cb_ADLP=on&cb_ADLE=on&cb_ZEN2=on&cb_ZEN4=on&cb_measurements=on&cb_doc=on&cb_base=on

Shame that compiler builders want to keep Intel in the game.
>>
>>102112356
>basic arithmetic is broken
lmao
>>
>>102112682
>subtraction and jcc
>3 cycles of latency
actually unacceptable.
>>
The best way to rape Intel is to use RISC
>>
>>102112737
how does the mmu work in that architecture?
>>
>>102112737
I don't care
I go raw without protection
>>
Please do not hotglue your CPU
>>
>>102112775
Oops
>>102112760
>>
How much would it hurt performance to route all function calls through a global hash map of function pointers.
>>
>>102112737
Or stop dedicating your life to consuming dumb gadgets and never think about corporate politics ever again
>>
>>102112797
yes
>>
>>102112810
???
What does my statement have to do with consumerism
x86 just sucks (I have written an x86 JIT)
>>
>>102112736
Compiler builders' refusal to generate LOOP instructions is an act of terrorism in my book.
>>
>>102112830
I wish you were less dumb
>>
>>102112862
I wish I were less dumb too, trust me
>>
finally almost finished with my app
fixed themes so I can easily add cute themes
now to create a tutorial and some sort of statistics and I can finally launch an actual app
oh and implement payment
I'm so proud bros
also have to redo the entire shitheap of a thing for iPhone
kill me
>>
File: 1721639779860118.jpg (293 KB, 1080x1890)
293 KB
293 KB JPG
>>102112781
Fiiiiiiine, I'll do the next best thing.
>>
>>102112374
>>102112379
So turns out Microsoft wrote a library to do exactly this called Detours.
You write a DLL that contains the replacement function for the one you want to override, use Detours to load the shim, and use an utility called withdll that comes with Detours to force your own DLL to load and activate the shim.
Thus finishes my first serious reverse engineering attempt

pastebin com/5x6ACJVS
>>
>>102112911
explain what's wrong there? what am i looking at
>>
>>102112942
So how is this different than Minhook?
>>
>>102112953
Post tits
>>
>>102112968
They're the same thing from what I can tell, just Detours is official and Minhook started as a way to not pay Microsoft. I just found Detours first.
Detours is open source now so it's not an issue anymore. I guess if you have to worry about the CLA Minhook is still your thing.
>>
>>102112942
You want to avoid doing more complicated work in DllMain. If you happen to cause the load of another DLL your process will deadlock.
>>
>>102112993
>>102112993
>>102112993
>>
>>102112797
not that much
>>
>>102106505
You could look at the various standard library implementations. They do generally have a lot of legacy compatible code however
>>
>>102106713
Invincible? https://www.youtube.com/watch?v=hxsld16TjSU
Beating tired bones? Heavy shield down? Struggling to remain consequential?
>>
>>102112013
Is it stack based? I'd bet that something is popping more off the stack than it should, and winding up with the argument as the output value.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.