[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

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 1732515588111.webm (3.88 MB, 700x400)
3.88 MB
3.88 MB WEBM
Welcome to the Daily Programming Thread. What are you working on, /g/?
Previous thread: >>103273421
>>
how do i enjoy programming? i am trying to learn c++ but i just have nothing to do with it
>>
>>103298554

What is the best way to stop your hands from hurting?

I already have an advantage pro and is still bothers me.
>>
>use cnd_timedwait
>returns thrd_error
>doesn't set errno or give any indication why it failed
c11 was designed by Microsoft trannies in an attempt to kill of POSIX and C.
>>
>>103298560
Why are you learning C++ in the first place?
If you don't have an answer, then of course you won't enjoy it.
>>
>>103298608
i am studying computer science in college and i want to get a programming job
>>
grinding leetcode for an interview

refactoring my baby programming language to use a dynamic array of tokens instead of a doubly linked list, and making it output an AST instead of evaluating directly
>>
God, I don't wanna benchmark this:
memmove(ptr + 0x20,ptr + 0x00,0x1F);
+-------------------------------------+-------------------------------------+
| GCC/clang | My version |
+-------------------------------------+-------------------------------------+
| vmovups xmm0,XMMWORD PTR [rcx] | mov al,BYTE PTR [rcx+0x3F] |
| vmovups xmm1,XMMWORD PTR [rcx+0xf] | vmovdqu ymm0,YMMWORD PTR [rcx] |
| vmovups XMMWORD PTR [rcx+0x2f],xmm1 | vmovdqu YMMWORD PTR [rcx+0x20],ymm0 |
| vmovups XMMWORD PTR [rcx+0x20],xmm0 | mov BYTE PTR [rcx+0x3F],al |
+-------------------------------------+-------------------------------------+

Logic would suggest my version is faster, but who the fuck knows if GCC/clang for once know what they're doing.
>>
>>103298612
why would you want a programming job in this day and age? it's peasant work
>>
>>103298612
Most people hate their jobs, so that's pretty normal.
The only guaranteed way to enjoy programming is to do it as a hobby or have specific non-monetary goals (eg. I want to learn programming so I can make this program that I always wanted to exist).
>>
>>103298632
>>103298635
i would like to make a game cheat in c++ as dumb as that sounds. i would actually enjoy that and i would learn a lot but that seems like a far goal
>>
File: sj.png (4 KB, 737x63)
4 KB
4 KB PNG
>>103298643
>i would like to make a game cheat in c++ as dumb as that sounds
You don't need C++ for that.
>>
>>103298643
that's actually a fine goal and should keep you motivated to learn.
>seems like a far goal
depends what kind of a cheat, if you're not trying to beat state of the art multiplayer anti-cheat systems it's a very reachable goal!
>>
>>103298652
how do i start though? learn all the basics and then look specifically into game hacking? also what what would u say is the best way to learn
>>
File: sddefault.jpg (50 KB, 640x480)
50 KB
50 KB JPG
i want to get in to writing bots for games. not to sell or anything i just think it's an interesting project. something like wow or runescape or final fantasy, where you have these tedious mechanics.
i have previously written scripts to automate boring tasks like using openCV to parse prices and list auctions, but i don't really know how to even approach a more complex problem such as automating the leveling process.
using wow as an example, the way i would do it would be pretty "dumb". like, if i am in some area and accept a quest to kill 10 bears, i could imagine how i could write some code to pathfind to the area where the mobs are or whatever.
then in the area, try to identify a bear and engage a routine to kill the bear. when enough are killed, go back and turn it in.
this approach is very manual, though, and it doesn't seem like solving it would be fun. it would just be a big "if x then y" chain.
do you think i could leverage some sort of neural network bullshit to do this? i've never used any of the object detection / image classifier stuff before.
the idea of being able to build a program that interfaces with a game strictly off of visual input (no exploits) and could pass as believably human to another player sounds cool to me, but i don't know if it's something i'd be capable of.
>>
>>103298667
if you look in the cheating forums, i remember seeing a tutorial for an aimbot in left 4 dead. i never did it, but i think finding some open source stuff like that and seeing how it works would be a good approach.
defeating anticheat is a more complex problem.
>>
>>103298683
that sounds like a lot of code that breaks easily, not something I would want to do without a monetary incentive.
>>
>>103298691
thanks
>>
>>103298727
https://www.unknowncheats.me/forum/programming-for-beginners/267073-coding-hacking-introduction-guide-practical-external-game-hacking.html
>>
>>103298737
bookmarked thanks. should i do some leetcode before diving into this?
>>
>>103298737
Where would you recommend one begin learning C++?
>>
File: 1657338575885.jpg (58 KB, 600x450)
58 KB
58 KB JPG
>>103298560
>>103298612
>>103298643
you don't need C++ for that. What you need is C with a decent knowledge about pointers and win32api. That alone will suffice. In fast, the reason why C++ is a valid choice for this job is because C++ is a superset of C. If C++ overwhelms you, I encourage you to stick to C for the time being and you can jump to C++ whenever you feel like later. You won't be wasting any time or missing anything as all your C knowledge is transferable to C++.

>>103298667
https://guidedhacking.com/
>>
>>103298788
no, leetcode is not needed for doing game hacking at all. It could be helpful but you'll do just fine without it. Just understand what you should be doing first and write code to do exactly that. You don't need to be a pro at leetcode to find some memory address, fetch and manipulate it. As long as you understand the basics of the language, you are good to go. You might need to learn a bit about algorithms if you wan to do an ESP but that's an advanced thing and you won't be needing more than a handful of them anyway so its fine to skip lettcode if you are learning programming solely for the purpose of game hacking.
>>
rvo vs move semantics in c++
>>
>>103298683
I've programmed visual bots for quite a few online games. Depending on the game you can get away with opencv or even with simple pixel clusters which you scan for. It's a lot of trial and error to get it working reliably but once you get it working it will continue working as long as they don't change the graphics.
>i don't really know how to even approach a more complex problem
The difficult part is interfacing with the game. Once you have that you're basically just writing expert systems on top of that to handle pathing / combat / leveling / farming / whatever.
>neural network
Back when I was still writing bots, neural networks were in their infancy and I only dabbled in them. It should be possible to make good use of them but I'm not sure if it's worth the effort.

The best bot I wrote was a custom networked client, had a lot of fun reverse engineering their protocol and reimplementing it. Second best was a bot that read information directly from the process. My visual bots were less reliable overall but they were good for the limited tasks that they were designed to do.

I never got banned for any of the bots I wrote which haven't been released to the public. They literally can't do shit and there are so many ways around their detection systems it's actually funny. From my experience, they can only detect public bots which they have access to.
>>103298716
This is pretty much why I've stopped developing my (at the time) very popular networked bot client that was released to the public. It gets very tedious to constantly keep up with the developers of the game. They try to add new ways to catch your bot constantly and you have to be very vigilant after every update. It was a full time job with part time pay, high risk (constant legal threats) and zero job security. Unless you're making big money it's definitely not worth it.
>>
>>103298788
i think you should get the fundamentals. in school they teach you stuff like data structures, how memory works (stack). how code is converted to assembly, time complexity, etc.
learning by doing is good, but i think i benefited a lot from understanding how a programming language actually turns into actions that occur in the computer. a simple example is, imagine you have a list of lists. {(1,2,3) , (4,5,6) , (7,8,9)}
it's more efficient to iterate over this list by going through the list in a way that is memory contiguous. like, [0][0], [0][1], [0][2], [1][0] ... [2][2]

rather than [0][0], [1][0], [2][0], [0][1], ... [2][2]

but without understanding the fundamentals, you might make poor design choices that eventually become poor design habits, because you don't know any better.
>>
>>103298900
>The difficult part is interfacing with the game
what approach did you end up taking? i've done some research into this and the issue is being able to send keystrokes that appear to be genuine. i've thought about running the game in a VM, or writing a driver that pretends to be a keyboard, but i never actually pursued it that far.
>>
>>103298828
learncpp dot com
>>
>>103298945
unfortunately i have already done a lot of c++ classes but didn't pay attention
>>
File: jiffies.png (194 KB, 1706x668)
194 KB
194 KB PNG
Jiffies? Fucking jiffies?
God damn furries are in my KERNEL
>>
>>103298971
With interfacing I mean figuring out where your character is in the world and objects around you, what you have in your inventory, who you're targeting, and so on. That takes up the bulk of the time and effort.
As for input for the games, it really depends on the game and which platform you use and how paranoid you are about getting banned. It's always a good idea to test your ideas on a throwaway account for a prolonged period at first. I've used different approaches over the years but on Windows I just sent the keys directly and set the cursor position because it was reliable and the games never bothered to actually differentiate.

If I was really paranoid I'd probably run the game in a modified VM and control the game from outside of the VM. Another possibility is writing your own custom drivers or setting up a microcontroller that is physically connected to a mouse and a keyboard but I've not tried that. One of my bots ran inside a nested X server that rendered off-screen on Linux. Wine is another possibility on Linux. There are a lot of possibilities, just get creative.
>>
>>103299118
>my KERNEL
OUR kernel



[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.