OpenGTA2?

Anything to do with GTA1/GTA2 that isn't covered by the other forums
User avatar
jericho
Car Jacker
Car Jacker
Posts: 23
Joined: 09 Sep 2019, 20:03

Re: OpenGTA2?

Post by jericho »

Mm okay, good point. I'll try to to see in slow motion
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: OpenGTA2?

Post by Sektor »

Welcome to the forum. Are you just curious or are you creating something? Why did you post in this topic?
User avatar
jericho
Car Jacker
Car Jacker
Posts: 23
Joined: 09 Sep 2019, 20:03

Re: OpenGTA2?

Post by jericho »

Sektor wrote: 11 Sep 2019, 14:47 Welcome to the forum. Are you just curious or are you creating something? Why did you post in this topic?
Thanks :)
Actually i'm creating my own remake of gta1 entirely from scratch (but it currently on very very early stage) and now collecting some info which i believe might be helpful.
I didn't want to create new topic for this tiny question, so I wrote here, sorry )
User avatar
B-$hep
Immortal
Posts: 568
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: OpenGTA2?

Post by B-$hep »

SEKTOR
Sektor wrote: 09 Feb 2017, 01:42 Likely way outside the scope of this project but are you able to debug audio? I want the shocking.wav to play when you die on train tracks, it displays the "shocking!" text but instead plays wasted.wav. Other sounds aren't played either like toasted and game over. Shocking.wav will actually play if it's your last life although in that case you'd think gameover.wav should play.
I looked into GTA2.exe, it seems it always calls wasted.wav for dying or something. Its hardcoded.
I attached the screenshot. The nr 1 in red box is the wasted.wav
Untitled.png
Untitled.png (23.39 KiB) Viewed 25558 times
I havent yet digged so deeply into this, this function is choosing what audio is played:

Code: Select all

char * __fastcall FUN_00564430(int param_1)
{
  switch(*(undefined4 *)(param_1 + 0x44)) {
  case 0:
  case 1:
    return s_wasted_0061aed4;
  case 2:
    return s_fried_0061aecc;
  case 3:
    return s_nicked_0061aec4;
  case 4:
    return s_shocked_0061aebc;
  default:
    return (char *)0;
  }
}
What is the "nicked"?
Fried should be played when ped is torched? I guess.
Have to dig deeper to find out why is wasted always called.
Always wear safety glasses while programming.
paul
Mugger
Mugger
Posts: 15
Joined: 31 Mar 2016, 12:32
GH nick: paul

Re: OpenGTA2?

Post by paul »

I wonder if anyone would be interested in fully reversing GTA2 original exe?

This would mean:
1. Disassemble the game to asm source.
2. Re-assemble and patch any time stamps in the PE header/debug info so it produces exactly the same original exe file.
3. Re-create the MSVC6 build environment.
4. Replace each asm function 1 by 1 with C/C++ code that produces exactly the same assembly instructions as the original function.
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: OpenGTA2?

Post by elypter »

this is a huge undertaking and very difficult to automate. however there are some new approaches for disassemblers that use machine learning which look very promising. i think effort is best spent in improving those tools and adapting it to the build environment gta2 was made with. decompiling will probably never be fully automated but my vision for the perfect decompile would be one that is able to take a bunch of user input like the memory addresses that the community found including descriptions and any other known variables and then let the ai work backwards from there giving the internal objects proper names and groupings based on the provided information
yur sa'nok ngeyä
paul
Mugger
Mugger
Posts: 15
Joined: 31 Mar 2016, 12:32
GH nick: paul

Re: OpenGTA2?

Post by paul »

Yep I fully expect this would be a multi person multi year project. Also agree that it can't really be automated. It would be manual work on around 5-6k functions.

I wouldn't do this alone if but we had say 5-10 people working on it then it could be possible to do within a few years.
User avatar
B-$hep
Immortal
Posts: 568
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: OpenGTA2?

Post by B-$hep »

  • Im willing to join.
  • I love GTA2
  • I have "worked" previously as cr@cker and reverse engineered many exes/apps
I really wish that somebody/somewhere got a real face to face contact with some "huge boss" in R* and ask them about the possibility to make GTA2, editor and all dlls open source.
It's 20 years old game.
In 2002 or 2004 they recompiled the sources of GTA1 and GTA2 and released the classics (now unavailable).
It means they have the sourcecode.

Even Microsoft is releasing lots of source lately. Why R* cant just release this messy old 20 years old code, put it on GitHub or something with specific license and let it be.
GTA1 is even older but also interesting to have with sources.
So many ports and mods could be made for both GTA1 and GTA2.
Always wear safety glasses while programming.
paul
Mugger
Mugger
Posts: 15
Joined: 31 Mar 2016, 12:32
GH nick: paul

Re: OpenGTA2?

Post by paul »

I think the first thing to be done is to collect all known versions of GTA2 for cross comparison and hope of any symbol leaks or debug compiled versions.

I know of these versions:

-PS1 release
-PC demo
-PC retail
-PC "rockstar classics"
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: OpenGTA2?

Post by elypter »

there were also some special releases for some language regions and multiple official patches
yur sa'nok ngeyä
User avatar
B-$hep
Immortal
Posts: 568
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: OpenGTA2?

Post by B-$hep »

Really?
I have original, the 9.6F, Playstation and demo version.
I know there is a russian version also.
Dunno about others.
I have demo and PS version on dvds somewhere.
Have to dig out
Always wear safety glasses while programming.
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: OpenGTA2?

Post by elypter »

there was a japanese version as well. i collected some additional versions in the game pakx.
yur sa'nok ngeyä
User avatar
B-$hep
Immortal
Posts: 568
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: OpenGTA2?

Post by B-$hep »

Nice.
It would be great to find these all.
I doubt that they were compiled differently but who knows..
BTW: here are all the known .cpp files from GTA2.EXE, the original ones that were actually in source tree. Maybe 1-2 missing, dunno, but i will add them once i find them.
Image
Always wear safety glasses while programming.
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: OpenGTA2?

Post by elypter »

i was searching for releases quite thorowly back then but i dont remember any details anymore. if you want to find every release i suggest researching what once existed and then if you cannot find downloads anymore to ask on retro forums and subreddits
yur sa'nok ngeyä
User avatar
JernejL
Hitman
Hitman
Posts: 141
Joined: 21 Feb 2010, 22:03
GH nick: RedShirt

Re: OpenGTA2?

Post by JernejL »

https://github.com/paulsapps/GTA2Hax

"Reimplementation of DmaVideo.dll and d3ddll.dll for GTA2"

Someone did this a few years ago.
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: OpenGTA2?

Post by Sektor »

There's the freeloader version but that also has no debug symbols. The exe is larger than 9.6f. It was officially licensed and recompiled but the freeloader company went out of business.

I included their original installers and manuals but all you really want to look at is gta2freeloader.exe

http://gtamp.com/GTA2/gta2freeloader.7z , it's v10.5
User avatar
B-$hep
Immortal
Posts: 568
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: OpenGTA2?

Post by B-$hep »

So it means freeloader had sourcecode?
Why they bought the source anyway?
Whats the point. Same game. No changes.

I wonder if the guys from freeloader still have the sourcecode.
Always wear safety glasses while programming.
jotab
Mugger
Mugger
Posts: 11
Joined: 23 Jan 2012, 23:08

Re: OpenGTA2?

Post by jotab »

I loaded the gta2 demo exe into Ghidra and found a lot of strings referring to cpp files that are the source code of the game. Looking further, these strings appear to be referred from A LOT of functions. I am not too well versed in compilers and macros etc... but from what I read, it appears that the __FILE__ macro was used, printing the name of the current input file, i.e. the file that was compiled into that exact function.

I dont know if I am very hopeful now, but does this not mean that it is possible to determine what parts of the decompiled exe comes from which source file? Is this useful?

0060a0e4 C:\gbh\coop89demo\audicoll.cpp C:\gbh\coop89demo\audicoll.cpp ds
0060a28c C:\gbh\coop89demo\camera.cpp C:\gbh\coop89demo\camera.cpp ds
0060a2b0 C:\gbh\coop89demo\car.cpp C:\gbh\coop89demo\car.cpp ds
0060a310 C:\gbh\coop89demo\carcont.cpp C:\gbh\coop89demo\carcont.cpp ds
0060a34c C:\gbh\coop89demo\carinfo.cpp C:\gbh\coop89demo\carinfo.cpp ds
0060a38c C:\gbh\coop89demo\char.cpp C:\gbh\coop89demo\char.cpp ds
0060a424 C:\gbh\coop89demo\charlist.cpp C:\gbh\coop89demo\charlist.cpp ds
0060a444 C:\gbh\coop89demo\collide.cpp C:\gbh\coop89demo\collide.cpp ds
0060a478 C:\gbh\coop89demo\crane.cpp C:\gbh\coop89demo\crane.cpp ds
0060a494 C:\gbh\coop89demo\credits.cpp C:\gbh\coop89demo\credits.cpp ds
0060a4bc C:\gbh\coop89demo\crusher.cpp C:\gbh\coop89demo\crusher.cpp ds
0060a50c C:\gbh\coop89demo\display.cpp C:\gbh\coop89demo\display.cpp ds
0060a560 C:\gbh\coop89demo\diutil.cpp C:\gbh\coop89demo\diutil.cpp ds
0060a688 C:\gbh\coop89demo\door.cpp C:\gbh\coop89demo\door.cpp ds
0060e4b4 C:\gbh\coop89demo\File.cpp C:\gbh\coop89demo\File.cpp ds
0060e4e0 C:\gbh\coop89demo\fireman.cpp C:\gbh\coop89demo\fireman.cpp ds
0060fe40 C:\gbh\coop89demo\frontend2.cpp C:\gbh\coop89demo\frontend2.cpp ds
006101fc C:\gbh\coop89demo\game.cpp C:\gbh\coop89demo\game.cpp ds
006107ac C:\gbh\coop89demo\Group.cpp C:\gbh\coop89demo\Group.cpp ds
00610ae0 C:\gbh\coop89demo\input.cpp C:\gbh\coop89demo\input.cpp ds
00610b5c C:\gbh\coop89demo\kanji.cpp C:\gbh\coop89demo\kanji.cpp ds
00610bb4 C:\gbh\coop89demo\keybrd.cpp C:\gbh\coop89demo\keybrd.cpp ds
00610cb4 C:\gbh\coop89demo\main.cpp C:\gbh\coop89demo\main.cpp ds
00610d2c C:\gbh\coop89demo\map.cpp C:\gbh\coop89demo\map.cpp ds
00610eb8 C:\gbh\coop89demo\mapdraw.cpp C:\gbh\coop89demo\mapdraw.cpp ds
00610ed8 C:\gbh\coop89demo\maths.cpp C:\gbh\coop89demo\maths.cpp ds
00610f40 C:\gbh\coop89demo\medical.cpp C:\gbh\coop89demo\medical.cpp ds
00610f60 C:\gbh\coop89demo\Memory.cpp C:\gbh\coop89demo\Memory.cpp ds
006111ac C:\gbh\coop89demo\miss2.cpp C:\gbh\coop89demo\miss2.cpp ds
00611280 C:\gbh\coop89demo\multip.cpp C:\gbh\coop89demo\multip.cpp ds
00613ba0 C:\gbh\coop89demo\NetUI.cpp C:\gbh\coop89demo\NetUI.cpp ds
00613d2c C:\gbh\coop89demo\object.cpp C:\gbh\coop89demo\object.cpp ds
00613d54 C:\gbh\coop89demo\objecti.cpp C:\gbh\coop89demo\objecti.cpp ds
00613d74 C:\gbh\coop89demo\park.cpp C:\gbh\coop89demo\park.cpp ds
00613d98 C:\gbh\coop89demo\particle.cpp C:\gbh\coop89demo\particle.cpp ds
00613dc0 C:\gbh\coop89demo\ped.cpp C:\gbh\coop89demo\ped.cpp ds
00613fe0 C:\gbh\coop89demo\physics.cpp C:\gbh\coop89demo\physics.cpp ds
006140f8 C:\gbh\coop89demo\player.cpp C:\gbh\coop89demo\player.cpp ds
00614e20 C:\gbh\coop89demo\plydat.cpp C:\gbh\coop89demo\plydat.cpp ds
00614e48 C:\gbh\coop89demo\pubtrans.cpp C:\gbh\coop89demo\pubtrans.cpp ds
00614e98 C:\gbh\coop89demo\recycle.cpp C:\gbh\coop89demo\recycle.cpp ds
00614ebc C:\gbh\coop89demo\registry.cpp C:\gbh\coop89demo\registry.cpp ds
00614fc0 C:\gbh\coop89demo\Routef.cpp C:\gbh\coop89demo\Routef.cpp ds
0061513c C:\gbh\coop89demo\sid.cpp C:\gbh\coop89demo\sid.cpp ds
0061515c C:\gbh\coop89demo\sprite.cpp C:\gbh\coop89demo\sprite.cpp ds
00615190 C:\gbh\coop89demo\sprlist.cpp C:\gbh\coop89demo\sprlist.cpp ds
006151b0 C:\gbh\coop89demo\style.cpp C:\gbh\coop89demo\style.cpp ds
00615254 C:\gbh\coop89demo\taxi.cpp C:\gbh\coop89demo\taxi.cpp ds
00615498 C:\gbh\coop89demo\text.cpp C:\gbh\coop89demo\text.cpp ds
006154e4 C:\gbh\coop89demo\texture.cpp C:\gbh\coop89demo\texture.cpp ds
00615504 C:\gbh\coop89demo\tileanim.cpp C:\gbh\coop89demo\tileanim.cpp ds
006155c4 C:\gbh\coop89demo\traffic.cpp C:\gbh\coop89demo\traffic.cpp ds
00615634 C:\gbh\coop89demo\tree.cpp C:\gbh\coop89demo\tree.cpp ds
00615650 C:\gbh\coop89demo\trigger.cpp C:\gbh\coop89demo\trigger.cpp ds
006156c8 C:\gbh\coop89demo\user.cpp C:\gbh\coop89demo\user.cpp ds
006157c0 C:\gbh\coop89demo\video.cpp C:\gbh\coop89demo\video.cpp ds
006158c0 C:\gbh\coop89demo\weapon.cpp C:\gbh\coop89demo\weapon.cpp ds
0061590c C:\gbh\coop89demo\winmain.cpp C:\gbh\coop89demo\winmain.cpp ds
Post Reply