Join also our Discord channel! Click here.

Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archive

The Original Forum. Game archives, full of resources. How to open them? Get help here.
unknown123
advanced
Posts: 75
Joined: Sat Apr 09, 2016 5:36 pm
Has thanked: 4 times
Been thanked: 13 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by unknown123 » Sat Feb 25, 2017 3:57 pm

Working client emulator, https://github.com/unknown321/mgsv_emulator .
Script that pulls information list, fob event info and nuke count every hour: https://github.com/unknown321/mgsv_nuke_watcher
Results of script work: https://unknown321.github.io/mgsv_nuke_watcher/

If you want to see nukes from other platforms, you own a console and have 2 physical network interfaces in your pc - please contact me (pm or just post here).

BobDoleOwndU
advanced
Posts: 68
Joined: Thu Dec 24, 2015 7:45 am
Has thanked: 10 times
Been thanked: 10 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by BobDoleOwndU » Sun Feb 26, 2017 4:05 am

unknown123 wrote:Working client emulator, https://github.com/unknown321/mgsv_emulator .
Script that pulls information list, fob event info and nuke count every hour: https://github.com/unknown321/mgsv_nuke_watcher
Results of script work: https://unknown321.github.io/mgsv_nuke_watcher/

If you want to see nukes from other platforms, you own a console and have 2 physical network interfaces in your pc - please contact me (pm or just post here).
Nice work!

I have access to the game on PS4 and PS3. My laptop has Ethernet and wi-fi. So I might be able to help with the console stuff.

CantStoptheBipBop
advanced
Posts: 53
Joined: Sat Aug 27, 2016 9:43 am
Has thanked: 7 times
Been thanked: 7 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by CantStoptheBipBop » Thu Mar 02, 2017 5:21 pm

I haven't really found anything too interesting lately but I realized that you can adjust vehicle speed a little more precisely with some math. The player x,y,z whole numbers are equivalent to the in-game representation of meters. So basically this:

Code: Select all

local this={}

local m=math
local sqrt=m.sqrt
local floor=m.floor
m=nil

local F={
	gameElapsedTime=TppTime.GetRawElapsedTimeSinceStartUp,
	announce=TppUiCommand.AnnounceLogView
}

this.var={
	player={
		oldPos=false,
		newPos=false
	},
	time={
		prev=false
	}
}

if not this.var.time.prev then this.var.time.prev=F.gameElapsedTime()end

function this:calcSpeed()
	local op=this.var.player.oldPos or false

	if not op then
		this.var.player.oldPos=self
		return
	end

	local np=self

	local x,y,z=(np[1]-op[1]),(np[2]-op[2]),(np[3]-op[3])

	x=sqrt((x*x)+(y*y)+(z*z))
	x=((floor(x*10))*-10)
	x=floor(x/1e3)
	F.announce(x..' KPH')
	
	return x
end

function this.Update()
	if ((this.var.time.prev+1)<=F.gameElapsedTime()) then
		this.var.time.prev=F.gameElapsedTime()
		local vars
		this.var.player.newPos=this.calcSpeed({vars.playerPosX,vars.playerPosY,vars.playerPosZ})
	end
end
I haven't actually tried it but that's essentially what you'd do with it.

Oh yeah I was curious about something with the game. Anyone know why running pairs or whatever on some global tables causes the game to just crash? When you just do tostring() on the vars below it prints out table hashes but going through them with pairs just results in a CTD.

Code: Select all

--DEBUG
	--e.debug.multiEcho({'cbox vars','cboxIsValid',vars.cboxIsValid,'cboxLife',vars.cboxLife,'cboxFlag',vars.cboxFlag,'cboxPosterType',vars.cboxPosterType,'cboxEquipId',vars.cboxEquipId,'cboxLocation',vars.cboxLocation})
	do
		local t={vars.cboxIsValid,vars.cboxLife,vars.cboxFlag,vars.cboxPosterType,vars.cboxEquipId,vars.cboxLocation}
		for i=1,#t do
			F.echo('indice '..i)
			for k,v in pairs(t[i])do
				if k and v then
					F.echo(tostring(k)..'='..tostring(v))
				elseif k then
					F.echo('key='..tostring(k))
				elseif v then
					F.echo('value='..tostring(v))
				end
			end
		end
	end
--

nasanhak
advanced
Posts: 71
Joined: Sat Nov 28, 2015 6:01 am
Has thanked: 10 times
Been thanked: 4 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by nasanhak » Thu Mar 02, 2017 6:16 pm

CantStoptheBipBop wrote: Oh yeah I was curious about something with the game. Anyone know why running pairs or whatever on some global tables causes the game to just crash? When you just do tostring() on the vars below it prints out table hashes but going through them with pairs just results in a CTD.
These are C functions/data. So I don't think Lua is capable of traversing them. You can run the InfInspect module from Infinite Heaven on _G and print all globals.

That that will give you is this:

Code: Select all

      cboxEquipId = <514>{
      [-285212666] = 16,
      [-285212665] = <userdata 133>,
      __index = <function 10017>,
      __newindex = <function 10018>,
      <metatable> = <table 514>
    },
    cboxFlag = <515>{
      [-285212666] = 16,
      [-285212665] = <userdata 134>,
      __index = <function 10019>,
      __newindex = <function 10020>,
      <metatable> = <table 515>
    },
    cboxIsValid = <516>{
      [-285212666] = 16,
      [-285212665] = <userdata 135>,
      __index = <function 10021>,
      __newindex = <function 10022>,
      <metatable> = <table 516>
    },
    cboxLife = <517>{
      [-285212666] = 16,
      [-285212665] = <userdata 136>,
      __index = <function 10023>,
      __newindex = <function 10024>,
      <metatable> = <table 517>
    },
    cboxLocation = <518>{
      [-285212666] = 64,
      [-285212665] = <userdata 137>,
      __index = <function 10025>,
      __newindex = <function 10026>,
      <metatable> = <table 518>
    },
    cboxPosterIndices = <519>{
      [-285212666] = 16,
      [-285212665] = <userdata 138>,
      __index = <function 10027>,
      __newindex = <function 10028>,
      <metatable> = <table 519>
    },
    cboxPosterType = <520>{
      [-285212666] = 16,
      [-285212665] = <userdata 139>,
      __index = <function 10029>,
      __newindex = <function 10030>,
      <metatable> = <table 520>
    },
The first entry under each type is the size of the object. So in this case it is 16. So each of these variables can store up to 16 data that is accessed like any array[x] value. Trouble is it is nearly impossible to guess what the index 'x' would be. In a few cases it is 0 based but mostly it's StrCode32 encoded text or something else.

Tex
veteran
Posts: 89
Joined: Sat Aug 20, 2011 4:51 am
Has thanked: 21 times
Been thanked: 11 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by Tex » Fri Mar 03, 2017 3:20 am

unknown123 wrote:Working client emulator, https://github.com/unknown321/mgsv_emulator .
Fantastic.

unknown123 wrote:Theoretically, you can do it. http://lua-users.org/wiki/BindingCodeToLua
I was thinking about it, but honestly this is pointless. What will that module do?
We already have access to almost everything in Lua, why manipulate it with C?
It would be nice for better input/output between lua and whatever.

Some existing modules I'd like to use:
luasocket to get LDT debugging
luafilesystem to work with files better than having to parse dir output.

Otherwise:
Bypassing/fixing whatever kjp did to io.
Communication with other processes.
Full keyboard input.

But as far as I understand from http://lua-users.org/wiki/BuildingModules, more specifically:
Lua modules expect that the Lua core is already present before they are loaded. This works because the Lua core symbols are exported globally
And checking mgsvtpp.exe with dumpbin, they aren't (not surprising), so it seems it's a no go.

unknown123
advanced
Posts: 75
Joined: Sat Apr 09, 2016 5:36 pm
Has thanked: 4 times
Been thanked: 13 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by unknown123 » Fri Mar 03, 2017 9:42 pm

I have compiled a list of links to tools and posts of interest in this thread separated by categories (because almost no one will read whole thread).
Feel free to contribute.

https://github.com/unknown321/mgsv_wiki

CantStoptheBipBop
advanced
Posts: 53
Joined: Sat Aug 27, 2016 9:43 am
Has thanked: 7 times
Been thanked: 7 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by CantStoptheBipBop » Sat Mar 04, 2017 2:41 am

nasanhak wrote:C functions/data
Thanks, that makes sense. I'll have to give the langForce.lua script a shot at figuring out some of the globals at some point. From what I remember Fox.StrCode32.exe worked with finding out what the hashes represented, with the old langTool.exe dictionary. Or more practically just creating a lua to attempt random strings on unknown tables until a non-nil condition is met.

Speaking of I'm currently working on rewriting the qar and lng scripts from a few months ago. I'll just update on that whenever they're ready and throw them on GitHub (the old code is a hot mess).
unknown123 wrote:I have compiled a list of links to tools and posts of interest in this thread
Sweet. It's easy to miss a lot of that stuff even when you reread the thread.

--

working out-of-game version of the speed calculation example:

Code: Select all

local e={}

--##|emulation lines|##
local vars={
	playerPosX=110,
	playerPosY=470,
	playerPosZ=350
}

local Time={
	GetRawElapsedTimeSinceStartUp=os.clock
}

local TppUiCommand={
	AnnounceLogView=print
}
--##|/|##

e.var={
	player={
		oldPos={100,450,300},
		newPos=false,
	},
	time={
		oldTime=Time.GetRawElapsedTimeSinceStartUp()+1
	}
}

--##|emulation lines|##
while Time.GetRawElapsedTimeSinceStartUp()<e.var.time.oldTime+1 do
end
--##|/|##

function e:playerSpeed()
	local op=e.var.player.oldPos
	local np=self
	self=nil

	local x,y,z=(np[1]-op[1]),(np[2]-op[2]),(np[3]-op[3])
	op=nil
	x=math.sqrt((x*x)+(y*y)+(z*z))
	y=nil
	x=(math.floor(x*10)*1e-1)
	local secToHour=(60*60)
	local mInKm=1e3
	x=x*secToHour
	x=x/mInKm
	secToHour,mInKm=nil
	z=x%1
	if 0<z then
		if z<0.5 then
			x=(math.floor(x*10)*1e-1)
		else
			x=(math.ceil(x*10)*1e-1)
		end
	end
	TppUiCommand.AnnounceLogView(x..' KPH')
	return np
end

function e.Update()
	if e.var.time.oldTime<Time.GetRawElapsedTimeSinceStartUp() then
		e.var.player.oldPos=e.playerSpeed({vars.playerPosX,vars.playerPosY,vars.playerPosZ})
	end
end

e.Update()
So with something like that it should be possible to create some kind of formula to adjust vehicle speed precisely, rather than the "throw shit at the file and see what sticks" approach.

Tex
veteran
Posts: 89
Joined: Sat Aug 20, 2011 4:51 am
Has thanked: 21 times
Been thanked: 11 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by Tex » Sun Mar 05, 2017 2:03 am

So there's some demos(cutscenes) that run during normal in game play with the player still in control, most of them are in epilogue, but theres one where some soldiers are interrogating a dude in Mission 6 at the bridge while you look from afar in full control.
In line with this, you can disable demo cameras by removing their references in the cameraTypes property of the DemoData object in the demos fox2.
This will return the camera to the normal player camera.

You can also stop demo control of the player character by removing the reference to the player in the controlCharacters property in the DemoData object (look for a DemoControlCharacterDesc with a characterId of Player to find which).

There's some other stuff that you need to tweak in TppDemo to regain control of the player camera (or full control if you remove player from demo control), you can force isInGame, isNotAllowedPlayerAction in Play(), though there's likely to be some side effects to this approach.

I have a submod on the IH files page that removes demo cam from all demos.
And the forceDemoAllowAction is now an option in IH (but pretty much relies on above submod), and you can also toggle IHs free cam with this option on via the quick menu (as Announce log is disabled during demos, haven't really looked to see if its possible to enable).

nasanhak
advanced
Posts: 71
Joined: Sat Nov 28, 2015 6:01 am
Has thanked: 10 times
Been thanked: 4 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by nasanhak » Sun Mar 05, 2017 11:13 am

Tex wrote:I have a submod on the IH files page that removes demo cam from all demos.
And the forceDemoAllowAction is now an option in IH (but pretty much relies on above submod), and you can also toggle IHs free cam with this option on via the quick menu (as Announce log is disabled during demos, haven't really looked to see if its possible to enable).
Seriously Tex, awesome work! But how long did it take for you to edit all those demo files?! XD

CantStoptheBipBop
advanced
Posts: 53
Joined: Sat Aug 27, 2016 9:43 am
Has thanked: 7 times
Been thanked: 7 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by CantStoptheBipBop » Wed Mar 08, 2017 4:09 am

Finished the rewrite. It's optimized as much as I could manage; still not as fast as I'd like but it should be fine for most people. decipher.lua is a combination of langForce.lua and qarForce.lua. You change the settings in the input table and have a minimal amount to manually change inside of method functions. Instead of copy pasting different dictionaries and hash lists you can just select what you want from the e.lib table, which has keys holding relative paths to the target file. If you're doing QAR hashes then use the cat11 hash list. I didn't bother to create dynamic pattern matching based on the hash for QAR.

MGSV dictionary generator

Some build results showing general speed and script flow:

Code: Select all

7862.802: max generated line count of 500000 reached; calling e.loop()
7862.837: calling e.createNewDictionary()
7863.159: entries
7864.105: creating output file
7868.425: freeing memory
7868.708: importing lines from output file
#oHashes=500000
#oEntries=500000
oEntries[1]=/Assets/tpp/common_source/environ/guantanamo/cm_cypr_pllt053/sourceimages/cm_cypr_pllt053_gg_clp
7868.894: s.find done
7869.261back in e.loop()
7870.571: max generated line count of 500000 reached; calling e.loop()
7870.605: calling e.createNewDictionary()
7870.933: entries
7872.051: creating output file
7876.492: freeing memory
7876.794: importing lines from output file
#oHashes=500000
#oEntries=500000
oEntries[1]=/Assets/tpp/common_source/environ/guantanamo/cm_mafr_nett053/sourceimages/cm_mafr_nett053_st_shm
7876.944: s.find done
7877.352back in e.loop()
Those build results aren't 100% accurate because I moved blocks inside functions before moving the console feedback to the proper position, but it gives the general idea of what the script is doing I guess. It spends most of its time importing lines from generated entry files for the oEntries table but I'm not sure what can be done about that. I'm open to suggestions on it.

abuali
beginner
Posts: 20
Joined: Sun Dec 12, 2010 5:48 pm

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by abuali » Wed Mar 08, 2017 6:17 am

As I am translating the game, I use japanese as a base. I finished almost everything but there's one problem, which is the server messages. As it appears I cannot do anything with it, but I need it to be in English rather than Japanese.

unknown123
advanced
Posts: 75
Joined: Sat Apr 09, 2016 5:36 pm
Has thanked: 4 times
Been thanked: 13 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by unknown123 » Wed Mar 08, 2017 9:49 am

abuali wrote:As I am translating the game, I use japanese as a base. I finished almost everything but there's one problem, which is the server messages. As it appears I cannot do anything with it, but I need it to be in English rather than Japanese.
Server messages such as fob event info while you log in? These depend on your game language setting.

abuali
beginner
Posts: 20
Joined: Sun Dec 12, 2010 5:48 pm

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by abuali » Wed Mar 08, 2017 10:00 am

unknown123 wrote:
abuali wrote:As I am translating the game, I use japanese as a base. I finished almost everything but there's one problem, which is the server messages. As it appears I cannot do anything with it, but I need it to be in English rather than Japanese.
Server messages such as fob event info while you log in? These depend on your game language setting.
Yep.
Maybe it can be modded in the game files so it showed the English messages instead of Japanese while using the Japanese language settings.

unknown123
advanced
Posts: 75
Joined: Sat Apr 09, 2016 5:36 pm
Has thanked: 4 times
Been thanked: 13 times

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by unknown123 » Fri Mar 10, 2017 3:39 am

I've managed to successfully emulate server part - server login procedures and some routine stuff.
Right now it cannot be released because I am using hardcoded values for my steam account.
There are also some issues with authenticating: client sends steam ticket (probably generated by overlay) to the server, server parses ticket and returns corresponding steamid + password. You need steamworks api key to parse ticket, but that key is on konami side and there is no way to get it. I have a couple of ideas on how to make auth system even with steam tickets, but it will take some time.

Mb coins are (obviously) saved on server and are pulled from it every time you go online. You cannot change their value on custom server and then transfer it to konami server.
Update: online-only weapons are uhh, online-only. You get a list of weapons you've developed (and not developed yet) with their status from server. Server will overwrite your local progress no matter what, so you cannot develop them on custom server and transfer to legit server.

I've also achieved nuclear disarmament without modding the game (so this is legit disarmament). Cutscene plays, monument stays, no chapter 3 card shown.

Bonus pic of modded mbcoins:
Image

GHzGangster
n00b
Posts: 18
Joined: Fri Aug 15, 2014 6:00 am
Has thanked: 3 times
Been thanked: 1 time

Re: Metal Gear Solid 5 Ground Zeroes/Phantom Pain g0s archiv

Post by GHzGangster » Mon Apr 10, 2017 5:46 am

unknown123 wrote:...
Surprised someone else went through the trouble of doing this honestly.

Unless you have a hacked console, you won't be getting on the other "servers". I have a Steam and PS3 server, really just for MGO though. Really, I think a Steam server is really the only accessible option. A hacked PS3 would work, but there are going to be a whole lot less people with that.

I used to have an MGO stat lookup tool for Steam, you could use old auth info just fine. You can do the same for the PS3 version. Konami doesn't seem to double-check the time on the PS3 tickets, at least. I used the same ticket for months at least. It would probably still be working if my PSN didn't get banned.

Cool to see that the encryption really is Blowfish though. I honestly just translated the PPC code over to C.

EDIT: PM'd you my PS3 PSN ticket and auth params. I'm banned from PSN, but it still seems to work for the server.

Post Reply