this post was submitted on 22 Dec 2023
84 points (90.4% liked)

Piracy: ꜱᴀɪʟ ᴛʜᴇ ʜɪɢʜ ꜱᴇᴀꜱ

54476 readers
408 users here now

⚓ Dedicated to the discussion of digital piracy, including ethical problems and legal advancements.

Rules • Full Version

1. Posts must be related to the discussion of digital piracy

2. Don't request invites, trade, sell, or self-promote

3. Don't request or link to specific pirated titles, including DMs

4. Don't submit low-quality posts, be entitled, or harass others



Loot, Pillage, & Plunder

📜 c/Piracy Wiki (Community Edition):


💰 Please help cover server costs.

Ko-Fi Liberapay
Ko-fi Liberapay

founded 1 year ago
MODERATORS
 

So there are multiple sites&groups that pirate video games especially on PC. I was wondering if there are places on the internet where you find source code for games especially the highly modifiable ones like Half Life 2/Portal and Skyrim. Or groups that crack into the source code of games (or even software in general), not only for PC maybe PS, XBox or mobile too, and share it. I just wanted to see some code samples of games or their engines, maybe I get hooked into video game design. Shout out to Valve for sharing a lot about the creation of Half Life 1

top 41 comments
sorted by: hot top controversial new old
[–] x3i@lemmy.x3i.tech 77 points 10 months ago* (last edited 10 months ago) (5 children)

Well, source code is not sth that you "crack", you can only reverse engineer it (I think it was done with Doom, also OpenRA) or steal it from the company's servers. The use for it is also rather niche, so the risk vs gains ratio is not attractive enough to feed dedicated websites. You can also look at fully open source games like 0AD and check out what they did!

Edit: I stand corrected (thrice); Doom was indeed open-sourced, not reverse engineered. Thanks for pointing out!

[–] CaptainBasculin@lemmy.ml 41 points 10 months ago (2 children)

Doom was open sourced later. An example of a game that got reverse engineered just fine is Super Mario 64

[–] datavoid@lemmy.ml 13 points 10 months ago (1 children)

Or the time the people who made doom reverse engineered super mario 3 for PC, then turned it into commander keen after Nintendo was unimpressed.

[–] scutiger@lemmy.world 1 points 10 months ago

It wasn't quite reverse engineered. They found a hacky way to bypass hardware limitations and basically duplicated the game.

[–] sebinspace@lemmy.world 3 points 10 months ago

I need this to happen to Gran Turismo 4. Series has gone so far downhill since that entry..

[–] SalsaGal@programming.dev 28 points 10 months ago (1 children)

No Doom was made open source, same with most of the old Id games.

[–] Excrubulent@slrpnk.net 16 points 10 months ago* (last edited 10 months ago) (2 children)

I was once at a talk by someone in that company and he straight up said that open sourcing it was a mistake. I assume because that meant they couldn't sell us a thousand versions of it like Skyrim.

No word of whether its ongoing popularity was at all caused by open sourcing it.

[–] gaylord_fartmaster@lemmy.world 21 points 10 months ago

There's no way going open source has done anything but help Doom. I guarantee they've made more money from people buying their old games for the WADs to play with source ports and mods than they've lost money to things like Freedoom.

[–] Mugmoor@lemmy.dbzer0.com 4 points 10 months ago (1 children)

The engine is Open Source, not the game itself. You still need to buy it.

[–] gaylord_fartmaster@lemmy.world 4 points 10 months ago

The game and the engine are both open source. The game's assets just aren't freely available, so you still need an official WAD or an asset replacement pack like Freedoom.

[–] richardisaguy@lemmy.world 24 points 10 months ago* (last edited 10 months ago)

Doom is open source, at least the original ones were

[–] PropaGandalf@lemmy.world 5 points 10 months ago

I think he means leaks provided as torrents.

[–] dillekant@slrpnk.net 1 points 10 months ago

There's also Diablo with Devilution.

[–] backhdlp@lemmy.blahaj.zone 44 points 10 months ago (3 children)

Everything is open source if you can read assembly

[–] mindbleach@sh.itjust.works 21 points 10 months ago (1 children)

Machine code tells you what it's doing. Source code tells you why.

[–] Draconic_NEO@lemmy.dbzer0.com 4 points 10 months ago (1 children)

Only if they wrote why in it though, plenty of people (unfortunately myself included) fail or forget to add meaningful comments or they let their comments go stale when making changes by forgetting to update them (I do it a lot too), and some people also use horrible function names that don't make any sense.

So it only really applies to source code intended to be released where care was made to ensure it would be readable, it might not apply for source code never intended to be public, such as stolen, leaked, or posthumously released. In this case the only real benefit is that it can be recompiled on different architectures provided there isn't a dependency issue preventing that.

[–] lud@lemm.ee 1 points 10 months ago

Source code without comments is still way easier to read than machine code.

And there are very likely comments anyways.

Multiple Devs will work on the same code for years and of course they need or at least appreciate comments.

[–] Draconic_NEO@lemmy.dbzer0.com 2 points 10 months ago (1 children)

But even if you can intuitively understand what the machine code is you'll still need to convert it by hand back into something more portable, or to the machine code of another platform you might want to run it on. There's not really an easy automated way to do that, even when playing dirty.

That's the hard part, getting it into a different form, such as from x86 to ARM or from 6502 RISC to x86.

[–] ricdeh@lemmy.world 3 points 10 months ago

More powerful decompilers would definitely be a very useful application of AI!

[–] IWantToFuckSpez@kbin.social 43 points 10 months ago (1 children)
[–] zaknenou@lemmy.dbzer0.com 9 points 10 months ago

Thank you for sharing!

[–] Sylvartas@lemmy.world 14 points 10 months ago* (last edited 10 months ago) (2 children)

I mean, if you want to see some games' source code you don't have to rely on piracy. As other people have already said, there are open source games, some developers of older games have officially released the source code (notably VVVVVV, doom, and also quake iirc), some devs have released important part of their source code (e g the entire inputs handling code of Celeste).

Additionally, the vast majority of all Unreal Engine games' engine code, including huge AAAs like Fortnite, is in Unreal Engine (duh), which is ~~open source~~ source-available.

[–] PropaGandalf@lemmy.world 9 points 10 months ago (2 children)

UE isn't open source afaik

[–] IWantToFuckSpez@kbin.social 8 points 10 months ago (2 children)

UE is open source as in the source code is available to anyone. But the license isn’t very open.

https://www.unrealengine.com/en-US/ue-on-github

[–] PeachMan@lemmy.world 7 points 10 months ago

Right, but it's best to call that "source available" so the pedants don't crucify you 🙄

[–] Draconic_NEO@lemmy.dbzer0.com 2 points 10 months ago

Yes there is indeed a difference, but for us it makes little to no difference. In the end what matters is that we have it without having to reverse engineer it, which is a slow and laborious process (even when you do it with dirty methods).

[–] Sylvartas@lemmy.world 5 points 10 months ago* (last edited 10 months ago) (2 children)

I knew I was gonna get this answer but still couldn't be bothered to check the correct term so that's on me.

I think you're technically right because the EULA specifies that you basically can't use that code (or a modified version) outside of a licensed UE project, but outside of that it basically is. All the code can be read, the engine and/or its editor and all related tools can be compiled from the source, and you can make pull requests on the official repo.

IIRC it is not actually open source because you can't modify and/or repackage it without epic having their say in it (I think one of the licenses tiers is basically you agreeing to pay upfront + royalties for the authorization to modify the engine's code and ship the packaged version with the project)

[–] Virulent@reddthat.com 6 points 10 months ago

It's called "source available"

[–] PropaGandalf@lemmy.world 2 points 10 months ago

A thanks for explaining. I didn't know that.

[–] RobotToaster@mander.xyz 5 points 10 months ago

UE is source available, not open source.

[–] BotCheese@beehaw.org 6 points 10 months ago (3 children)

From what I understand: During the compilation of the code it becomes unreadable to humans, needing to be reverse engineered, which is entails insane amounts of work. So, unless there is a leak or the game isn't fully compiled like (I think) Unity games, it will be unlikely to find source code.

[–] NuXCOM_90Percent@lemmy.zip 8 points 10 months ago

Yes and no.

VERY oversimplifying but:

The basic flow of compilation is (human readable-ish) source code becomes symbols which the compiler then applies optimizations to before converting into machine code.

With no optimizations, it is a pretty trivial process to revert back. You lose the names of variables and functions (unless they were added as annotations by the compiler, which they often are for many reasons) but you get the logic.

With optimizations, things get messier. An example that is pretty popular and useful to understand this is https://en.wikipedia.org/wiki/Fast_inverse_square_root The coder likely wrote invsqrt(foo), expecting this to map to a series of hardware functions in the floating point unit. Instead, they see that it became a series of integer operations and bit shifts and get very very confused. Its like that, except imagine an entire 5000 line file becomes two instructions.

That said, compilers are stupid and most people (rightfully) use libraries to a large portion. So the above example would actually not happen because they would just see the instructions to do a function call labeled "fast_invsqrt" and not care. Similarly, basic heuristics (or, if you are trying to get funding, machine learning and neural nets) can be applied to figure out what was done in heavily optimized blocks of code. So the resulting "source code" might be something like

int foo(int bar)
{
  int a = 4;
  // Loop to do some fancy ass math shenanigans to a
  return a + 5;
}

Which results in more or less human readable code again. Also, a lot of compilers will actually embed basically comments in the assembly/binary unless someone remembers to actively disable that. And nobody ever does.

Because source code really doesn't matter all that much. If anyone ever did a deep dive of the Source Engine and Unreal Engine (of the day. I think that was 3?)... they were actually a lot more similar than not. Yeah, there was a lot of infrastructure and even some fundamental differences (been a minute, but I want to say Source is still additive because of its quake origins whereas UE3 was still subtractive geometry?). But... function influences form and they have most of the same functionality.

The issue is more, like with DRM, those "week one sales" as it were. Data is sparse for a lot of reasons, but Securom for Mass Effect 1 PC is generally treated as a massive win because warez groups could not properly crack it for a week or so which led to a lot of pc players just buying the game because we needed hot blue lady action NOW. Same with the reason so many games still use denuvo.

And same with engine and game features. Unity and Unreal basically were in an arms race for years (and Cryengine basically sucked on the barrel of their own gun) where one would add one feature and the other would add the same one a few months later. Having access to the source code potentially means someone can accelerate that a lot...

Except they won't. Because this shit is cancer. Any dev who does anything even remotely similar to how Wolverine jacks off to his friend's wife in a game is opening themselves up to a LOT of lawsuits and investigations. Its why almost every emulator group will go scorched earth on anyone who even acknowledges looking at the nintendo leaks. And it is why someone quitting their job at Microsoft to go work at Google and offer to provide a Teams feature gets blacklisted and reported immediately. Companies don't fuck around with that.

Which leads to the real reason these are so detrimental to gaming and software. People... put questionable comments in their code all the time. Sometimes it is ///TODO: Implement this in Q2 2024 for release 1.5. Sometimes it is //Hey, Fuck you Fred. I finally did this. Stop your fucking bitching and stop whining to John that you couldn't do anything until I did this for you. And sometimes you get bullshit like Bungie (?) using racial slurs as codenames for a lot of the skins and the like...

And it also makes it a lot easier to make a cracked binary if you know what the code was before the DRM was applied.

So decompiling code is actually a lot more viable than you would expect. But also entirely pointless.

[–] CorrodedCranium@leminal.space 5 points 10 months ago

In this video MattKC tries to start decompiling Lego Island. It kind of explains it as well and acts as an example

https://www.youtube.com/watch?v=MToTEqoVv3I

[–] x3i@lemmy.x3i.tech 3 points 10 months ago

Correct. However, this looks like a direction that language processing and GPTs would excel in and to my knowledge, there already have been some ML addons made for certain RE tools, so this might become more easy in the future. If that is necessarily a good thing is a different story...

[–] mr_right@lemmy.dbzer0.com 5 points 10 months ago (2 children)

ayo gta 5 source code leaked yesterday you might want to check it out

[–] pistachio@lemmy.ml 2 points 10 months ago (1 children)

Theres also jak and daxter, i believe it was called openGOAL?

[–] zaknenou@lemmy.dbzer0.com 1 points 10 months ago

openGOAL

seems interesting

[–] zaknenou@lemmy.dbzer0.com 1 points 6 months ago