Decompiled source of LCMI PATCH v0.0.9

lcmipatch.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Cryptography;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using GameNetcodeStuff;
using GameTranslatorNewlinePatch;
using HarmonyLib;
using KeepFurnitureEvenDead;
using Microsoft.CodeAnalysis;
using OpenBodyCamsGuard;
using TMPro;
using TextureReplacerMod;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using UnityEngine.Video;
using WesleyMoonsFix;
using WesleyMoonsSubtitle;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("lcmipatch")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("lcmipatch")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("ed6b10b5-193e-443d-926d-a914fade3d44")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace WesleyMoonsSubtitle
{
	public static class SubtitleData
	{
		public static Dictionary<string, List<SubtitleEntry>> VideoSubtitles = new Dictionary<string, List<SubtitleEntry>>
		{
			["asteroidt1197"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 11.0, "<color=#FF4500>경고:</color> 도스팅은 최고 기밀이라 일반에 공개되지 않습니다."),
				new SubtitleEntry(11.0, 16.0, "<color=#FF4500>경고:</color> 발견된 무기라 해도 쉽게 다루기 어렵습니다."),
				new SubtitleEntry(16.0, 19.0, "<color=#FF4500>경고:</color> 잘못 다루면 게임이 끝장날 수 있습니다."),
				new SubtitleEntry(19.0, 21.0, "<color=#FFD700>경고:</color> 쾅!"),
				new SubtitleEntry(21.0, 25.0, "<color=#FF4500>경고:</color> 전문가를 겨우 찾아냈습니다."),
				new SubtitleEntry(25.0, 29.0, "<color=#FF4500>경고:</color> 이 무기에 남은 건 무엇일까요?"),
				new SubtitleEntry(29.0, 41.0, "<color=#FF4500>경고:</color> 누구든 어떻게든 죽이려는 무기라 오작동도 잦습니다."),
				new SubtitleEntry(44.0, 46.0, "<color=#FFD700>경고:</color> 행운을 빕니다!")
			},
			["asteroidt"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 11.0, "<color=#FF4500>경고:</color> 도스팅은 최고 기밀이라 일반에 공개되지 않습니다."),
				new SubtitleEntry(11.0, 16.0, "<color=#FF4500>경고:</color> 발견된 무기라 해도 쉽게 다루기 어렵습니다."),
				new SubtitleEntry(16.0, 19.0, "<color=#FF4500>경고:</color> 잘못 다루면 게임이 끝장날 수 있습니다."),
				new SubtitleEntry(19.0, 21.0, "<color=#FFD700>경고:</color> 쾅!"),
				new SubtitleEntry(21.0, 25.0, "<color=#FF4500>경고:</color> 전문가를 겨우 찾아냈습니다."),
				new SubtitleEntry(25.0, 29.0, "<color=#FF4500>경고:</color> 이 무기에 남은 건 무엇일까요?"),
				new SubtitleEntry(29.0, 41.0, "<color=#FF4500>경고:</color> 누구든 어떻게든 죽이려는 무기라 오작동도 잦습니다."),
				new SubtitleEntry(44.0, 46.0, "<color=#FFD700>경고:</color> 행운을 빕니다!")
			},
			["babobhakw"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 2.0, "<color=#F15F5F>클로이:</color> 안녕, 난 클로이야."),
				new SubtitleEntry(2.56, 6.0, "<color=#F15F5F>클로이:</color> 넌 날 모를지 몰라도, 나는 너를 알아."),
				new SubtitleEntry(7.28, 11.6, "<color=#F15F5F>클로이:</color> 소울메이트가 죽은 뒤로 너는 계속 위험을 찾아가고 있지."),
				new SubtitleEntry(12.64, 16.48, "<color=#F15F5F>클로이:</color> 내 존재를 또다시 가지고 놀았어."),
				new SubtitleEntry(17.04, 20.12, "<color=#F15F5F>클로이:</color> 넌 스스로를 위험에 던지고,"),
				new SubtitleEntry(20.32, 24.08, "<color=#F15F5F>클로이:</color> 끝을 향해 더 가까이 가고 있어."),
				new SubtitleEntry(25.28, 28.24, "<color=#F15F5F>클로이:</color> 살아남을 자격이 있는지 보자."),
				new SubtitleEntry(28.72, 32.56, "<color=#F15F5F>클로이:</color> 네 몸이 아직 소중하다면,"),
				new SubtitleEntry(32.8, 36.4, "<color=#F15F5F>클로이:</color> 앞에 있는 이들이 손에 칼을 들고 있어."),
				new SubtitleEntry(36.88, 41.52, "<color=#F15F5F>클로이:</color> 방 안 모든 걸 찍는 카메라도 있고,"),
				new SubtitleEntry(41.52, 43.52, "<color=#F15F5F>클로이:</color> 타이머가 0이 되면 시작이야."),
				new SubtitleEntry(44.48, 47.28, "<color=#F15F5F>클로이:</color> 새로 온 직원들도 있지."),
				new SubtitleEntry(47.52, 51.52, "<color=#F15F5F>클로이:</color> 몇 달간 네 팀과 함께했던 사람일지도 몰라."),
				new SubtitleEntry(52.08, 54.32, "<color=#F15F5F>클로이:</color> 네가 자유로워지는 열쇠가 될 거야."),
				new SubtitleEntry(54.32, 57.92, "<color=#F15F5F>클로이:</color> 해야 할 일은 올바른 것을 뽑아내는 것."),
				new SubtitleEntry(58.0, 60.0, "<color=#F15F5F>클로이:</color> 네 손에 든 칼을 잘 써."),
				new SubtitleEntry(60.72, 63.6, "<color=#F15F5F>클로이:</color> 서툴면 둘 다 살아남지 못해."),
				new SubtitleEntry(64.0, 66.48, "<color=#F15F5F>클로이:</color> 둘 다 죽게 될 거야."),
				new SubtitleEntry(67.68, 68.72, "<color=#F15F5F>클로이:</color> 죽을 수도 있어."),
				new SubtitleEntry(69.28, 70.48, "<color=#F15F5F>클로이:</color> 선택해.")
			},
			["calistvideo"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 5.0, "<color=#AAAAAA>남자1:</color> 여기 뷰 하나는 끝내주네."),
				new SubtitleEntry(5.0, 7.0, "<color=#AAAAAA>남자2:</color> 그건 인정."),
				new SubtitleEntry(7.0, 10.0, "<color=#AAAAAA>남자1:</color> 우주에서 보면 더 멋질 거야."),
				new SubtitleEntry(10.0, 14.0, "<color=#AAAAAA>남자2:</color> 말도 안 되지."),
				new SubtitleEntry(14.0, 15.0, "<color=#AAAAAA>남자1:</color> 80에 60."),
				new SubtitleEntry(15.0, 18.0, "<color=#AAAAAA>남자2:</color> 네 인생이 무너지고 있는데, 마치 소설이나 읽는 표정이네."),
				new SubtitleEntry(18.0, 20.0, "<color=#AAAAAA>남자1:</color> 네 휴직 얘기 들었어."),
				new SubtitleEntry(20.0, 23.0, "<color=#AAAAAA>남자2:</color> 방금도 들었지."),
				new SubtitleEntry(23.0, 26.0, "<color=#AAAAAA>남자1:</color> 잠정 휴직이라며?"),
				new SubtitleEntry(27.0, 31.0, "<color=#AAAAAA>남자2:</color> 그런 것들은 대개 영구가 되더라, 안 그래?"),
				new SubtitleEntry(31.0, 36.0, "<color=#AAAAAA>남자1:</color> 비키를 탓하지 마."),
				new SubtitleEntry(42.0, 44.0, "<color=#AAAAAA>남자2:</color> 안 탓해."),
				new SubtitleEntry(44.0, 45.0, "<color=#AAAAAA>남자1:</color> 내가 가르친 건 양쪽 다 노리라는 거야."),
				new SubtitleEntry(45.0, 49.0, "<color=#AAAAAA>남자1:</color> 걔는 생각보다 나를 닮았어."),
				new SubtitleEntry(51.0, 54.0, "<color=#AAAAAA>남자2:</color> 그래서 궁금한데,"),
				new SubtitleEntry(55.0, 58.0, "<color=#AAAAAA>남자2:</color> 너 걔한테 뭘 준 거야?"),
				new SubtitleEntry(58.0, 59.0, "<color=#AAAAAA>남자1:</color> 존중 정도?"),
				new SubtitleEntry(59.0, 61.0, "<color=#AAAAAA>남자1:</color> 네가 나한테 줬어야 할 것."),
				new SubtitleEntry(61.0, 63.0, "<color=#AAAAAA>남자2:</color> 그게 무슨 소용인데?")
			},
			["empratape"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 2.0, "<color=#FFD700>해설:</color> 행복이 뭘까요?"),
				new SubtitleEntry(2.0, 4.0, "<color=#FFD700>해설:</color> 지저분한 작업복인가요?"),
				new SubtitleEntry(4.0, 6.0, "<color=#FFD700>해설:</color> 엉망인 집안일까요?"),
				new SubtitleEntry(6.0, 8.0, "<color=#FFD700>해설:</color> 세상이 당신에게 개판임을 깨닫고 상담이 필요한 절망일까요?"),
				new SubtitleEntry(8.0, 12.0, "<color=#FFD700>해설:</color> 수백만과 같은 운명을 밟을지도 모른다는 공포일까요?"),
				new SubtitleEntry(12.0, 14.0, "<color=#FFD700>해설:</color> 아니면 짓눌리는 삶이 마음을 집어삼킨다면?"),
				new SubtitleEntry(14.0, 16.0, "<color=#FFD700>해설:</color> 결국 지배로 끝난다면?"),
				new SubtitleEntry(18.0, 20.0, "<color=#FFD700>해설:</color> 아니요!"),
				new SubtitleEntry(20.0, 24.0, "<color=#FFD700>해설:</color> 행복은 당신의 돈을 만든 이입니다."),
				new SubtitleEntry(24.0, 28.0, "<color=#FFD700>해설:</color> 행복은 당신 삶을 만든 이입니다."),
				new SubtitleEntry(28.0, 32.0, "<color=#FFD700>해설:</color> 행복은 당신 일자리를 만든 이입니다."),
				new SubtitleEntry(32.0, 34.0, "<color=#FFD700>해설:</color> 행복은 당신을 지키는 이입니다."),
				new SubtitleEntry(34.0, 38.0, "<color=#FFD700>해설:</color> 행복은 황제입니다."),
				new SubtitleEntry(38.0, 40.0, "<color=#FFD700>해설:</color> 열심히 일하면"),
				new SubtitleEntry(40.0, 46.0, "<color=#FFD700>해설:</color> 황금빛 도시로 초대받게 될 겁니다."),
				new SubtitleEntry(46.0, 48.0, "<color=#FFD700>해설:</color> 행복은 황제."),
				new SubtitleEntry(48.0, 52.0, "<color=#FFD700>해설:</color> 황제가 곧 행복입니다.")
			},
			["factotapevideo"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 9.0, "<color=#5CD1E5>내레이션:</color> 당신은 이 사회를 먹여 살리는 음식의 영혼입니다."),
				new SubtitleEntry(9.0, 13.0, "<color=#5CD1E5>내레이션:</color> 탐욕스런 기업이 선 넘을 때"),
				new SubtitleEntry(13.0, 17.0, "<color=#5CD1E5>내레이션:</color> 당신이 한 걸음 나서주길 바랍니다."),
				new SubtitleEntry(17.0, 21.0, "<color=#FFD700>내레이션:</color> 이 환상적인 새 신발을 신어주세요."),
				new SubtitleEntry(21.0, 22.0, "<color=#5CD1E5>내레이션:</color> 팩토에서."),
				new SubtitleEntry(22.0, 25.0, "<color=#5CD1E5>내레이션:</color> 네, 맞습니다."),
				new SubtitleEntry(25.0, 27.0, "<color=#5CD1E5>내레이션:</color> 팩토가 직접 만듭니다."),
				new SubtitleEntry(27.0, 30.0, "<color=#5CD1E5>내레이션:</color> 멋지고 편한 이 신발."),
				new SubtitleEntry(30.0, 34.0, "<color=#5CD1E5>내레이션:</color> 너무 편해서 나가고 싶지 않을걸요."),
				new SubtitleEntry(34.0, 36.0, "<color=#5CD1E5>내레이션:</color> 팩토로 오세요."),
				new SubtitleEntry(36.0, 41.0, "<color=#5CD1E5>내레이션:</color> 오시면 내보내 드리겠습니다.")
			},
			["filitriostape"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 27.44, "<color=#FFD700>광고:</color> 장난감 좋아하세요? 재미도 좋아하세요?"),
				new SubtitleEntry(27.44, 34.44, "<color=#FFD700>광고:</color> 필리트리오스엔 상상 가능한 모든 장난감이 있어요."),
				new SubtitleEntry(34.44, 40.44, "<color=#FFD700>광고:</color> 로봇! 퍼즐 큐브! 신기한 모형들!"),
				new SubtitleEntry(40.44, 41.44, "<color=#FFD700>광고:</color> 로봇!"),
				new SubtitleEntry(41.44, 43.44, "<color=#FFD700>광고:</color> 퍼즐 큐브!"),
				new SubtitleEntry(43.44, 46.44, "<color=#FFD700>광고:</color> 멋진 모형들!"),
				new SubtitleEntry(46.44, 54.44, "<color=#FFD700>광고:</color> 한정 기간, 집 지켜주는 호두까기 병정까지 드립니다!"),
				new SubtitleEntry(54.44, 61.44, "<color=#FFD700>광고:</color> 지금 화면의 번호로 전화하면 장난감 샷건도 같이 드려요!"),
				new SubtitleEntry(61.44, 80.44, "<color=#FFD700>광고:</color> 무료입니다!"),
				new SubtitleEntry(80.44, 87.44, "<color=#FFD700>광고:</color> 지금 당장 140-1 필리트리오스로 오세요!"),
				new SubtitleEntry(87.44, 92.44, "<color=#FFD700>광고:</color> 당신의 꿈이 영원히 사는 곳.")
			},
			["gloomtape"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 2.8, "<color=#5CD1E5>광고:</color> 돈이 필요하신가요?"),
				new SubtitleEntry(2.8, 5.8, "<color=#5CD1E5>광고:</color> 안정적인 일자리 찾으시나요?"),
				new SubtitleEntry(5.8, 10.8, "<color=#5CD1E5>광고:</color> 안전하고 건강한 작업 환경 좋아하시나요?"),
				new SubtitleEntry(10.8, 12.8, "<color=#5CD1E5>광고:</color> 그럼 글룸으로 오세요."),
				new SubtitleEntry(12.8, 16.3, "<color=#5CD1E5>광고:</color> 나무 위에 또 나무가 자랍니다."),
				new SubtitleEntry(16.3, 18.3, "<color=#5CD1E5>광고:</color> 우리는 그걸 전부 베어야 합니다."),
				new SubtitleEntry(18.3, 20.3, "<color=#5CD1E5>광고:</color> 함께 해주시겠습니까?"),
				new SubtitleEntry(20.3, 22.8, "<color=#5CD1E5>광고:</color> 블루 엠로깅 컴퍼니."),
				new SubtitleEntry(22.8, 24.8, "<color=#5CD1E5>광고:</color> 역사에 이름을 새기세요."),
				new SubtitleEntry(30.6, 32.1, "<color=#32CD32>광고:</color> 휴가도 있습니다!"),
				new SubtitleEntry(33.7, 35.9, "<color=#32CD32>광고:</color> 무엇을 원하시나요?"),
				new SubtitleEntry(35.9, 38.9, "<color=#32CD32>광고:</color> 정말 원하는 게 뭔가요?"),
				new SubtitleEntry(38.9, 40.9, "<color=#32CD32>광고:</color> 살인?"),
				new SubtitleEntry(40.9, 42.3, "<color=#32CD32>광고:</color> 살인자?"),
				new SubtitleEntry(42.3, 43.6, "<color=#32CD32>광고:</color> 돈 좀 벌래요?"),
				new SubtitleEntry(43.6, 45.8, "<color=#32CD32>광고:</color> 살인자?"),
				new SubtitleEntry(45.8, 48.4, "<color=#32CD32>광고:</color> 이름이 뭐죠?"),
				new SubtitleEntry(48.9, 52.6, "<color=#32CD32>광고:</color> 살인자?"),
				new SubtitleEntry(52.6, 57.7, "<color=#32CD32>광고:</color> 살인자?"),
				new SubtitleEntry(57.7, 59.6, "<color=#32CD32>광고:</color> <i>…무의미한 중얼거림…</i>")
			},
			["halloweenclipa"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 8.0, "<color=#FF6600>장례사:</color> 우리는 죽은 이를 묻는 손입니다."),
				new SubtitleEntry(8.0, 13.0, "<color=#FF6600>장례사:</color> 당신은 우리 손이 더러워지지 않게 막는 삽입니다."),
				new SubtitleEntry(13.0, 19.0, "<color=#FF6600>장례사:</color> 죽은 자가 누가 살고 죽을지 좌지우지하게 둘 순 없습니다."),
				new SubtitleEntry(19.0, 27.0, "<color=#FF6600>장례사:</color> 버려진 아이를 찾아 시신을 처리하면 내보내 주죠.")
			},
			["hyxtapefinalpass1"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 9.6, "<color=#5CD1E5>광고:</color> 올여름 단 하나의 휴가지를 찾고 계신가요?"),
				new SubtitleEntry(9.6, 12.6, "<color=#8D021F>???:</color> ...힉스.."),
				new SubtitleEntry(12.6, 15.6, "<color=#5CD1E5>광고:</color> 자연의 아름다움을 만끽하세요."),
				new SubtitleEntry(15.6, 18.8, "<color=#5CD1E5>광고:</color> 당신은 똑똑하고, 악동 같고, 정말 똑똑하죠!"),
				new SubtitleEntry(18.8, 23.1, "<color=#5CD1E5>광고:</color> 이곳이 가족과 함께하기 딱 좋은 곳입니다."),
				new SubtitleEntry(23.1, 26.3, "<color=#5CD1E5>광고:</color> 제 인생의 끝입니다."),
				new SubtitleEntry(26.4, 30.4, "<color=#5CD1E5>광고:</color> 지금 여행을 예약하세요, 우리가 여기서 맞이할게요..."),
				new SubtitleEntry(30.4, 33.4, "<color=#FFD700>???:</color> ...롱 세이더에서!")
			},
			["hyxtapefinalpass1603106"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 9.6, "<color=#5CD1E5>광고:</color> 올여름 단 하나의 휴가지를 찾고 계신가요?"),
				new SubtitleEntry(9.6, 12.6, "<color=#8D021F>???:</color> ...힉스.."),
				new SubtitleEntry(12.6, 15.6, "<color=#5CD1E5>광고:</color> 자연의 아름다움을 만끽하세요."),
				new SubtitleEntry(15.6, 18.8, "<color=#5CD1E5>광고:</color> 당신은 똑똑하고, 악동 같고, 정말 똑똑하죠!"),
				new SubtitleEntry(18.8, 23.1, "<color=#5CD1E5>광고:</color> 이곳이 가족과 함께하기 딱 좋은 곳입니다."),
				new SubtitleEntry(23.1, 26.3, "<color=#5CD1E5>광고:</color> 제 인생의 끝입니다."),
				new SubtitleEntry(26.4, 30.4, "<color=#5CD1E5>광고:</color> 지금 여행을 예약하세요, 우리가 여기서 맞이할게요..."),
				new SubtitleEntry(30.4, 33.4, "<color=#FFD700>>???:</color> ...롱 세이더에서!")
			},
			["motratape"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 2.8, "<color=#5CD1E5>해리:</color> 안녕하세요, 박경포 박격포의 해리입니다."),
				new SubtitleEntry(2.8, 4.92, "<color=#5CD1E5>해리:</color> 박경포씨가 제작한, 박격포라구요."),
				new SubtitleEntry(4.92, 7.12, "<color=#5CD1E5>해리:</color> 이 박격포면 절대 무너지지 않습니다."),
				new SubtitleEntry(7.12, 8.96, "<color=#5CD1E5>해리:</color> 일반 방어는 효과가 없죠."),
				new SubtitleEntry(8.96, 11.6, "<color=#5CD1E5>해리:</color> 집이 털리는 경우 많잖아요."),
				new SubtitleEntry(11.6, 15.18, "<color=#5CD1E5>해리:</color> 도둑, 이웃, 미친 전 애인, 거대한 벌까지."),
				new SubtitleEntry(15.18, 18.86, "<color=#5CD1E5>해리:</color> 닌텐도도, 나도 이걸 뚫진 못해요."),
				new SubtitleEntry(18.86, 21.68, "<color=#5CD1E5>해리:</color> 일반 박격포는 한 발씩 쏘지만"),
				new SubtitleEntry(21.68, 24.92, "<color=#5CD1E5>해리:</color> 이건 눈 깜빡할 사이에 잠금까지 걸립니다."),
				new SubtitleEntry(24.92, 28.16, "<color=#5CD1E5>해리:</color> 누구도 예상 못 하죠."),
				new SubtitleEntry(28.16, 30.26, "<color=#5CD1E5>해리:</color> 마당에도, 차에도, 벽에도 붙이세요."),
				new SubtitleEntry(30.26, 32.62, "<color=#5CD1E5>해리:</color> 스포터가 알아서 쏩니다."),
				new SubtitleEntry(32.62, 36.86, "<color=#5CD1E5>해리:</color> 섬에서 물 모을 때도 쓸 수 있어요."),
				new SubtitleEntry(36.86, 40.42, "<color=#FFD700>해리:</color> 박경포의 박격포, 개당 30만!"),
				new SubtitleEntry(40.42, 42.5, "<color=#FFD700>해리:</color> 지금 20분 안에 전화하면"),
				new SubtitleEntry(42.5, 44.5, "<color=#FFD700>해리:</color> 두 번째를 공짜로 드립니다!")
			},
			["motratape600308"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 2.8, "<color=#5CD1E5>해리:</color> 안녕하세요, 박경포 박격포의 해리입니다."),
				new SubtitleEntry(2.8, 4.92, "<color=#5CD1E5>해리:</color> 박경포씨가 제작한, 박격포라구요."),
				new SubtitleEntry(4.92, 7.12, "<color=#5CD1E5>해리:</color> 이 박격포는 절대 무너지지 않습니다."),
				new SubtitleEntry(7.12, 8.96, "<color=#5CD1E5>해리:</color> 일반 방어는 효과가 없죠."),
				new SubtitleEntry(8.96, 11.6, "<color=#5CD1E5>해리:</color> 집이 털리는 경우 많잖아요."),
				new SubtitleEntry(11.6, 15.18, "<color=#5CD1E5>해리:</color> 도둑, 이웃, 미친 전 애인, 거대한 벌까지."),
				new SubtitleEntry(15.18, 18.86, "<color=#5CD1E5>해리:</color> 닌텐도도, 나도 이걸 뚫진 못해요."),
				new SubtitleEntry(18.86, 21.68, "<color=#5CD1E5>해리:</color> 일반 박격포는 한 발씩 쏘지만"),
				new SubtitleEntry(21.68, 24.92, "<color=#5CD1E5>해리:</color> 이건 눈 깜빡할 사이에 잠금까지 걸립니다."),
				new SubtitleEntry(24.92, 28.16, "<color=#5CD1E5>해리:</color> 누구도 예상 못 하죠."),
				new SubtitleEntry(28.16, 30.26, "<color=#5CD1E5>해리:</color> 마당에도, 차에도, 벽에도 붙이세요."),
				new SubtitleEntry(30.26, 32.62, "<color=#5CD1E5>해리:</color> 스포터가 알아서 쏩니다."),
				new SubtitleEntry(32.62, 36.86, "<color=#5CD1E5>해리:</color> 섬에서 물 모을 때도 쓸 수 있어요."),
				new SubtitleEntry(36.86, 40.42, "<color=#FFD700>해리:</color> 박경포의 박격포, 개당 30만!"),
				new SubtitleEntry(40.42, 42.5, "<color=#FFD700>해리:</color> 지금 20분 안에 전화하면"),
				new SubtitleEntry(42.5, 44.5, "<color=#FFD700>해리:</color> 두 번째를 공짜로 드립니다!")
			},
			["murkofftapebsecondpass"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 11.48, "<color=#F15F5F>머코프:</color> 충성은 제국을 지탱하는 기반이다. 충성을 못 지키는 자는 처벌받는다."),
				new SubtitleEntry(11.48, 14.6, "<color=#F15F5F>머코프:</color> 너는 나를 위해 불속도 뛰어들 준비가 되어 있다."),
				new SubtitleEntry(14.6, 18.4, "<color=#F15F5F>머코프:</color> 모두가 너처럼 되길 바란다."),
				new SubtitleEntry(18.4, 22.52, "<color=#F15F5F>머코프:</color> 이 변호사가 우리의 말과 고통을 가르칠 것이다. 그러면 내보내 주겠다.")
			},
			["murkofftapecsecondpass"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 14.12, "<color=#F15F5F>머코프:</color> 너는 간호사다. 아픈 자에게 약을 전하는 게 네 의무다."),
				new SubtitleEntry(14.12, 22.44, "<color=#F15F5F>머코프:</color> 일부는 약을 남용해 자기 병을 키운다. 누구에게 고통을 덜 기회를 줄지 우리가 정해야 한다."),
				new SubtitleEntry(22.44, 29.96, "<color=#F15F5F>머코프:</color> 친절을 중독에 악용하는 자는 독살하라. 그러면 내보내 주겠다.")
			},
			["murkofftapedsecondpass"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 13.28, "<color=#F15F5F>머코프:</color> 너는 퍼지는 불꽃이다. 그들이 우리의 진실을 거슬러 정보를 퍼뜨리게 둘 수 없다."),
				new SubtitleEntry(13.28, 21.6, "<color=#F15F5F>머코프:</color> 내가 원하는 거미가 되어라. 기사와 기자를 찾아라."),
				new SubtitleEntry(21.6, 24.64, "<color=#F15F5F>머코프:</color> 태워버리면 내보내 주겠다.")
			},
			["murkofftapeesecondpass"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 13.04, "<color=#F15F5F>머코프:</color> 신디케이트는 가족이다. 인맥과 범죄로 힘을 모은다."),
				new SubtitleEntry(13.04, 18.36, "<color=#F15F5F>머코프:</color> 사다리를 오르는 잔혹함을 배워야 한다."),
				new SubtitleEntry(18.36, 24.44, "<color=#F15F5F>머코프:</color> 조직 보스를 찾아 그의 가족에게 '합류'시켜라."),
				new SubtitleEntry(24.44, 29.56, "<color=#F15F5F>머코프:</color> 그의 꿈을 저녁거리로 갈아버려라. 그럼 내보내 주겠다.")
			},
			["murkofftapefsecondpass"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 12.68, "<color=#F15F5F>머코프:</color> 재구조화는 큰 조정이 필요하다. 우리의 미래를 위해"),
				new SubtitleEntry(12.68, 13.84, "<color=#F15F5F>머코프:</color> 뛰어내려라."),
				new SubtitleEntry(13.84, 19.32, "<color=#F15F5F>머코프:</color> 네가 나에게 자신을 증명할 시간이다."),
				new SubtitleEntry(19.32, 24.96, "<color=#F15F5F>머코프:</color> 우리는 쓸모없던 것을 가치 있게 다시 빚는다."),
				new SubtitleEntry(24.96, 29.12, "<color=#F15F5F>머코프:</color> 이 실패작을 쓸모 있는 자산으로 바꿔라."),
				new SubtitleEntry(29.12, 32.88, "<color=#F15F5F>머코프:</color> 배운 것을 보여주면 내보내 주겠다.")
			},
			["utrilvideo599669"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 7.0, "<color=#5CD1E5>해링턴 교수:</color> 형편없는 장비지만 남은 생을 기록해보려 합니다."),
				new SubtitleEntry(7.0, 14.0, "<color=#5CD1E5>해링턴 교수:</color> 해링턴 교수입니다. 지금 유트릴에 와 있습니다."),
				new SubtitleEntry(14.0, 22.0, "<color=#5CD1E5>해링턴 교수:</color> 낮이 밤보다 어둡지만 묘한 아름다움이 있네요."),
				new SubtitleEntry(22.0, 27.0, "<color=#5CD1E5>해링턴 교수:</color> 여긴 제가 올 거라 예상한 곳이 아닙니다."),
				new SubtitleEntry(27.0, 34.0, "<color=#5CD1E5>해링턴 교수:</color> 야생 생물은 다양하지 않습니다."),
				new SubtitleEntry(34.0, 39.0, "<color=#5CD1E5>해링턴 교수:</color> 대체로 작은 위험 요소와 거미류뿐."),
				new SubtitleEntry(39.0, 47.0, "<color=#5CD1E5>해링턴 교수:</color> 공격적인 건 거미가 아니라는 게 놀랍군요."),
				new SubtitleEntry(47.0, 52.0, "<color=#5CD1E5>해링턴 교수:</color> 사진 찍히는 걸 더 좋아하는 것 같습니다."),
				new SubtitleEntry(52.0, 59.0, "<color=#5CD1E5>해링턴 교수:</color> 이제 연구실로 돌아가야겠어요. 이상 해링턴.")
			},
			["videotapeacidir"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 9.36, "<color=#5CD1E5>커닝햄 선장:</color> 아시디르 테이프입니다. 커닝햄 선장입니다."),
				new SubtitleEntry(9.36, 20.08, "<color=#5CD1E5>커닝햄 선장:</color> 우리가 도착했을 때 승무원들은 괜찮아 보였습니다. 뭐, '괜찮다'라는 표현이 맞는지... 그럭저럭 버텼습니다."),
				new SubtitleEntry(20.08, 34.56, "<color=#5CD1E5>커닝햄 선장:</color> 하지만 여기 오래 머물수록 상황이 악화되는 것 같습니다. 공기 때문인지, 방식 때문인지, 산성 호수 때문인지..."),
				new SubtitleEntry(34.56, 41.6, "<color=#F15F5F>커닝햄 선장:</color> 몇몇은 이미 실종됐습니다. 아시디르에서 커닝햄, 서명합니다.")
			},
			["videotapeatlantica"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 9.0, "<color=#5CD1E5>커닝햄 선장:</color> 테이프 2, 아틀란티카입니다. 커닝햄 선장입니다."),
				new SubtitleEntry(9.0, 12.0, "<color=#5CD1E5>커닝햄 선장:</color> 아틀란티카에 가는 건 원래 계획에 없었습니다."),
				new SubtitleEntry(14.0, 19.0, "<color=#5CD1E5>커닝햄 선장:</color> 순수히 호기심이 우리를 여기로 이끌었습니다."),
				new SubtitleEntry(19.0, 25.0, "<color=#5CD1E5>커닝햄 선장:</color> 현재까지 보고된 것처럼 비정상적인 것은 발견하지 못했습니다."),
				new SubtitleEntry(25.0, 32.0, "<color=#5CD1E5>커닝햄 선장:</color> 하지만 이 장소에 뭔가 이상한 점이 있는 것 같습니다."),
				new SubtitleEntry(32.0, 34.0, "<color=#5CD1E5>커닝햄 선장:</color> 아름답지만... 뭔가가 떠나라고 말하는 것 같습니다."),
				new SubtitleEntry(34.0, 41.0, "<color=#5CD1E5>커닝햄 선장:</color> 지금까지 이곳은 C등급입니다. 하지만 떠날 때쯤엔 바뀔 수도 있습니다."),
				new SubtitleEntry(41.0, 44.0, "<color=#5CD1E5>커닝햄 선장:</color> 서명합니다.")
			},
			["videotapeetern"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 4.56, "<color=#5CD1E5>커닝햄 선장:</color> 기록 3, 에테른입니다."),
				new SubtitleEntry(4.56, 11.4, "<color=#5CD1E5>커닝햄 선장:</color> 여기서는 많이 녹화하지 못했습니다. 최대한 빨리 떠날 겁니다."),
				new SubtitleEntry(11.4, 19.16, "<color=#5CD1E5>커닝햄 선장:</color> 에테른 여행은 완전한 재앙이었습니다."),
				new SubtitleEntry(19.16, 26.24, "<color=#F15F5F>커닝햄 선장:</color> 이 사막의 모래알보다 더 많은 호두까기 인형들이 우리를 쫓고 있었습니다."),
				new SubtitleEntry(26.24, 38.16, "<color=#5CD1E5>커닝햄 선장:</color> 많은 동료를 잃었습니다. 더 이상 잃고 싶지 않습니다. 에테른은 S+ 등급입니다. 누구에게도 여기 오는 걸 권하지 않습니다."),
				new SubtitleEntry(38.16, 39.76, "<color=#5CD1E5>커닝햄 선장:</color> 서명합니다.")
			},
			["videotapegratar"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 1.52, "<color=#5CD1E5>커닝햄 대위:</color> 테이프 5."),
				new SubtitleEntry(1.52, 2.52, "<color=#5CD1E5>커닝햄 대위:</color> 그라타르."),
				new SubtitleEntry(2.52, 5.08, "<color=#5CD1E5>커닝햄 대위:</color> 커닝햄 대위입니다."),
				new SubtitleEntry(5.08, 8.04, "<color=#5CD1E5>커닝햄 대위:</color> 도착한 지 얼마 안 됐습니다."),
				new SubtitleEntry(8.04, 12.08, "<color=#5CD1E5>커닝햄 대위:</color> 지금까지 겪은 것에 비하면 신선한 공기 같습니다."),
				new SubtitleEntry(12.08, 14.88, "<color=#5CD1E5>커닝햄 대위:</color> 경치가 정말 멋집니다."),
				new SubtitleEntry(14.88, 19.32, "<color=#5CD1E5>커닝햄 대위:</color> 아직 야생 생물이 우리를 죽이려 하지 않았습니다."),
				new SubtitleEntry(19.32, 26.08, "<color=#5CD1E5>커닝햄 대위:</color> 곧 AI와 대화하러 들어간 후 다시 출발할 겁니다."),
				new SubtitleEntry(26.08, 29.16, "<color=#5CD1E5>커닝햄 대위:</color> 그라타르는 낮은 C 등급입니다."),
				new SubtitleEntry(29.16, 31.16, "<color=#5CD1E5>커닝햄 대위:</color> 서명합니다.")
			},
			["videotapeinfernis"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 5.0, "<color=#5CD1E5>커닝햄 대위:</color> 테이프 1, 인페르니스."),
				new SubtitleEntry(5.0, 8.0, "<color=#5CD1E5>커닝햄 대위:</color> 저는 커닝햄 대위입니다."),
				new SubtitleEntry(8.0, 13.0, "<color=#5CD1E5>커닝햄 대위:</color> 연구 장소와 환경을 기록하기로 했습니다."),
				new SubtitleEntry(13.0, 17.0, "<color=#5CD1E5>커닝햄 대위:</color> 현재 위치는 인페르니스입니다."),
				new SubtitleEntry(17.0, 23.0, "<color=#FF4500>커닝햄 대위:</color> 이 불지옥은 우리를 늦출 뿐입니다."),
				new SubtitleEntry(23.0, 30.0, "<color=#5CD1E5>커닝햄 대위:</color> 지진 활동이 꽤 높아서 오래 머물 생각은 없습니다."),
				new SubtitleEntry(30.0, 37.0, "<color=#5CD1E5>커닝햄 대위:</color> 다행히 광산 갱도에 벌레가 가득해서 아무것도 할 수 없습니다."),
				new SubtitleEntry(53.0, 59.0, "<color=#5CD1E5>커닝햄 대위:</color> 이곳은 B+ 등급입니다. 서명합니다.")
			},
			["videotapeinfernis602189"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 5.0, "<color=#5CD1E5>커닝햄 대위:</color> 테이프 1, 인페르니스."),
				new SubtitleEntry(5.0, 8.0, "<color=#5CD1E5>커닝햄 대위:</color> 저는 커닝햄 대위입니다."),
				new SubtitleEntry(8.0, 13.0, "<color=#5CD1E5>커닝햄 대위:</color> 연구 장소와 환경을 기록하기로 했습니다."),
				new SubtitleEntry(13.0, 17.0, "<color=#5CD1E5>커닝햄 대위:</color> 현재 위치는 인페르니스입니다."),
				new SubtitleEntry(17.0, 23.0, "<color=#FF4500>커닝햄 대위:</color> 이 불지옥은 우리를 늦출 뿐입니다."),
				new SubtitleEntry(23.0, 30.0, "<color=#5CD1E5>커닝햄 대위:</color> 지진 활동이 꽤 높아서 오래 머물 생각은 없습니다."),
				new SubtitleEntry(30.0, 37.0, "<color=#5CD1E5>커닝햄 대위:</color> 다행히 광산 갱도에 벌레가 가득해서 아무것도 할 수 없습니다."),
				new SubtitleEntry(53.0, 59.0, "<color=#5CD1E5>커닝햄 대위:</color> 이곳은 B+ 등급입니다. 서명합니다.")
			},
			["apparatuspulledvox"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 6.92, "<color=#F15F5F>경보:</color> 보안 잠금 경보! 보안문이 곧 닫힙니다!")
			},
			["blastdoorsclosedvox"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 5.2, "<color=#F15F5F>경보:</color> 보안문 작동. 잠금이 활성화되었습니다.")
			},
			["nowarriving"] = new List<SubtitleEntry>
			{
				new SubtitleEntry(0.0, 18.2, "<color=#5CD1E5>방송:</color> 지금 C 구역 시험실과 관제 시설에 도착했습니다.")
			},
			["utrilvideo"] = new List<SubtitleEntry>()
		};
	}
	public class SubtitleEntry
	{
		public double StartTime { get; set; }

		public double EndTime { get; set; }

		public string Text { get; set; }

		public SubtitleEntry(double start, double end, string text)
		{
			StartTime = start;
			EndTime = end;
			Text = text;
		}
	}
	public class VideoPlayerTracker
	{
		public VideoPlayer Player { get; private set; }

		public bool WasPlaying { get; set; }

		public double LastTime { get; set; }

		public VideoPlayerTracker(VideoPlayer player)
		{
			Player = player;
			WasPlaying = false;
			LastTime = 0.0;
		}
	}
	public class WesleyMoonsSubtitleMod : MonoBehaviour
	{
		public static WesleyMoonsSubtitleMod Instance;

		public static ManualLogSource logger;

		private static TextMeshProUGUI subtitleText;

		private static GameObject subtitleGUI;

		private static bool isInitialized = false;

		private static Dictionary<int, VideoPlayerTracker> trackedPlayers = new Dictionary<int, VideoPlayerTracker>();

		private void Awake()
		{
			Instance = this;
			logger = Logger.CreateLogSource("WesleyMoonsSubtitle");
			logger.LogInfo((object)"Wesley's Moons 한글 자막 모드 로드됨!");
		}

		private void Update()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			if (!isInitialized && (Object)HUDManager.Instance != (Object)null)
			{
				InitializeSubtitleUI();
			}
			ScanAndTrackVideoPlayers();
			UpdateSubtitles();
		}

		private void InitializeSubtitleUI()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Expected O, but got Unknown
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Expected O, but got Unknown
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Expected O, but got Unknown
			try
			{
				GameObject val = GameObject.Find("WesleySubtitleGUI");
				if ((Object)val != (Object)null)
				{
					subtitleGUI = val;
					subtitleText = val.GetComponent<TextMeshProUGUI>();
					if ((Object)subtitleText != (Object)null)
					{
						isInitialized = true;
						return;
					}
				}
				subtitleGUI = new GameObject("WesleySubtitleGUI");
				subtitleGUI.AddComponent<RectTransform>();
				subtitleText = subtitleGUI.AddComponent<TextMeshProUGUI>();
				RectTransform rectTransform = ((TMP_Text)subtitleText).rectTransform;
				GameObject val2 = GameObject.Find("Systems/UI/Canvas/Panel/GameObject/PlayerScreen") ?? GameObject.Find("Systems/UI/Canvas");
				if ((Object)val2 != (Object)null)
				{
					((Transform)rectTransform).SetParent(val2.transform, false);
				}
				rectTransform.sizeDelta = new Vector2(800f, 200f);
				rectTransform.anchorMin = new Vector2(0.5f, 0.5f);
				rectTransform.anchorMax = new Vector2(0.5f, 0.5f);
				rectTransform.pivot = new Vector2(0.5f, 0.5f);
				rectTransform.anchoredPosition = new Vector2(0f, -125f);
				((TMP_Text)subtitleText).alignment = (TextAlignmentOptions)514;
				((TMP_Text)subtitleText).font = ((TMP_Text)HUDManager.Instance.controlTipLines[0]).font;
				((TMP_Text)subtitleText).fontSize = 18f;
				((TMP_Text)subtitleText).enableWordWrapping = true;
				((TMP_Text)subtitleText).overflowMode = (TextOverflowModes)0;
				((TMP_Text)subtitleText).text = "";
				Material fontMaterial = ((TMP_Text)subtitleText).fontMaterial;
				if ((Object)fontMaterial != (Object)null)
				{
					((TMP_Text)subtitleText).fontMaterial = Object.Instantiate<Material>(fontMaterial);
				}
				isInitialized = true;
				logger.LogInfo((object)"자막 UI 초기화 완료");
			}
			catch (Exception ex)
			{
				logger.LogError((object)("자막 UI 초기화 실패: " + ex.Message));
			}
		}

		private void ScanAndTrackVideoPlayers()
		{
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Expected O, but got Unknown
			VideoPlayer[] array = Object.FindObjectsOfType<VideoPlayer>();
			foreach (VideoPlayer val in array)
			{
				int instanceID = ((Object)val).GetInstanceID();
				if (!trackedPlayers.ContainsKey(instanceID))
				{
					VideoPlayerTracker value = new VideoPlayerTracker(val);
					trackedPlayers[instanceID] = value;
					logger.LogInfo((object)("VideoPlayer 추적 시작: " + GetVideoName(val)));
				}
			}
			List<int> list = new List<int>();
			foreach (KeyValuePair<int, VideoPlayerTracker> trackedPlayer in trackedPlayers)
			{
				if ((Object)trackedPlayer.Value.Player == (Object)null)
				{
					list.Add(trackedPlayer.Key);
				}
			}
			foreach (int item in list)
			{
				trackedPlayers.Remove(item);
			}
		}

		private void UpdateSubtitles()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			if ((Object)subtitleText == (Object)null)
			{
				return;
			}
			string text = "";
			foreach (KeyValuePair<int, VideoPlayerTracker> trackedPlayer in trackedPlayers)
			{
				VideoPlayerTracker value = trackedPlayer.Value;
				if (!((Object)value.Player == (Object)null) && value.Player.isPlaying)
				{
					string videoName = GetVideoName(value.Player);
					double time = value.Player.time;
					string subtitleForVideo = GetSubtitleForVideo(videoName, time);
					if (!string.IsNullOrEmpty(subtitleForVideo))
					{
						text = subtitleForVideo;
						break;
					}
				}
			}
			((TMP_Text)subtitleText).text = text;
		}

		private static string GetVideoName(VideoPlayer player)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			if ((Object)player == (Object)null)
			{
				return "";
			}
			if ((Object)player.clip != (Object)null)
			{
				return ((Object)player.clip).name;
			}
			if (!string.IsNullOrEmpty(player.url))
			{
				return Path.GetFileNameWithoutExtension(player.url);
			}
			return ((Object)((Component)player).gameObject).name;
		}

		private static string GetSubtitleForVideo(string videoName, double time)
		{
			string key = NormalizeVideoName(videoName);
			if (SubtitleData.VideoSubtitles.TryGetValue(key, out var value))
			{
				for (int i = 0; i < value.Count; i++)
				{
					SubtitleEntry subtitleEntry = value[i];
					bool flag = i == value.Count - 1;
					double num = subtitleEntry.EndTime + (flag ? 1.0 : 0.0);
					if (time >= subtitleEntry.StartTime && time < num)
					{
						return subtitleEntry.Text;
					}
				}
			}
			return "";
		}

		private static string NormalizeVideoName(string name)
		{
			if (string.IsNullOrEmpty(name))
			{
				return "";
			}
			name = Path.GetFileNameWithoutExtension(name);
			return name.Replace(" ", "").Replace("#", "").Replace("-", "")
				.Replace("_", "")
				.Replace("(", "")
				.Replace(")", "")
				.ToLower();
		}

		private void OnDestroy()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			trackedPlayers.Clear();
			if ((Object)subtitleGUI != (Object)null)
			{
				Object.Destroy((Object)subtitleGUI);
			}
			isInitialized = false;
		}
	}
}
namespace WesleyMoonsFix
{
	public static class WesleyMoonsFixPatch
	{
		private static ManualLogSource logger;

		private static Harmony harmony;

		private static bool isPatched;

		private static Type backDoorType;

		private static Type appyInsertType;

		private static FieldInfo apparatusSocketsField;

		private static FieldInfo backDoorField;

		public static void Initialize(ManualLogSource log)
		{
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Expected O, but got Unknown
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Expected O, but got Unknown
			logger = log;
			if (!Chainloader.PluginInfos.ContainsKey("JacobG5.WesleyMoons"))
			{
				logger.LogInfo((object)"[WesleyMoonsFix] Wesley's Moons 모드가 설치되지 않음 - 패치 스킵");
			}
			else
			{
				if (isPatched)
				{
					return;
				}
				try
				{
					backDoorType = AccessTools.TypeByName("WesleyMoons.Component.BackDoor");
					appyInsertType = AccessTools.TypeByName("WesleyMoons.Component.AppyInsert");
					if (backDoorType == null || appyInsertType == null)
					{
						logger.LogWarning((object)"[WesleyMoonsFix] WesleyMoons 타입을 찾을 수 없음");
						return;
					}
					apparatusSocketsField = AccessTools.Field(backDoorType, "apparatusSockets");
					backDoorField = AccessTools.Field(appyInsertType, "backDoor");
					if (apparatusSocketsField == null || backDoorField == null)
					{
						logger.LogWarning((object)"[WesleyMoonsFix] WesleyMoons 필드를 찾을 수 없음");
						return;
					}
					harmony = new Harmony("kr.mine9289.WesleyMoonsFix");
					MethodInfo methodInfo = AccessTools.Method(backDoorType, "OnNetworkSpawn", (Type[])null, (Type[])null);
					if (methodInfo != null)
					{
						harmony.Patch((MethodBase)methodInfo, (HarmonyMethod)null, new HarmonyMethod(typeof(WesleyMoonsFixPatch), "OnNetworkSpawn_Postfix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
						logger.LogInfo((object)"[WesleyMoonsFix] BackDoor.OnNetworkSpawn 패치 적용 완료!");
						isPatched = true;
						logger.LogInfo((object)"[WesleyMoonsFix] Wesley's Moons Apparatus 삽입 버그 수정 완료!");
					}
					else
					{
						logger.LogWarning((object)"[WesleyMoonsFix] BackDoor.OnNetworkSpawn 메서드를 찾을 수 없음");
					}
				}
				catch (Exception arg)
				{
					logger.LogError((object)$"[WesleyMoonsFix] 패치 적용 실패: {arg}");
				}
			}
		}

		private static void OnNetworkSpawn_Postfix(object __instance)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			try
			{
				NetworkBehaviour val = (NetworkBehaviour)((__instance is NetworkBehaviour) ? __instance : null);
				if ((Object)val == (Object)null || !(apparatusSocketsField.GetValue(__instance) is Array array) || array.Length == 0)
				{
					return;
				}
				int num = 0;
				foreach (object item in array)
				{
					if (item != null && backDoorField.GetValue(item) == null)
					{
						backDoorField.SetValue(item, __instance);
						num++;
					}
				}
				if (num > 0 && logger != null)
				{
					bool flag = val.IsHost || val.IsServer;
					logger.LogInfo((object)$"[WesleyMoonsFix] BackDoor와 AppyInsert {num}개 연결 완료 (IsHost: {flag})");
				}
			}
			catch (Exception arg)
			{
				ManualLogSource val2 = logger;
				if (val2 != null)
				{
					val2.LogError((object)$"[WesleyMoonsFix] OnNetworkSpawn_Postfix 오류: {arg}");
				}
			}
		}
	}
}
namespace TextureReplacerMod
{
	public static class AntiAltF4Exploit
	{
		[HarmonyPatch]
		public static class DisconnectPatch
		{
			[HarmonyPatch(typeof(GameNetworkManager), "Disconnect")]
			[HarmonyPrefix]
			public static void OnDisconnect()
			{
				try
				{
					ForceSaveGame("로비로 나가기", ignoreRoundFlag: true);
				}
				catch (Exception ex)
				{
					ManualLogSource logger = AntiAltF4Exploit.logger;
					if (logger != null)
					{
						logger.LogError((object)("OnDisconnect 저장 에러: " + ex.Message));
					}
				}
			}
		}

		[HarmonyPatch]
		public static class AntiAltF4Patch
		{
			[HarmonyPatch(typeof(StartOfRound), "StartGame")]
			[HarmonyPostfix]
			public static void OnStartGame()
			{
				hasSavedThisRound = false;
			}

			[HarmonyPatch(typeof(PlayerControllerB), "KillPlayer")]
			[HarmonyPostfix]
			public static void OnPlayerKilled(PlayerControllerB __instance)
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Expected O, but got Unknown
				if (hasSavedThisRound)
				{
					return;
				}
				try
				{
					StartOfRound instance = StartOfRound.Instance;
					if (!((Object)instance == (Object)null) && instance.shipHasLanded && !instance.inShipPhase && AreAllPlayersDead())
					{
						ForceSaveGame("모든 플레이어 사망");
					}
				}
				catch (Exception ex)
				{
					ManualLogSource logger = AntiAltF4Exploit.logger;
					if (logger != null)
					{
						logger.LogError((object)("OnPlayerKilled 에러: " + ex.Message));
					}
				}
			}

			[HarmonyPatch(typeof(StartOfRound), "ShipLeave")]
			[HarmonyPrefix]
			public static void OnShipLeave()
			{
				if (!hasSavedThisRound && AreAllPlayersDead())
				{
					ForceSaveGame("우주선 출발 (전멸 상태)");
				}
			}

			[HarmonyPatch(typeof(StartOfRound), "ShipHasLeft")]
			[HarmonyPostfix]
			public static void OnShipHasLeft()
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Expected O, but got Unknown
				try
				{
					StartOfRound instance = StartOfRound.Instance;
					if ((Object)instance != (Object)null && instance.allPlayersDead)
					{
						ForceSaveGame("우주선 출발 완료 (전멸 확정)", ignoreRoundFlag: true);
					}
				}
				catch (Exception ex)
				{
					ManualLogSource logger = AntiAltF4Exploit.logger;
					if (logger != null)
					{
						logger.LogError((object)("OnShipHasLeft 에러: " + ex.Message));
					}
				}
			}

			[HarmonyPatch(typeof(StartOfRound), "ShipLeaveAutomatically")]
			[HarmonyPrefix]
			public static void OnShipLeaveAutomatically()
			{
				ForceSaveGame("우주선 자동 출발 (시간 초과)", ignoreRoundFlag: true);
			}

			[HarmonyPatch(typeof(StartOfRound), "EndGameServerRpc")]
			[HarmonyPrefix]
			public static void OnEndGameServerRpc()
			{
				ForceSaveGame("게임 종료 시퀀스 (서버)", ignoreRoundFlag: true);
			}

			[HarmonyPatch(typeof(StartOfRound), "EndOfGameClientRpc")]
			[HarmonyPrefix]
			public static void OnEndOfGameClientRpc()
			{
				ForceSaveGame("게임 종료 시퀀스 (클라이언트)", ignoreRoundFlag: true);
			}

			[HarmonyPatch(typeof(StartOfRound), "FirePlayersAfterDeadlineClientRpc")]
			[HarmonyPrefix]
			public static void OnFirePlayers()
			{
				ForceSaveGame("해고 시퀀스 시작", ignoreRoundFlag: true);
			}

			[HarmonyPatch(typeof(StartOfRound), "KickPlayer")]
			[HarmonyPrefix]
			public static void OnKickPlayer()
			{
				ForceSaveGame("플레이어 킥", ignoreRoundFlag: true);
			}

			[HarmonyPatch(typeof(StartOfRound), "OnLocalDisconnect")]
			[HarmonyPrefix]
			public static void OnLocalDisconnect()
			{
				ForceSaveGame("로컬 연결 끊김", ignoreRoundFlag: true);
			}
		}

		private static ManualLogSource logger;

		private static bool hasSavedThisRound;

		private static bool isInitialized;

		private static float lastSaveTime;

		private const float SAVE_COOLDOWN = 3f;

		public static void Initialize(Harmony harmony, ManualLogSource logSource)
		{
			logger = logSource;
			harmony.PatchAll(typeof(AntiAltF4Patch));
			harmony.PatchAll(typeof(DisconnectPatch));
			if (!isInitialized)
			{
				Application.wantsToQuit += OnWantsToQuit;
				Application.quitting += OnApplicationQuitting;
				isInitialized = true;
			}
			logger.LogInfo((object)"AntiAltF4Exploit 패치 적용! 강제 종료/로비 나가기로 폐품 지키기 꼼수 차단됨.");
		}

		private static bool OnWantsToQuit()
		{
			try
			{
				ForceSaveGame("게임 종료 시도 (Alt+F4 또는 창 닫기)", ignoreRoundFlag: true);
			}
			catch (Exception ex)
			{
				ManualLogSource val = logger;
				if (val != null)
				{
					val.LogError((object)("OnWantsToQuit 저장 에러: " + ex.Message));
				}
			}
			return true;
		}

		private static void OnApplicationQuitting()
		{
			try
			{
				ForceSaveGame("애플리케이션 종료", ignoreRoundFlag: true);
			}
			catch (Exception ex)
			{
				ManualLogSource val = logger;
				if (val != null)
				{
					val.LogError((object)("OnApplicationQuitting 저장 에러: " + ex.Message));
				}
			}
		}

		private static bool AreAllPlayersDead()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			StartOfRound instance = StartOfRound.Instance;
			if ((Object)instance == (Object)null)
			{
				return false;
			}
			PlayerControllerB[] allPlayerScripts = instance.allPlayerScripts;
			if (allPlayerScripts == null || allPlayerScripts.Length == 0)
			{
				return false;
			}
			PlayerControllerB[] array = allPlayerScripts;
			foreach (PlayerControllerB val in array)
			{
				if (!((Object)val == (Object)null) && (val.isPlayerControlled || val.isPlayerDead) && val.isPlayerControlled && !val.isPlayerDead)
				{
					return false;
				}
			}
			int num = allPlayerScripts.Count((PlayerControllerB p) => (Object)p != (Object)null && p.isPlayerControlled);
			int num2 = allPlayerScripts.Count((PlayerControllerB p) => (Object)p != (Object)null && p.isPlayerControlled && p.isPlayerDead);
			if (num > 0)
			{
				return num == num2;
			}
			return false;
		}

		private static void ForceSaveGame(string reason, bool ignoreRoundFlag = false)
		{
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Expected O, but got Unknown
			ManualLogSource val = logger;
			if (val != null)
			{
				val.LogInfo((object)("[AntiAltF4] 저장 시도: " + reason));
			}
			if (!ignoreRoundFlag && hasSavedThisRound)
			{
				ManualLogSource val2 = logger;
				if (val2 != null)
				{
					val2.LogInfo((object)"[AntiAltF4] 이미 이번 라운드에 저장함 - 스킵");
				}
				return;
			}
			float unscaledTime = Time.unscaledTime;
			if (unscaledTime - lastSaveTime < 3f)
			{
				ManualLogSource val3 = logger;
				if (val3 != null)
				{
					val3.LogInfo((object)("[AntiAltF4] 저장 스킵 (쿨다운): " + reason));
				}
				return;
			}
			try
			{
				GameNetworkManager instance = GameNetworkManager.Instance;
				if ((Object)instance == (Object)null)
				{
					ManualLogSource val4 = logger;
					if (val4 != null)
					{
						val4.LogWarning((object)"[AntiAltF4] GameNetworkManager가 null - 저장 실패");
					}
					return;
				}
				if (!instance.isHostingGame)
				{
					ManualLogSource val5 = logger;
					if (val5 != null)
					{
						val5.LogInfo((object)"[AntiAltF4] 호스트가 아님 - 저장 권한 없음");
					}
					return;
				}
				int saveFileNum = instance.saveFileNum;
				instance.SaveGame();
				lastSaveTime = unscaledTime;
				if (!ignoreRoundFlag)
				{
					hasSavedThisRound = true;
				}
				ManualLogSource val6 = logger;
				if (val6 != null)
				{
					val6.LogWarning((object)$"[AntiAltF4] 강제 저장 완료! 사유: {reason} (슬롯 {saveFileNum + 1})");
				}
			}
			catch (Exception ex)
			{
				ManualLogSource val7 = logger;
				if (val7 != null)
				{
					val7.LogError((object)("강제 저장 실패: " + ex.Message));
				}
			}
		}
	}
	public static class LLLSoftPatcher
	{
		public static void Patch()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			try
			{
				Type type = Type.GetType("LethalLevelLoader.AssetBundles.AssetBundleLoader, LethalLevelLoader");
				if (!(type == null))
				{
					Harmony val = new Harmony("com.lcmipatch.mine9289.lllsoftpatch");
					MethodInfo methodInfo = AccessTools.Method(type, "OnAssetBundleLoadChanged", (Type[])null, (Type[])null);
					if (methodInfo != null)
					{
						MethodInfo methodInfo2 = AccessTools.Method(typeof(LLLSoftPatcher), "OnBundleLoadedPostfix", (Type[])null, (Type[])null);
						val.Patch((MethodBase)methodInfo, (HarmonyMethod)null, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
					}
				}
			}
			catch
			{
			}
		}

		private static void OnBundleLoadedPostfix(object info)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Expected O, but got Unknown
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Expected O, but got Unknown
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Expected O, but got Unknown
			if (info == null || (Object)TextureReplacer.Instance == (Object)null)
			{
				return;
			}
			try
			{
				Type type = info.GetType();
				PropertyInfo property = type.GetProperty("IsAssetBundleLoaded", BindingFlags.Instance | BindingFlags.Public);
				if (property != null && !(bool)property.GetValue(info))
				{
					return;
				}
				PropertyInfo property2 = type.GetProperty("IsSceneBundle", BindingFlags.Instance | BindingFlags.Public);
				if (property2 != null && (bool)property2.GetValue(info))
				{
					return;
				}
				PropertyInfo property3 = type.GetProperty("AssetBundleName", BindingFlags.Instance | BindingFlags.Public);
				string bundleName = ((property3 != null) ? ((string)property3.GetValue(info)) : "Unknown");
				MethodInfo method = type.GetMethod("LoadAndOrGetBundle", BindingFlags.Instance | BindingFlags.Public);
				if (method == null)
				{
					return;
				}
				AssetBundle val = (AssetBundle)method.Invoke(info, null);
				if ((Object)val != (Object)null)
				{
					Texture2D[] array = val.LoadAllAssets<Texture2D>();
					if (array != null && array.Length != 0)
					{
						TextureReplacer.Instance.ProcessBundleTexturesDirectly(array, bundleName);
					}
				}
			}
			catch
			{
			}
		}
	}
	[BepInPlugin("com.lcmipatch.mine9289", "mine", "0.0.9")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		private Harmony harmony;

		private void Awake()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Expected O, but got Unknown
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Expected O, but got Unknown
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			TextureReplacer.logger = Logger.CreateLogSource("TextureReplacer");
			TextureReplacer.logger.LogInfo((object)"Made by ddada");
			GameObject val = new GameObject("이상 감지 시스템");
			Object.DontDestroyOnLoad((Object)val);
			((Object)val).hideFlags = (HideFlags)61;
			val.AddComponent<TextureReplacer>();
			harmony = new Harmony("kr.mine9289.KeepFurnitureEvenDead");
			harmony.PatchAll(typeof(KeepFurniturePatch));
			TextureReplacer.logger.LogInfo((object)"KeepFurnitureEvenDead v2.0 패치 적용! 해고당해도 구매한 가구 유지!");
			if (Chainloader.PluginInfos.ContainsKey("JacobG5.WesleyMoons"))
			{
				GameObject val2 = new GameObject("Wesley Moons Subtitle System");
				Object.DontDestroyOnLoad((Object)val2);
				((Object)val2).hideFlags = (HideFlags)61;
				val2.AddComponent<WesleyMoonsSubtitleMod>();
				TextureReplacer.logger.LogInfo((object)"Wesley's Moons 한글 자막 시스템 초기화 완료!");
			}
			WesleyMoonsFixPatch.Initialize(TextureReplacer.logger);
			OpenBodyCamsGuardPatch.Initialize(TextureReplacer.logger);
			GameTranslatorPatch.TryPatch();
			AntiAltF4Exploit.Initialize(harmony, TextureReplacer.logger);
		}
	}
	public class TextureReplacer : MonoBehaviour
	{
		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
		private class MEMORYSTATUSEX
		{
			public uint dwLength;

			public uint dwMemoryLoad;

			public ulong ullTotalPhys;

			public ulong ullAvailPhys;

			public ulong ullTotalPageFile;

			public ulong ullAvailPageFile;

			public ulong ullTotalVirtual;

			public ulong ullAvailVirtual;

			public ulong ullAvailExtendedVirtual;

			public MEMORYSTATUSEX()
			{
				dwLength = (uint)Marshal.SizeOf(typeof(MEMORYSTATUSEX));
			}
		}

		[CompilerGenerated]
		private sealed class <DelayedScan>d__53 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public float delay;

			public TextureReplacer <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <DelayedScan>d__53(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Expected O, but got Unknown
				int num = <>1__state;
				TextureReplacer textureReplacer = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					if (logger != null)
					{
						logger.LogInfo((object)$"[DelayedScan] {delay}초 후 스캔 시작 예정...");
					}
					<>2__current = (object)new WaitForSeconds(delay);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					if (logger != null)
					{
						logger.LogInfo((object)"[DelayedScan] 딜레이 완료, 스캔 시작");
					}
					textureReplacer.ResetScanState(showScreen: false, clearCache: false);
					textureReplacer.ProcessTextures();
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <DelayedTargetedScan>d__54 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public float delay;

			public TextureReplacer <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <DelayedTargetedScan>d__54(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Expected O, but got Unknown
				int num = <>1__state;
				TextureReplacer textureReplacer = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					if (logger != null)
					{
						logger.LogInfo((object)$"[DelayedTargetedScan] {delay}초 후 타겟팅 스캔 시작 예정...");
					}
					<>2__current = (object)new WaitForSeconds(delay);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					if (logger != null)
					{
						logger.LogInfo((object)"[DelayedTargetedScan] 딜레이 완료, 타겟팅 스캔 시작");
					}
					textureReplacer.PerformTargetedScan();
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public static TextureReplacer Instance;

		public static ManualLogSource logger;

		public static string imagesPath_str = "Mine";

		public static string imagesDumpPath_str = "AsDump";

		public static string assetBundleName = "mine_textures";

		public static string imagesPath = "";

		public static string imagesDumpPath = "";

		public static Dictionary<string, string> unique_keys = new Dictionary<string, string>();

		public static Dictionary<string, Texture2D> bundleTextures = new Dictionary<string, Texture2D>();

		public static bool useAssetBundle = false;

		public static AssetBundle loadedBundle = null;

		public static HashSet<int> checked_instanceID = new HashSet<int>();

		public static int? OldSceneId = null;

		public static int lastTextureCount = 0;

		public static bool bOnDumping = false;

		public static bool IsDoingDump = false;

		public static bool isInitialLoading = false;

		public static bool isScanning = false;

		public static bool isCustomBundleLoading = false;

		public static bool hasShownLoadingScreen = false;

		public static DateTime? dtStartToast = null;

		private static bool isLowMemoryDevice = false;

		private static long totalSystemMemoryMB = 0L;

		public static TimeSpan limitHeavy = TimeSpan.FromMilliseconds(100.0);

		public static TimeSpan limitDumping = TimeSpan.FromMilliseconds(100.0);

		private const long LOW_MEMORY_THRESHOLD_MB = 16000L;

		private const double LOW_MEMORY_LIMIT_MS = 30.0;

		private const double NORMAL_LIMIT_MS = 100.0;

		private const int LOW_MEMORY_BATCH_SIZE = 50;

		private const int NORMAL_BATCH_SIZE = 500;

		private const int GC_INTERVAL_BATCHES = 10;

		private static int batchCounter = 0;

		public static Texture2D[] Textures = null;

		public static int TextureIndex = -1;

		public static int TextureCount = -1;

		public static char[] invalid = Path.GetInvalidFileNameChars();

		public static string toast_txt = "";

		private Texture2D bgTexture;

		private Texture2D barBackTexture;

		private Texture2D barFillTexture;

		private Texture2D stripeTexture;

		private Texture2D boxBorderTex;

		private GUIStyle headerStyle;

		private GUIStyle subHeaderStyle;

		private GUIStyle logStyle;

		private GUIStyle progressStyle;

		private List<string> fakeLogs = new List<string>();

		private string[] logPhrases = new string[13]
		{
			"메모리 블록 초기화 중...", "보안 프로토콜 우회 시도...", "외부 텍스처 에셋 로드 중...", "그래픽 파이프라인 최적화...", "메인프레임 연결 시도...", "데이터 스트림 복호화...", "VRAM 할당 요청...", "호스트 동기화 완료...", "메타 데이터 파싱 중...", "무결성 검사 패스...",
			"한글 패치 리소스 주입 중...", "사용자 인터페이스 재구성...", "터미널 권한 획득 성공."
		};

		private float logTimer;

		private void Awake()
		{
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Expected O, but got Unknown
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			Instance = this;
			DetectLowMemoryDevice();
			string? directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			imagesPath = Path.Combine(directoryName, imagesPath_str);
			imagesDumpPath = Path.Combine(directoryName, imagesDumpPath_str);
			if (!Directory.Exists(imagesPath))
			{
				Directory.CreateDirectory(imagesPath);
			}
			if (!Directory.Exists(imagesDumpPath))
			{
				Directory.CreateDirectory(imagesDumpPath);
			}
			LoadImages();
			bgTexture = MakeTex(1, 1, new Color(0.02f, 0.02f, 0.02f, 1f));
			barBackTexture = MakeTex(1, 1, new Color(0.1f, 0.1f, 0.1f, 0.8f));
			barFillTexture = MakeTex(1, 1, new Color(1f, 0.4f, 0f, 0.9f));
			boxBorderTex = MakeTex(1, 1, new Color(0f, 0.5f, 0f, 0.3f));
			stripeTexture = new Texture2D(4, 4);
			Color val = default(Color);
			((Color)(ref val))..ctor(0f, 0f, 0f, 0f);
			Color val2 = default(Color);
			((Color)(ref val2))..ctor(0f, 0f, 0f, 0.3f);
			for (int i = 0; i < 4; i++)
			{
				for (int j = 0; j < 4; j++)
				{
					stripeTexture.SetPixel(j, i, ((j + i) % 4 == 0) ? val2 : val);
				}
			}
			stripeTexture.Apply();
			SceneManager.sceneLoaded += OnSceneLoaded;
			if (Chainloader.PluginInfos.ContainsKey("imabatby.lethallevelloader") || Chainloader.PluginInfos.ContainsKey("pacoito.LethalLevelLoaderUpdated"))
			{
				if (logger != null)
				{
					logger.LogInfo((object)"LethalLevelLoader 감지됨: 번들 후킹 활성화");
				}
				LLLSoftPatcher.Patch();
			}
		}

		private void OnDestroy()
		{
			SceneManager.sceneLoaded -= OnSceneLoaded;
		}

		private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
		{
			if (logger != null)
			{
				logger.LogInfo((object)$"[Event] 씬 로드 감지: {((Scene)(ref scene)).name} (ID: {((Scene)(ref scene)).buildIndex})");
			}
			OldSceneId = ((Scene)(ref scene)).buildIndex;
			if (((Scene)(ref scene)).name == "MainMenu")
			{
				if (!hasShownLoadingScreen)
				{
					if (logger != null)
					{
						logger.LogInfo((object)">> 메인메뉴 진입: 전체 스캔 및 로딩 스크린 활성화 (최초 1회)");
					}
					hasShownLoadingScreen = true;
					ResetScanState(showScreen: true, clearCache: false);
					ProcessTextures();
				}
				else
				{
					if (logger != null)
					{
						logger.LogInfo((object)">> 메인메뉴 재진입: 백그라운드 스캔만 수행");
					}
					ResetScanState(showScreen: false, clearCache: false);
					ProcessTextures();
				}
			}
			else if (((Scene)(ref scene)).name == "SampleSceneRelay")
			{
				if (logger != null)
				{
					logger.LogInfo((object)">> 함선 진입: 백그라운드 스캔 (기존 캐시 유지)");
				}
				ResetScanState(showScreen: false, clearCache: false);
				ProcessTextures();
			}
			else if (((Scene)(ref scene)).name != "InitScene" && ((Scene)(ref scene)).name != "InitSceneLaunchOptions")
			{
				if (isLowMemoryDevice)
				{
					long availableMemoryMB = GetAvailableMemoryMB();
					if (availableMemoryMB < 2000)
					{
						if (logger != null)
						{
							logger.LogWarning((object)$"[LowMemoryMode] 메모리 부족 ({availableMemoryMB}MB < 2GB): 타겟팅 스캔 모드 전환");
						}
						((MonoBehaviour)this).StartCoroutine(DelayedTargetedScan(1.5f));
						return;
					}
					if (logger != null)
					{
						logger.LogInfo((object)$"[LowMemoryMode] 사용 가능 메모리: {availableMemoryMB}MB - 일반 스캔 진행");
					}
				}
				if (logger != null)
				{
					logger.LogInfo((object)">> 위성/던전 진입: 1.5초 후 추가 리소스 백그라운드 스캔 (기존 캐시 유지)");
				}
				((MonoBehaviour)this).StartCoroutine(DelayedScan(1.5f));
			}
			else
			{
				isScanning = false;
				isInitialLoading = false;
				isCustomBundleLoading = false;
				Textures = null;
			}
		}

		[IteratorStateMachine(typeof(<DelayedScan>d__53))]
		private IEnumerator DelayedScan(float delay)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <DelayedScan>d__53(0)
			{
				<>4__this = this,
				delay = delay
			};
		}

		[IteratorStateMachine(typeof(<DelayedTargetedScan>d__54))]
		private IEnumerator DelayedTargetedScan(float delay)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <DelayedTargetedScan>d__54(0)
			{
				<>4__this = this,
				delay = delay
			};
		}

		private Texture2D MakeTex(int width, int height, Color col)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			Color[] array = (Color[])(object)new Color[width * height];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = col;
			}
			Texture2D val = new Texture2D(width, height);
			val.SetPixels(array);
			val.Apply();
			return val;
		}

		public void ProcessBundleTexturesDirectly(Texture2D[] bundleTextures, string bundleName)
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			if (bundleTextures == null || bundleTextures.Length == 0)
			{
				return;
			}
			if (logger != null)
			{
				logger.LogInfo((object)$"[LLL Hook] 번들 '{bundleName}' 내부 텍스처 {bundleTextures.Length}개 직접 처리 시작");
			}
			int num = 0;
			foreach (Texture2D val in bundleTextures)
			{
				if ((Object)val != (Object)null && ProcessTextureEntry(val))
				{
					num++;
				}
			}
			if (logger != null && num > 0)
			{
				logger.LogInfo((object)$"[LLL Hook] 번들 '{bundleName}' 에서 텍스처 {num}개 교체 완료");
			}
		}

		public void TriggerBundleScan(string bundleName)
		{
			if (!isInitialLoading)
			{
				isCustomBundleLoading = true;
				isScanning = true;
				Textures = null;
				TextureIndex = -1;
				if (logger != null)
				{
					logger.LogInfo((object)("[LLL Hook] 번들 로드 감지 (" + bundleName + ") -> 전체 스캔 대기열 추가"));
				}
			}
		}

		private void Update()
		{
			Keyboard current = Keyboard.current;
			if (current != null)
			{
				if (((ButtonControl)current.f9Key).wasPressedThisFrame && (((ButtonControl)current.leftCtrlKey).isPressed || ((ButtonControl)current.rightCtrlKey).isPressed))
				{
					bOnDumping = !bOnDumping;
					isScanning = bOnDumping;
					toast_txt = (bOnDumping ? "덤프 모드: 활성화됨" : "덤프 모드: 비활성화");
					dtStartToast = DateTime.Now;
					if (logger != null)
					{
						logger.LogInfo((object)$"[Input] 덤프 모드 전환: {bOnDumping}");
					}
					if (bOnDumping)
					{
						ResetScanState(showScreen: false, clearCache: true);
						Textures = null;
					}
				}
				else if (((ButtonControl)current.f8Key).wasPressedThisFrame && (((ButtonControl)current.leftCtrlKey).isPressed || ((ButtonControl)current.rightCtrlKey).isPressed))
				{
					if (logger != null)
					{
						logger.LogInfo((object)"[Input] Ctrl+F8 리로드 키 입력 감지됨");
					}
					LoadImages();
					int num = (useAssetBundle ? bundleTextures.Count : unique_keys.Count);
					toast_txt = $"시스템 재시동: {num} 에셋";
					dtStartToast = DateTime.Now;
					ResetScanState(showScreen: true, clearCache: true);
					fakeLogs.Clear();
					fakeLogs.Add("> 시스템 재부팅 요청 승인됨...");
				}
			}
			if (isInitialLoading && !bOnDumping)
			{
				logTimer += Time.unscaledDeltaTime;
				if (logTimer > 0.15f)
				{
					logTimer = 0f;
					fakeLogs.Add("> " + logPhrases[Random.Range(0, logPhrases.Length)]);
					if (fakeLogs.Count > 14)
					{
						fakeLogs.RemoveAt(0);
					}
				}
			}
			if (isScanning || bOnDumping || isCustomBundleLoading)
			{
				ProcessTextures();
			}
		}

		private void ResetScanState(bool showScreen, bool clearCache)
		{
			lastTextureCount = 0;
			if (clearCache)
			{
				checked_instanceID.Clear();
				if (logger != null)
				{
					logger.LogInfo((object)"[State] 캐시(InstanceID) 초기화됨");
				}
			}
			else if (logger != null)
			{
				logger.LogInfo((object)"[State] 캐시 유지됨 (중복 스캔 방지)");
			}
			Textures = null;
			TextureIndex = -1;
			isInitialLoading = showScreen;
			isScanning = true;
			isCustomBundleLoading = false;
			if (isInitialLoading)
			{
				fakeLogs.Clear();
				fakeLogs.Add("> 텍스처 인터페이스 초기화 중...");
			}
		}

		private void PerformTargetedScan()
		{
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Expected O, but got Unknown
			//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c1: Expected O, but got Unknown
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Expected O, but got Unknown
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Expected O, but got Unknown
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Expected O, but got Unknown
			Texture2D[] array2;
			if (useAssetBundle)
			{
				if (bundleTextures.Count == 0)
				{
					if (logger != null)
					{
						logger.LogInfo((object)"[TargetedScan] AssetBundle 텍스처 없음 - 스킵");
					}
					return;
				}
				if (logger != null)
				{
					logger.LogInfo((object)$"[TargetedScan] (AssetBundle) {bundleTextures.Count}개 텍스처 이름으로 타겟팅 검색 시작");
				}
				int num = 0;
				int num2 = 0;
				Texture2D[] array = Resources.FindObjectsOfTypeAll<Texture2D>();
				Dictionary<string, List<Texture2D>> dictionary = new Dictionary<string, List<Texture2D>>();
				array2 = array;
				foreach (Texture2D val in array2)
				{
					if ((Object)val == (Object)null || (Object)(object)val == (Object)null)
					{
						continue;
					}
					string text = toValidFilename(((Object)val).name);
					if (!string.IsNullOrEmpty(text) && bundleTextures.ContainsKey(text))
					{
						if (!dictionary.ContainsKey(text))
						{
							dictionary[text] = new List<Texture2D>();
						}
						dictionary[text].Add(val);
					}
				}
				GC.Collect(0, GCCollectionMode.Optimized, blocking: false);
				if (logger != null)
				{
					logger.LogInfo((object)$"[TargetedScan] 매칭된 텍스처 그룹: {dictionary.Count}개");
				}
				foreach (KeyValuePair<string, List<Texture2D>> item in dictionary)
				{
					string key = item.Key;
					if (!bundleTextures.TryGetValue(key, out var value) || (Object)value == (Object)null)
					{
						continue;
					}
					foreach (Texture2D item2 in item.Value)
					{
						num2++;
						if ((Object)item2 == (Object)null || (Object)(object)item2 == (Object)null)
						{
							continue;
						}
						int instanceID = ((Object)item2).GetInstanceID();
						if (!checked_instanceID.Contains(instanceID))
						{
							checked_instanceID.Add(instanceID);
							try
							{
								ReplaceTextureFromBundle(item2, value);
								num++;
							}
							catch
							{
							}
						}
					}
					if (num2 % 50 == 0)
					{
						GC.Collect(0, GCCollectionMode.Optimized, blocking: false);
					}
				}
				if (logger != null)
				{
					logger.LogInfo((object)$"[TargetedScan] 완료: {num}개 텍스처 교체됨 (검사: {num2}개)");
				}
				dictionary.Clear();
				GC.Collect();
				return;
			}
			if (unique_keys.Count == 0)
			{
				if (logger != null)
				{
					logger.LogInfo((object)"[TargetedScan] Mine/ 폴더에 교체 텍스처 없음 - 스킵");
				}
				return;
			}
			if (logger != null)
			{
				logger.LogInfo((object)$"[TargetedScan] {unique_keys.Count}개 텍스처 이름으로 타겟팅 검색 시작");
			}
			int num3 = 0;
			int num4 = 0;
			Texture2D[] array3 = Resources.FindObjectsOfTypeAll<Texture2D>();
			Dictionary<string, List<Texture2D>> dictionary2 = new Dictionary<string, List<Texture2D>>();
			array2 = array3;
			foreach (Texture2D val2 in array2)
			{
				if ((Object)val2 == (Object)null || (Object)(object)val2 == (Object)null)
				{
					continue;
				}
				string text2 = toValidFilename(((Object)val2).name);
				if (!string.IsNullOrEmpty(text2) && unique_keys.ContainsKey(text2))
				{
					if (!dictionary2.ContainsKey(text2))
					{
						dictionary2[text2] = new List<Texture2D>();
					}
					dictionary2[text2].Add(val2);
				}
			}
			GC.Collect(0, GCCollectionMode.Optimized, blocking: false);
			if (logger != null)
			{
				logger.LogInfo((object)$"[TargetedScan] 매칭된 텍스처 그룹: {dictionary2.Count}개");
			}
			foreach (KeyValuePair<string, List<Texture2D>> item3 in dictionary2)
			{
				string key2 = item3.Key;
				if (!unique_keys.TryGetValue(key2, out var value2))
				{
					continue;
				}
				byte[] array4 = null;
				try
				{
					array4 = File.ReadAllBytes(value2);
				}
				catch
				{
					continue;
				}
				foreach (Texture2D item4 in item3.Value)
				{
					num4++;
					if ((Object)item4 == (Object)null || (Object)(object)item4 == (Object)null)
					{
						continue;
					}
					int instanceID2 = ((Object)item4).GetInstanceID();
					if (!checked_instanceID.Contains(instanceID2))
					{
						checked_instanceID.Add(instanceID2);
						try
						{
							ImageConversion.LoadImage(item4, array4);
							num3++;
						}
						catch
						{
						}
					}
				}
				if (num4 % 50 == 0)
				{
					GC.Collect(0, GCCollectionMode.Optimized, blocking: false);
				}
			}
			if (logger != null)
			{
				logger.LogInfo((object)$"[TargetedScan] 완료: {num3}개 텍스처 교체됨 (검사: {num4}개)");
			}
			dictionary2.Clear();
			GC.Collect();
		}

		private void ProcessTextures()
		{
			if (Textures == null || Textures.Length == 0 || TextureIndex >= TextureCount)
			{
				Textures = Resources.FindObjectsOfTypeAll<Texture2D>();
				TextureCount = Textures.Length;
				TextureIndex = -1;
				if (logger != null && (isScanning || bOnDumping))
				{
					logger.LogInfo((object)$"[Scan] 메모리 내 텍스처 {TextureCount}개 검색됨. 처리 시작.");
				}
			}
			DateTime now = DateTime.Now;
			TimeSpan limit = (bOnDumping ? limitDumping : limitHeavy);
			if (bOnDumping)
			{
				DumpProcess(now, limit);
			}
			else
			{
				ReplaceProcess(now, limit);
			}
		}

		private void ReplaceProcess(DateTime startTime, TimeSpan limit)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			int num = (isLowMemoryDevice ? 50 : 500);
			int num2 = 0;
			while (TextureIndex < TextureCount - 1 && num2 < num && !(DateTime.Now - startTime > limit))
			{
				TextureIndex++;
				num2++;
				try
				{
					Texture2D val = Textures[TextureIndex];
					if ((Object)val != (Object)null && (Object)(object)val != (Object)null)
					{
						ProcessTextureEntry(val);
					}
				}
				catch (Exception ex)
				{
					if (logger != null && TextureIndex % 500 == 0)
					{
						logger.LogWarning((object)("[Scan] 텍스처 처리 중 오류 (무시됨): " + ex.Message));
					}
				}
			}
			if (isLowMemoryDevice)
			{
				batchCounter++;
				if (batchCounter >= 10)
				{
					batchCounter = 0;
					GC.Collect(0, GCCollectionMode.Optimized, blocking: false);
					if (logger != null && TextureIndex % 500 == 0)
					{
						logger.LogInfo((object)$"[Scan] 진행중: {TextureIndex}/{TextureCount} ({TextureIndex * 100 / TextureCount}%)");
					}
				}
			}
			if (TextureIndex >= TextureCount - 1)
			{
				if (logger != null)
				{
					logger.LogInfo((object)"[Scan] 스캔 프로세스 완료.");
				}
				isInitialLoading = false;
				isCustomBundleLoading = false;
				isScanning = false;
				Textures = null;
				TextureIndex = -1;
				batchCounter = 0;
				if (isLowMemoryDevice)
				{
					GC.Collect();
					GC.WaitForPendingFinalizers();
				}
			}
		}

		private bool ProcessTextureEntry(Texture2D tex)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			if ((Object)tex == (Object)null || (Object)(object)tex == (Object)null)
			{
				return false;
			}
			if (((Texture)tex).width < 16 || ((Texture)tex).height < 16)
			{
				return false;
			}
			int instanceID = ((Object)tex).GetInstanceID();
			if (checked_instanceID.Contains(instanceID))
			{
				return false;
			}
			checked_instanceID.Add(instanceID);
			string text = toValidFilename(((Object)tex).name);
			if (string.IsNullOrEmpty(text))
			{
				return false;
			}
			if (useAssetBundle && bundleTextures.TryGetValue(text, out var value))
			{
				ReplaceTextureFromBundle(tex, value);
				return true;
			}
			if (unique_keys.TryGetValue(text, out var value2))
			{
				ReplaceTextureFromFile(tex, value2);
				return true;
			}
			return false;
		}

		private Texture2D ForceResizeTexture(Texture2D source, int newWidth, int newHeight)
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected O, but got Unknown
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Expected O, but got Unknown
			RenderTexture val = null;
			RenderTexture active = RenderTexture.active;
			try
			{
				val = (RenderTexture.active = RenderTexture.GetTemporary(newWidth, newHeight, 0, (RenderTextureFormat)0, (RenderTextureReadWrite)0));
				GL.Clear(true, true, Color.clear);
				Graphics.Blit((Texture)source, val);
				Texture2D val2 = new Texture2D(newWidth, newHeight, (TextureFormat)4, false);
				val2.ReadPixels(new Rect(0f, 0f, (float)newWidth, (float)newHeight), 0, 0);
				val2.Apply();
				return val2;
			}
			finally
			{
				RenderTexture.active = active;
				if ((Object)val != (Object)null)
				{
					RenderTexture.ReleaseTemporary(val);
				}
			}
		}

		private void ReplaceTextureFromBundle(Texture2D target, Texture2D source)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Expected O, but got Unknown
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Expected O, but got Unknown
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Expected O, but got Unknown
			//IL_00aa: Expected O, but got Unknown
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Expected O, but got Unknown
			//IL_00bd: Expected O, but got Unknown
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Expected O, but got Unknown
			//IL_0075: Expected O, but got Unknown
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Expected O, but got Unknown
			//IL_0101: Expected O, but got Unknown
			if ((Object)target == (Object)null || (Object)source == (Object)null || ((Object)target).GetInstanceID() == ((Object)source).GetInstanceID())
			{
				return;
			}
			try
			{
				if (((Texture)target).width == ((Texture)source).width && ((Texture)target).height == ((Texture)source).height && target.format == source.format && ((Texture)target).mipmapCount == ((Texture)source).mipmapCount)
				{
					Graphics.CopyTexture((Texture)source, (Texture)target);
					return;
				}
				if (((Texture)target).width == ((Texture)source).width && ((Texture)target).height == ((Texture)source).height)
				{
					if (CanUseConvertTexture((Texture)source, (Texture)target) && Graphics.ConvertTexture((Texture)source, (Texture)target))
					{
						return;
					}
					if (target.format == source.format)
					{
						int num = Math.Min(((Texture)target).mipmapCount, ((Texture)source).mipmapCount);
						if (num > 0)
						{
							for (int i = 0; i < num; i++)
							{
								Graphics.CopyTexture((Texture)source, 0, i, (Texture)target, 0, i);
							}
							return;
						}
					}
				}
				Texture2D val = CreateResizedTexture(source, ((Texture)target).width, ((Texture)target).height);
				if (!((Object)val != (Object)null))
				{
					return;
				}
				try
				{
					byte[] array = ImageConversion.EncodeToPNG(val);
					if (array != null && array.Length != 0)
					{
						ImageConversion.LoadImage(target, array);
					}
				}
				finally
				{
					Object.DestroyImmediate((Object)val);
				}
			}
			catch
			{
			}
		}

		private static bool CanUseConvertTexture(Texture source, Texture destination)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				GraphicsFormat graphicsFormat = source.graphicsFormat;
				GraphicsFormat graphicsFormat2 = destination.graphicsFormat;
				if ((int)graphicsFormat == 0 || (int)graphicsFormat2 == 0)
				{
					return false;
				}
				if (!SystemInfo.IsFormatSupported(graphicsFormat, (FormatUsage)0))
				{
					return false;
				}
				if (!SystemInfo.IsFormatSupported(graphicsFormat2, (FormatUsage)4))
				{
					return false;
				}
				return true;
			}
			catch
			{
				return false;
			}
		}

		private Texture2D CreateResizedTexture(Texture2D source, int newWidth, int newHeight)
		{
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Expected O, but got Unknown
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Expected O, but got Unknown
			RenderTexture val = null;
			RenderTexture active = RenderTexture.active;
			try
			{
				val = RenderTexture.GetTemporary(newWidth, newHeight, 0, (RenderTextureFormat)0);
				Graphics.Blit((Texture)source, val);
				RenderTexture.active = val;
				Texture2D val2 = new Texture2D(newWidth, newHeight, (TextureFormat)4, true);
				val2.ReadPixels(new Rect(0f, 0f, (float)newWidth, (float)newHeight), 0, 0);
				val2.Apply();
				return val2;
			}
			catch
			{
				return null;
			}
			finally
			{
				RenderTexture.active = active;
				if ((Object)val != (Object)null)
				{
					RenderTexture.ReleaseTemporary(val);
				}
			}
		}

		private void ReplaceMaterialTextures(Texture2D oldTex, Texture2D newTex)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Expected O, but got Unknown
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Expected O, but got Unknown
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)oldTex == (Object)null || (Object)newTex == (Object)null)
			{
				return;
			}
			int instanceID = ((Object)oldTex).GetInstanceID();
			Renderer[] array = Resources.FindObjectsOfTypeAll<Renderer>();
			foreach (Renderer val in array)
			{
				if ((Object)val == (Object)null)
				{
					continue;
				}
				try
				{
					Material[] sharedMaterials = val.sharedMaterials;
					if (sharedMaterials == null)
					{
						continue;
					}
					Material[] array2 = sharedMaterials;
					foreach (Material val2 in array2)
					{
						if (!((Object)val2 == (Object)null))
						{
							ReplaceMaterialTextureProperties(val2, instanceID, newTex);
						}
					}
				}
				catch
				{
				}
			}
			Image[] array3 = Resources.FindObjectsOfTypeAll<Image>();
			foreach (Image val3 in array3)
			{
				if ((Object)val3 == (Object)null || (Object)val3.sprite == (Object)null)
				{
					continue;
				}
				try
				{
					if ((Object)val3.sprite.texture != (Object)null && ((Object)val3.sprite.texture).GetInstanceID() == instanceID)
					{
						Sprite sprite = Sprite.Create(newTex, val3.sprite.rect, val3.sprite.pivot, val3.sprite.pixelsPerUnit);
						val3.sprite = sprite;
					}
				}
				catch
				{
				}
			}
		}

		private void ReplaceMaterialTextureProperties(Material mat, int oldId, Texture2D newTex)
		{
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Expected O, but got Unknown
			string[] array = new string[7] { "_MainTex", "_BaseMap", "_BumpMap", "_EmissionMap", "_DetailAlbedoMap", "_MetallicGlossMap", "_OcclusionMap" };
			foreach (string text in array)
			{
				try
				{
					if (mat.HasProperty(text))
					{
						Texture texture = mat.GetTexture(text);
						if ((Object)texture != (Object)null && ((Object)texture).GetInstanceID() == oldId)
						{
							mat.SetTexture(text, (Texture)newTex);
						}
					}
				}
				catch
				{
				}
			}
		}

		private void ReplaceTextureFromFile(Texture2D tex, string path)
		{
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Expected O, but got Unknown
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Expected O, but got Unknown
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Expected O, but got Unknown
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Expected O, but got Unknown
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Expected O, but got Unknown
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Expected O, but got Unknown
			if (!File.Exists(path))
			{
				return;
			}
			try
			{
				byte[] array = File.ReadAllBytes(path);
				if (!((Texture)tex).isReadable)
				{
					ImageConversion.LoadImage(tex, array);
					return;
				}
				bool flag = ShouldPreserveAlpha(((Object)tex).name, path);
				Texture2D val = null;
				Color32[] array2 = null;
				if (flag)
				{
					try
					{
						val = duplicateTexture(tex);
					}
					catch
					{
						flag = false;
					}
				}
				if (ImageConversion.LoadImage(tex, array))
				{
					if (((Texture)tex).width % 4 != 0 || ((Texture)tex).height % 4 != 0)
					{
						int num = (((Texture)tex).width + 3) / 4 * 4;
						int num2 = (((Texture)tex).height + 3) / 4 * 4;
						if (logger != null)
						{
							logger.LogWarning((object)$"[AutoFix] 텍스처 규격 보정: {Path.GetFileName(path)} ({((Texture)tex).width}x{((Texture)tex).height} -> {num}x{num2})");
						}
						Texture2D val2 = ForceResizeTexture(tex, num, num2);
						tex.Reinitialize(num, num2, (TextureFormat)4, false);
						tex.SetPixels32(val2.GetPixels32());
						tex.Apply();
						Object.DestroyImmediate((Object)val2);
						if (flag && (Object)val != (Object)null)
						{
							try
							{
								Texture2D obj2 = ForceResizeTexture(val, num, num2);
								array2 = obj2.GetPixels32();
								Object.DestroyImmediate((Object)obj2);
							}
							catch
							{
								flag = false;
							}
						}
					}
					else if (flag && (Object)val != (Object)null)
					{
						array2 = val.GetPixels32();
					}
				}
				if (flag && array2 != null)
				{
					try
					{
						if (((Texture)tex).width == ((Texture)val).width || (((Texture)tex).width % 4 == 0 && ((Texture)tex).width - ((Texture)val).width < 4))
						{
							Color32[] pixels = tex.GetPixels32();
							int num3 = Mathf.Min(pixels.Length, array2.Length);
							for (int i = 0; i < num3; i++)
							{
								pixels[i].a = array2[i].a;
							}
							tex.SetPixels32(pixels);
							tex.Apply();
						}
					}
					catch
					{
					}
				}
				if ((Object)val != (Object)null)
				{
					Object.DestroyImmediate((Object)val);
				}
			}
			catch (Exception ex)
			{
				if (logger != null)
				{
					logger.LogWarning((object)("[ReplaceTexture] 텍스처 교체 실패 (무시됨): " + (((Object)(object)tex != (Object)null) ? ((Object)tex).name : null) + " - " + ex.Message));
				}
			}
		}

		private void DumpProcess(DateTime startTime, TimeSpan limit)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Expected O, but got Unknown
			if (lastTextureCount != TextureCount)
			{
				lastTextureCount = TextureCount;
				IsDoingDump = true;
			}
			if (!IsDoingDump)
			{
				return;
			}
			while (TextureIndex < TextureCount - 1 && DateTime.Now - startTime < limit)
			{
				TextureIndex++;
				try
				{
					Texture2D val = Textures[TextureIndex];
					if ((Object)val != (Object)null && ((Texture)val).width > 16 && ((Texture)val).height > 16)
					{
						string text = toValidFilename(((Object)val).name);
						if (TextureIndex % 50 == 0)
						{
							int num = ((TextureCount > 0) ? (TextureIndex * 100 / TextureCount) : 0);
							toast_txt = $"스캔 중... {num}%";
							dtStartToast = DateTime.Now;
						}
						if (DumpFile(val, text))
						{
							int num2 = ((TextureCount > 0) ? (TextureIndex * 100 / TextureCount) : 0);
							toast_txt = $"덤프 완료: {text} [{num2}%]";
							dtStartToast = DateTime.Now;
						}
					}
				}
				catch
				{
				}
			}
			if (TextureIndex >= TextureCount - 1)
			{
				toast_txt = "덤프 완료";
				dtStartToast = DateTime.Now;
				bOnDumping = false;
				IsDoingDump = false;
				isScanning = false;
				TextureIndex = -1;
				Textures = null;
			}
		}

		public static Texture2D duplicateTexture(Texture2D source)
		{
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Expected O, but got Unknown
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Expected O, but got Unknown
			RenderTexture active = RenderTexture.active;
			RenderTexture val = null;
			try
			{
				val = RenderTexture.GetTemporary(((Texture)source).width, ((Texture)source).height, 0, (RenderTextureFormat)0, (RenderTextureReadWrite)0);
				Graphics.Blit((Texture)source, val);
				RenderTexture.active = val;
				Texture2D val2 = new Texture2D(((Texture)source).width, ((Texture)source).height, (TextureFormat)4, true);
				val2.ReadPixels(new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), 0, 0);
				val2.Apply();
				return val2;
			}
			finally
			{
				RenderTexture.active = active;
				if ((Object)val != (Object)null)
				{
					RenderTexture.ReleaseTemporary(val);
				}
			}
		}

		private static string MakeCheckSum(Texture2D source)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Expected O, but got Unknown
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Expected O, but got Unknown
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Expected O, but got Unknown
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)source == (Object)null)
			{
				return "null";
			}
			RenderTexture active = RenderTexture.active;
			RenderTexture val = null;
			Texture2D val2 = null;
			try
			{
				val = RenderTexture.GetTemporary(64, 64, 0, (RenderTextureFormat)0);
				Graphics.Blit((Texture)source, val);
				RenderTexture.active = val;
				val2 = new Texture2D(64, 64, (TextureFormat)4, false);
				val2.ReadPixels(new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), 0, 0);
				val2.Apply();
				byte[] rawTextureData = val2.GetRawTextureData();
				using MD5 mD = MD5.Create();
				return BitConverter.ToString(mD.ComputeHash(rawTextureData)).Replace("-", "").ToLower();
			}
			finally
			{
				if ((Object)val2 != (Object)null)
				{
					Object.DestroyImmediate((Object)val2);
				}
				RenderTexture.active = active;
				if ((Object)val != (Object)null)
				{
					RenderTexture.ReleaseTemporary(val);
				}
			}
		}

		private bool DumpFile(Texture2D tex, string tex_name)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Expected O, but got Unknown
			try
			{
				string path = imagesDumpPath;
				Scene activeScene = SceneManager.GetActiveScene();
				string text = Path.Combine(path, ((Scene)(ref activeScene)).buildIndex.ToString());
				if (!Directory.Exists(text))
				{
					Directory.CreateDirectory(text);
				}
				string text2 = MakeCheckSum(tex);
				string path2 = Path.Combine(text, tex_name + "_" + text2 + ".png");
				if (!File.Exists(path2))
				{
					Texture2D obj = duplicateTexture(tex);
					byte[] array = ImageConversion.EncodeToPNG(obj);
					Object.DestroyImmediate((Object)obj);
					if (array != null)
					{
						File.WriteAllBytes(p