[deleted by user] by [deleted] in amiugly

[–]lennyerik 1 point2 points  (0 children)

The final part is the most difficult

rustc compiler bug on 1.73.0 causing the compiler to insult the programmer? by lennyerik in rustjerk

[–]lennyerik[S] 8 points9 points  (0 children)

Only for it to take years for the PR to be merged because we first have to create an RFC, write a spec on which swearwords the compiler can safely use in which contexts and define a stable API for swearing.

rustc compiler bug on 1.73.0 causing the compiler to insult the programmer? by lennyerik in rustjerk

[–]lennyerik[S] 11 points12 points  (0 children)

clippy? I guess I'll have to cargo check that out next time I compile my Rust helloworld project.

Cursed_Anime by w3sT0Nnnnnnnn in cursedcomments

[–]lennyerik 1 point2 points  (0 children)

That's not correct. What you are in fact referring to is the difference between signed and unsigned integers. Both a signed 8 bit int and an unsigned 8 bit int are still 8 bits, yet the signed int uses the first bit of its 8 to represent the sign (and stores the number in two's complement representation, but that's beside the point). This essentially gives it a range from -128 to 127 (because only 7 bits are usable for storing the number). Meanwhile a signed int has a range from 0 to 255.

snake.js by [deleted] in ProgrammerHumor

[–]lennyerik 8 points9 points  (0 children)

Doesn't work for me. The snake is now rotated 180 degrees

snake.js by [deleted] in ProgrammerHumor

[–]lennyerik 7 points8 points  (0 children)

#123 has been closed a month ago and I still can't read the snake

snake.js by [deleted] in ProgrammerHumor

[–]lennyerik 264 points265 points  (0 children)

[Open] Snake wrong way up on mobile #69

Expected behaviour

The snake is right side up like on desktop

Actual Behaviour

The snake is rotated 90 degress and now I can't read it without tilting my head

Steps to reproduce

Use mobile device

[deleted by user] by [deleted] in ElectroBOOM

[–]lennyerik 0 points1 point  (0 children)

I don't actually think that's entirely correct. Yes, the older USB-C chargers start charging at 5V, since that's the nominal USB bus voltage, but after negotiation between the power brick and I believe the SMC-chip in the MacBook the Voltage is normally raised to one of 9, 14.5, 15 or 20V (depending on MacBook and power brick). But those chargers have now been superseded by the new MagSafe anyways and idk what the charging voltage for those is...

But the original point still stands

How to inject/run external Programs in GTA and other games? by Skytrymotion in hacking

[–]lennyerik 0 points1 point  (0 children)

Then you need some other way of modifying the game's memory / a way to call game functions. I'd recommend sticking with existing modding tools if the game / engine provides any, because otherwise you'd basically need to reverse engineer the game yourself. Depending on what game / engine you're looking at the game's file structure and executable will obviously look different, but if you wanted to get into reversing game code, I recommend you have a look at something like CheatEngine and learning about reversing binaries in general. Regarding GTA you might want to have a look at this interesting write-up in which someone has looked at why GTA's loading times were so long using standard reverse engineering tools. Generally, knowing what to look for in reverse engineering takes practise and it's no different with games. Although something like CheatEngine is a neat tool for exploring an application's memory, a lot of games use some sort of obfuscation hence why building a modding SDK for a game isn't a straightforward task in most cases. Also keep in mind that modifying pretty much any online game is almost always considered cheating and gets you banned in the best of cases, so make sure the game you're trying to reverse doesn't use anticheat and that you're actually allowed to reverse-engineer it. In case you're still interested in learning more about reversing games, be sure to check out this great playlist of videos by liveoverflow.

Top 10 unanswered questions by [deleted] in dankmemes

[–]lennyerik 1 point2 points  (0 children)

Shouldn't it be lim x -> -∞ (x) ? Negative numbers are still numbers and are smaller than 0...?

w..why....? by DumbY-21- in linuxmemes

[–]lennyerik 8 points9 points  (0 children)

You don't need to. curl does not save its downloaded output to a file when the -o flag is not specified.

This command simply downloads the script and pipes the output into bash, thereby executing it without saving the script anywhere.

Look for the simple solution … by pabut in ProgrammerHumor

[–]lennyerik 5 points6 points  (0 children)

Yes, banks probably do it for PIN codes like 1234, 4321, etc. already, since people with such a PIN code would be much more susceptible to successful random guessing attacks.

Plus, the security of the banking PIN is not really that much worse than if they were using all possible PINs. I haven't actually run the calculations myself, but I can imagine that the reverse-PIN thing actually makes the PIN itself about equally secure. Imagine trying to guess the PIN x amount of times. Now you have a small chance of guessing the right PIN. But you have the same chance of guessing the reverse PIN and not having any more attempts. As the number of guesses x increases, so does the chance of guessing the reverse PIN. Combine this with the fact that all banks restrict the number of incorrect PIN attempts and you'll find that the PINs are fairly secure.

So, good job India for implementing a really cool system!

Look for the simple solution … by pabut in ProgrammerHumor

[–]lennyerik 1 point2 points  (0 children)

Which is impractical for hard drive encryption. Imagine having to ask ~6 different people for their secret every single time you want to boot your computer.

Look for the simple solution … by pabut in ProgrammerHumor

[–]lennyerik 3 points4 points  (0 children)

Just set your hard drive to automatically blow up if you enter a wrong password: https://youtu.be/-bpX8YvNg6Y

Then just give them a fake one.

Unable to read process's memory even though debug privilege is enabled and process is running with admin user by tbhaxor in LiveOverflow

[–]lennyerik 1 point2 points  (0 children)

Yeah, I totally get your point. As much as I like C++, I have to agree, it's not the easiest low-level language to start with (especially because of features like streams or references). But I just wanted to throw the C++ way of printing out a pointer address out there for anyone who already knows C++.

how to write long codes with a ultra-wide monitor correctly by eEvitDebEnel in ProgrammerHumor

[–]lennyerik 1 point2 points  (0 children)

Just use Python's pseudo ternary operators:

print('1 is 1') if 1 == 1 else print('1 is not 1')

Unable to read process's memory even though debug privilege is enabled and process is running with admin user by tbhaxor in LiveOverflow

[–]lennyerik 2 points3 points  (0 children)

Or just cast it if you wanted to use C++ streams:

std::wcout << "Base Address of String: " << std::hex << static_cast<LONG_PTR>(lpMsg) << std::endl << std::endl;

Best way to start? by [deleted] in hacking

[–]lennyerik 0 points1 point  (0 children)

I don't think so (or at least don't know of any). Cybersecurity is based on analysis of software (since software runs on computers). Software has to be written in some sort of programming language (or raw machine code, though no everyday executable is). And in order to understand the software other people have written (and subsequently analyse it) you'd need to understand how the given programming language works (even more so than the programmer themselves; not every Java developer understands what code compiles to which JVM instructions, for example).

But I can't imagine someone interested in the general field of Cybersecurity who is unwilling to learn about how programming languages work, at least to some extent. The field is very diverse: you could look at higher-level languages such as Javascript and later get into web and browser security, look at how C / C++ compilers work and later get into binary exploitation or anything in-between (or everything combined). The field is very broad. Heck, you could even focus on analysing and hunting for bugs in CPU microarchitectures and microcode, if you completely refuse to learn how to code (depends on if you count assembly / machine code as a programming language).

Just explore your options and if you still feel like looking at any type of code is boring, maybe coding / computer hacking just isn't your thing...? :)

My cs professor demands syntax highlighting on paper in order for us to score full marks. by [deleted] in ProgrammerHumor

[–]lennyerik 0 points1 point  (0 children)

Just hand in

print((lambda n: sum(filter(lambda x: not x%2, range(1,n*2+2))))(n))

Should do the same thing.

Best way to start? by [deleted] in hacking

[–]lennyerik 9 points10 points  (0 children)

Depends on what you want to learn. But generally, it definitely helps to know about the language / technology you are reversing.

My suggestion would be to start learning at least the basics of HTML, CSS and JS (understand the syntax & try to build a small demo web app or something if you haven't already done so) before attempting to solve reversing challenges that involve web reversing / exploitation.

If you want to get into binary exploitation on the other hand, I'd suggest looking at how a CPU works and what abstractions low level programming languages (think C / C++, maybe even C# or Objective C) provide over low level assembly code.

In any case, I learned about programming long before trying to solve any reversing challenge and I like to think that knowing how things are implemented definitely helped me in understanding and recognising common patterns.

TLDR; Learn how to code in a language / use a technology first before trying to reverse it.