otavepto / gbe_fork

Fork of https://gitlab.com/Mr_Goldberg/goldberg_emulator
https://gitlab.com/Mr_Goldberg/goldberg_emulator
GNU Lesser General Public License v3.0
191 stars 55 forks source link

API loaded no #117

Closed detiam closed 3 months ago

detiam commented 3 months ago

When use emu, the game can't find libsteam.so and print [API loaded no] after steam ID, normally this is [API loaded yes].

$ LD_DEBUG=libs SteamAppId=281990 ...
     13220:
     13220:     calling init: /home/detiam/.local/share/SEMU/linux64/steamclient.so
     13220:
[S_API] SteamAPI_Init(): Loaded '/home/detiam/.local/share/SEMU/linux64/steamclient.so' OK.
Setting breakpad minidump AppID = 281990
     13220:     find library=libsteam.so [0]; searching
     13220:      search cache=/etc/ld.so.cache
     13220:      search path=/usr/lib/glibc-hwcaps/x86-64-v3:/usr/lib/glibc-hwcaps/x86-64-v2:/usr/lib           (system search path)
     13220:       trying file=/usr/lib/glibc-hwcaps/x86-64-v3/libsteam.so
     13220:       trying file=/usr/lib/glibc-hwcaps/x86-64-v2/libsteam.so
     13220:       trying file=/usr/lib/libsteam.so
     13220:
Steam_SetMinidumpSteamID:  Caching Steam ID:  *** [API loaded no]
~/.local/share/Steam/ubuntu12_32/ $ file libsteam.so
libsteam.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=63b30c1969f3486fe8711c54d21fdb29ac80bf19, not stripped
~/.local/share/Steam/ubuntu12_32/ $ nm -D --defined-only libsteam.so 
0033e490 A __bss_start
00237bb0 T CleanupFIFOs
00237370 T CleanupSemaphores
001fff40 T CreateInterface
0033e490 A _edata
0033ffc0 A _end
001fffe0 T _f
00287368 T _fini
0001c50c T _init
00201f50 T InternalSteamNumClientsConnectedToEngine
00201d50 T InternalSteamShouldShutdownEngine2
001e8070 T SteamAbortCall
00222a90 T SteamAbortOngoingUserIDTicketValidation
001e49e0 T SteamAckSubscriptionReceipt
001e7d70 T SteamBlockingCall
001d6c00 T SteamChangeAccountName
001d9c20 T SteamChangeEmailAddress
001db770 T SteamChangeForgottenPassword
001f35a0 T SteamChangeOfflineStatus
001daa00 T SteamChangePassword
001da700 T SteamChangePersonalQA
001d74f0 T SteamCheckAppOwnership
001f42e0 T SteamCleanup
001d5520 T SteamClearError
001f0190 T SteamCloseFile
001e7770 T SteamCreateAccount
001dfd10 T SteamCreateCachePreloaders
001d5550 T SteamCreateLogContext
000991c0 T SteamDecryptDataForThisMachine
001de710 T SteamDefragCaches
001d7320 T SteamDeleteAccount
00099090 T SteamEncryptDataForThisMachine
001e2b20 T SteamEnumerateApp
001e17a0 T SteamEnumerateAppDependency
001e1a60 T SteamEnumerateAppIcon
001e1d40 T SteamEnumerateAppLaunchOption
001e2010 T SteamEnumerateAppVersion
001e3bd0 T SteamEnumerateSubscription
001e3910 T SteamEnumerateSubscriptionDiscount
001e3640 T SteamEnumerateSubscriptionDiscountQualifier
001e0fd0 T SteamFindApp
001e9c60 T SteamFindClose
001eadb0 T SteamFindFirst
001ea910 T SteamFindFirst64
001ea480 T SteamFindNext
001e9fb0 T SteamFindNext64
00097790 T SteamFindServersGetErrorString
00097960 T SteamFindServersIterateServer
00097e70 T SteamFindServersNumServers
001dedf0 T SteamFlushCache
001f1bb0 T SteamFlushFile
001d82d0 T SteamForceCellId
001e9450 T SteamForgetAllHints
001e71b0 T SteamGenerateSuggestedAccountNames
001e56e0 T SteamGetAccountStatus
001dc640 T SteamGetAppCacheSize
001e0cf0 T SteamGetAppDependencies
001dcb90 T SteamGetAppDir
001d7fe0 T SteamGetAppDLCStatus
001e2e00 T SteamGetAppIds
001e25a0 T SteamGetAppPurchaseCountry
001e30b0 T SteamGetAppStats
001d9000 T SteamGetAppUpdateStats
001e0a00 T SteamGetAppUserDefinedInfo
001e0450 T SteamGetAppUserDefinedRecord
001eef80 T SteamGetc
001dd5c0 T SteamGetCacheDecryptionKey
001dd0e0 T SteamGetCacheDefaultDirectory
001dfa40 T SteamGetCacheFilePath
001de950 T SteamGetCachePercentFragmentation
001da170 T SteamGetContentServerInfo
001df4b0 T SteamGetCurrentCellID
001d9ec0 T SteamGetCurrentEmailAddress
001e2870 T SteamGetDepotParent
0009ab60 T SteamGetEncryptedNewValveCDKey
001e8610 T SteamGetEncryptedUserIDTicket
00222a30 T SteamGetEncryptionKeyToSendToNewClient
001f1f10 T SteamGetFileAttributeFlags
001d87e0 T SteamGetLocalClientVersion
001eb220 T SteamGetLocalFileCopy
001dacd0 T SteamGetNumAccountsWithEmailAddress
001f3830 T SteamGetOfflineStatus
001da430 T SteamGetSponsorUrl
001e3350 T SteamGetSubscriptionExtendedInfo
001e3e90 T SteamGetSubscriptionIds
001e22d0 T SteamGetSubscriptionPurchaseCountry
001e4c20 T SteamGetSubscriptionReceipt
001e4140 T SteamGetSubscriptionStats
001d8d60 T SteamGetTotalUpdateStats
001e66c0 T SteamGetUser
001e5980 T SteamGetUserType
001d53b0 T SteamGetVersion
001e9690 T SteamHintResourceNeed
0022a390 T SteamInitializeUserIDTicketValidator
001e14e0 T SteamInsertAppDependency
001e74c0 T SteamIsAccountNameInUse
001e43e0 T SteamIsAppSubscribed
001df780 T SteamIsCacheLoadingEnabled
001e9950 T SteamIsFileImmediatelyAvailable
001ddea0 T SteamIsFileNeededByApp
001de180 T SteamIsFileNeededByCache
001e6ef0 T SteamIsLoggedIn
001e5f00 T SteamIsSecureComputer
001e46e0 T SteamIsSubscribed
001d6e70 T SteamIsUsingSdkContentServer
001dff40 T SteamLaunchApp
001de460 T SteamLoadCacheFromDir
001dd8a0 T SteamLoadFileToApp
001ddba0 T SteamLoadFileToCache
001d5560 T SteamLog
001e63d0 T SteamLogin
001e61a0 T SteamLogout
001d5580 T SteamLogResourceLoadFinished
001d5570 T SteamLogResourceLoadStarted
002012f0 T SteamMiniDumpInit
001f3350 T SteamMountAppFilesystem
001f30a0 T SteamMountFilesystem
001dc8f0 T SteamMoveApp
001f3ac0 T SteamNumAppsRunning
001f16b0 T SteamOpenFile
001f0af0 T SteamOpenFile64
001f3cf0 T SteamOpenFileEx
001f0600 T SteamOpenTmpFile
00222af0 T SteamOptionalCleanUpAfterClientHasDisconnected
001e9210 T SteamPauseCachePreloading
001edee0 T SteamPrintFile
001e8300 T SteamProcessCall
00224e00 T SteamProcessOngoingUserIDTicketValidation
001ee9d0 T SteamPutc
001efac0 T SteamReadFile
002456f0 T SteamRealPath
001e53f0 T SteamRefreshAccountInfo
001e5120 T SteamRefreshAccountInfo2
001e53b0 T SteamRefreshAccountInfoEx
001e5c20 T SteamRefreshLogin
001dd380 T SteamRefreshMinimumFootprintFiles
001dc190 T SteamReleaseCacheFiles
001e1290 T SteamRemoveAppDependency
001deba0 T SteamRepairOrDecryptCaches
001daf70 T SteamRequestAccountsByCdKeyEmail
001db210 T SteamRequestAccountsByEmailAddressEmail
001d9750 T SteamRequestEmailAddressVerificationEmail
001db4b0 T SteamRequestForgottenPasswordEmail
001e8fd0 T SteamResumeCachePreloading
001ed190 T SteamSeekFile
001ec9b0 T SteamSeekFile64
001dc3e0 T SteamSetAppCacheSize
001dbf40 T SteamSetAppVersion
001dce40 T SteamSetCacheDefaultDirectory
001e7b30 T SteamSetMaxStallCount
001dbad0 T SteamSetNotificationCallback
001e6c20 T SteamSetUser
001e6980 T SteamSetUser2
001ed8b0 T SteamSetvBuf
0021d8e0 T SteamShutdownEngine
0021daf0 T SteamShutdownSteamBridgeInterface
00222a20 T SteamShutdownUserIDTicketValidator
001eba20 T SteamSizeFile
001eb4b0 T SteamSizeFile64
00201110 T SteamStartEngine
0021ef90 T SteamStartEngineEx
001df270 T SteamStartLoadingCache
001f5d70 T SteamStartup
002234c0 T SteamStartValidatingNewValveCDKey
00224150 T SteamStartValidatingUserIDTicket
001f26e0 T SteamStat
001f2190 T SteamStat64
001df030 T SteamStopLoadingCache
001e4ed0 T SteamSubscribe
001ec490 T SteamTellFile
001ebf80 T SteamTellFile64
001dbd10 T SteamUninstall
001f2e50 T SteamUnmountAppFilesystem
001f2c00 T SteamUnmountFilesystem
001d7150 T SteamUnsubscribe
001d9510 T SteamUpdateAccountBillingInfo
001d92c0 T SteamUpdateSubscriptionBillingInfo
001d9980 T SteamVerifyEmailAddress
001e5430 T SteamVerifyPassword
001e0210 T SteamWaitForAppReadyToLaunch
001e8980 T SteamWaitForAppResources
001e8c30 T SteamWaitForResources
001d8520 T SteamWasBlobRegistryDeleted
00099770 T SteamWeakVerifyNewValveCDKey
001ef490 T SteamWriteFile

So far, I haven't found any game that not satisfied with it, but this is an Inconsistent behavior.

otavepto commented 3 months ago

I don't know the setup but you seem to be mixing 32 and 64 libs. steamclient is found in linux64 folder but then you showed a 32 bit libsteam.

If you're doing lib replacement make sure to run the app from its intended script/executable, I have some which only work when launched through some launcher provided along with it. If you are using the steamclient setup use the script provided, or change it to run on your distro if it needs some changes.

otavepto commented 3 months ago

Just wanted to rant a little bit, you can ignore this comment. This isn't really your problem or something even related to the emu, it's just a dll/lib at the end of the day. It's how Valve decided to setup their environment, plus how some games modify it to handle their own stuff, coupled with the awful way Linux handles dynamic loading which makes such a simple task a pain to even think about. On Windows you know the load order, you know how and where are things loaded, and you have many tools free and some open source, to explore the currently loaded dlls inside the mem space of a process.

The environment I'm referring to is this https://github.com/otavepto/gbe_fork/blob/574e7a77811830e71eefa674212d21ca160d3569/tools/steamclient_loader/linux/steamclient_loader.sh#L28

The steamclient setup along with this option is the safest bet and always 100% of the time in my tests worked, for 32 and 64 bit apps.

detiam commented 3 months ago

I don't know the setup but you seem to be mixing 32 and 64 libs. steamclient is found in linux64 folder but then you showed a 32 bit libsteam.

If you're doing lib replacement make sure to run the app from its intended script/executable, I have some which only work when launched through some launcher provided along with it. If you are using the steamclient setup use the script provided, or change it to run on your distro if it needs some changes.

Because libsteam.so only have one 32bit version available in ~/.local/share/Steam/ubuntu12_32/

And I found I had a mistake, the [API loaded yes] only happen in 32bit game, 64bit game will show [API loaded no] even when launch from official steam client. Guess the libsteam.so thing is a very old behavior of steam for native Linux game in 32bit era… So I think we can just ignore it, will close this.

Just wanted to rant a little bit, you can ignore this comment. This isn't really your problem or something even related to the emu, it's just a dll/lib at the end of the day. It's how Valve decided to setup their environment, plus how some games modify it to handle their own stuff, coupled with the awful way Linux handles dynamic loading which makes such a simple task a pain to even think about. On Windows you know the load order, you know how and where are things loaded, and you have many tools free and some open source, to explore the currently loaded dlls inside the mem space of a process.

The environment I'm referring to is this

https://github.com/otavepto/gbe_fork/blob/574e7a77811830e71eefa674212d21ca160d3569/tools/steamclient_loader/linux/steamclient_loader.sh#L28

The steamclient setup along with this option is the safest bet and always 100% of the time in my tests worked, for 32 and 64 bit apps.

@_@