{"id":54,"date":"2025-03-29T01:45:48","date_gmt":"2025-03-29T00:45:48","guid":{"rendered":"https:\/\/szczepan.gawkowski.com.pl\/?p=54"},"modified":"2025-07-12T14:53:31","modified_gmt":"2025-07-12T13:53:31","slug":"bug-in-tomb-raider-iii","status":"publish","type":"post","link":"https:\/\/szczepan.gawkowski.com.pl\/index.php\/2025\/03\/29\/bug-in-tomb-raider-iii\/","title":{"rendered":"Bug in Tomb Raider III?"},"content":{"rendered":"\n<figure class=\"wp-block-pullquote has-accent-5-background-color has-background has-medium-font-size\"><blockquote><p>But I tell you, if you do not repent, you will all perish as they did!<\/p><cite>Luke 13:3<\/cite><\/blockquote><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">For Tomb Raider III players \ud83d\ude80<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you came here by accident because you can&#8217;t play Tomb Raider III and get the error message &#8220;Tomb Raider III CD ?&#8221; even if your CD is in the drive, try using this <a href=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/TR3NoCDPatcher.exe\">patch<\/a>. In addition, after applying this patch, you can play the game without any CD by copying the files from the disc to the game folder without overwriting existing ones.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">For geeks \ud83d\udc68\u200d\ud83d\udcbb<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Inspired by the computer game industry, in which I have recently become involved, I decided to dust off one of the games I used to play and take a closer look at how it is made. My choice fell on Tomb Raider III. Unfortunately, after installing the game, when I tried to run it, I got the following error (with the disc in the drive): &#8220;Tomb Raider III CD?&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"344\" height=\"199\" src=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image.png\" alt=\"\" class=\"wp-image-56\" srcset=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image.png 344w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-300x174.png 300w\" sizes=\"auto, (max-width: 344px) 100vw, 344px\" \/><figcaption class=\"wp-element-caption\">Hold on! My CD is in the drive!<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This was interesting because I was almost certain that in the days of Windows 98 SE or Windows ME, TR3 worked correctly\u2026 Well, why not look inside and try debugging this problem? In addition, I hadn&#8217;t re-engineered anything for ages (is <strong>SoftICE <\/strong>still trendy?), so let&#8217;s have fun.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I opened <strong>Ghidra<\/strong>, created a new project containing<strong> tomb3.exe<\/strong> and ran the <strong>CodeBrowser<\/strong>. My developer&#8217;s intuition suggested that we shouldn&#8217;t expect any complex logic behind CD checking. I expected the following behaviour.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>if (!isCdInside())\n{\n  ShowError();\n  return;\n}<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #81A1C1\">!<\/span><span style=\"color: #88C0D0\">isCdInside<\/span><span style=\"color: #ECEFF4\">())<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #88C0D0\">ShowError<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #81A1C1\">return;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Thus, I navigated to <strong>Search -&gt; For String<\/strong>\u2026, accepted default settings, and found exactly what I wanted.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a689e80cdbcc&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a689e80cdbcc\" class=\"wp-block-image size-full is-style-default wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1093\" height=\"728\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-2.png\" alt=\"\" class=\"wp-image-59\" srcset=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-2.png 1093w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-2-300x200.png 300w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-2-1024x682.png 1024w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-2-768x512.png 768w\" sizes=\"auto, (max-width: 1093px) 100vw, 1093px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">&#8220;Tomb Raider III CD ?&#8221; string<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"> Double-clicking on the string moved me to the resource using our message. <strong>Ghidra <\/strong>said that this resource was used only in two places\u2026<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a689e80ce0df&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a689e80ce0df\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1015\" height=\"655\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-3.png\" alt=\"\" class=\"wp-image-61\" srcset=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-3.png 1015w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-3-300x194.png 300w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-3-768x496.png 768w\" sizes=\"auto, (max-width: 1015px) 100vw, 1015px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"> I decided to jump to the first one (<code>0048d153<\/code>). There was a loop\u2026 Was it a loop responsible for showing our error as long as a user chose the &#8220;OK&#8221; button? Could be, could be\u2026 <\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a689e80ce4dc&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a689e80ce4dc\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"425\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-4-1024x425.png\" alt=\"\" class=\"wp-image-63\" srcset=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-4-1024x425.png 1024w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-4-300x125.png 300w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-4-768x319.png 768w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-4-1536x638.png 1536w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-4.png 1548w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"> Since I could see no usage of WinAPI functions, I decided to go to the function at <code>00482440<\/code>. Bingo! It looked like a function that iterates over all available drives and checks file existence.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a689e80ce8b0&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a689e80ce8b0\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"464\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-8-1024x464.png\" alt=\"\" class=\"wp-image-70\" srcset=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-8-1024x464.png 1024w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-8-300x136.png 300w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-8-768x348.png 768w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-8.png 1433w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\"><code>00482440<\/code> function<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Indeed, the TR3 CD contains <code>tombpc.dat<\/code> in the <code>Data<\/code> folder. By the way, note that the <code>00482440<\/code> function uses <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/fileio\/naming-a-file#fully-qualified-vs-relative-paths\">relative paths<\/a> (<code>\"D:data\\\\tombpc.dat\"<\/code>)that begin with only a disk designator, but not the backslash after the colon. Secondly, although <strong>GetDriveTypeA()<\/strong> is called and its result is compared to 5, that fact isn&#8217;t used at all\u2026<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a689e80cec89&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a689e80cec89\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"658\" height=\"465\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-6.png\" alt=\"\" class=\"wp-image-67\" srcset=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-6.png 658w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-6-300x212.png 300w\" sizes=\"auto, (max-width: 658px) 100vw, 658px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Do we use the result of this comparison somewhere?<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">According to the <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/api\/fileapi\/nf-fileapi-getdrivetypea\">documentation<\/a>, 5 means CD:<br><\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a689e80cf05d&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a689e80cf05d\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"855\" height=\"459\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-7.png\" alt=\"\" class=\"wp-image-68\" srcset=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-7.png 855w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-7-300x161.png 300w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-7-768x412.png 768w\" sizes=\"auto, (max-width: 855px) 100vw, 855px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We will utilise these two observations later to run TR3 without any CD :)\ud83d\udcaa<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After I had analysed the <code>00482440<\/code> function, it became clear to me what the problem was. Namely, we were starting the iterations from drive C instead of A for some reason.<br><\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a689e80cf42f&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a689e80cf42f\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"396\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-9-1024x396.png\" alt=\"\" class=\"wp-image-72\" srcset=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-9-1024x396.png 1024w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-9-300x116.png 300w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-9-768x297.png 768w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-9.png 1523w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Why do we start iteration from the C drive?<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">But <strong>Ghidra <\/strong>helped &#8211; I selected the suspicious line, right-clicked on it and chose <strong>Patch Instruction<\/strong>.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a689e80cf826&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a689e80cf826\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"802\" height=\"488\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-10.png\" alt=\"\" class=\"wp-image-73\" srcset=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-10.png 802w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-10-300x183.png 300w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-10-768x467.png 768w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Indeed, the following line allowed me to run Tomb Raider III without any issues \ud83e\udd79<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0\">ASM<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>MOV byte ptr &#91;DAT_00633f20&#93;,0x41<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">MOV<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">byte<\/span><span style=\"color: #D8DEE9FF\"> ptr &#91;DAT_00633f20&#93;,<\/span><span style=\"color: #B48EAD\">0x41<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Moreover, as we noted earlier, since the <code>00482440<\/code> function used relative paths and didn&#8217;t care about the drive type, it turned out that it was possible to start the game without a CD. Simply, it was enough to copy all files from the CD to the game folder without overwriting existing ones.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Unfortunately, there is one thing I still don&#8217;t understand: why did the game work correctly 20 years ago? Has Microsoft changed the implementation of the <code>GetLogicalDrives()<\/code> function? Am I missing something here?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For more fun, we could even create a patcher whose main function in C++ could look like this:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#39404f;color:#c8d0e0\">C++<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>bool tryToModifyFile(const string&amp; filename)\n{\n    fstream file(filename, ios::in | ios::out | ios::binary);\n\n    if (!file)\n    {\n        cout &lt;&lt; \"Error: cannot open file \" &lt;&lt; filename &lt;&lt; endl;\n        return false;\n    }\n    const streampos currentCdriveOffset = 0x81894 + 0x6;\n    \n    file.seekp(currentCdriveOffset);\n    if (!file)\n    {\n        cout &lt;&lt; \"Error: seek operation failed. Did you type the correct path?\" &lt;&lt; endl;\n        return false;\n    }\n\n    const char aDrive = 'A';\n    file.write(&amp;aDrive, 1);\n\n    if (!file)\n    {\n        cout &lt;&lt; \"Error: write operation failed.\" &lt;&lt; endl;\n        return false;\n    }\n\n    file.close();\n    return true;\n}<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">bool<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">tryToModifyFile<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> string<\/span><span style=\"color: #81A1C1\">&amp;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">filename<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    fstream <\/span><span style=\"color: #88C0D0\">file<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">filename<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> ios<\/span><span style=\"color: #ECEFF4\">::<\/span><span style=\"color: #D8DEE9FF\">in <\/span><span style=\"color: #81A1C1\">|<\/span><span style=\"color: #D8DEE9FF\"> ios<\/span><span style=\"color: #ECEFF4\">::<\/span><span style=\"color: #D8DEE9FF\">out <\/span><span style=\"color: #81A1C1\">|<\/span><span style=\"color: #D8DEE9FF\"> ios<\/span><span style=\"color: #ECEFF4\">::<\/span><span style=\"color: #D8DEE9FF\">binary<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #81A1C1\">!<\/span><span style=\"color: #D8DEE9FF\">file<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        cout <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">Error: cannot open file <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> filename <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> endl<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">return<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">false;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #ECEFF4\">}<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> streampos currentCdriveOffset <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">0x<\/span><span style=\"color: #B48EAD\">81894<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">+<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">0x<\/span><span style=\"color: #B48EAD\">6<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">file<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">seekp<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">currentCdriveOffset<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #81A1C1\">!<\/span><span style=\"color: #D8DEE9FF\">file<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        cout <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">Error: seek operation failed. Did you type the correct path?<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> endl<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">return<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">false;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #ECEFF4\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">const<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">char<\/span><span style=\"color: #D8DEE9FF\"> aDrive <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">A<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">file<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">write<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #81A1C1\">&amp;<\/span><span style=\"color: #D8DEE9FF\">aDrive<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #81A1C1\">!<\/span><span style=\"color: #D8DEE9FF\">file<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #ECEFF4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        cout <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">Error: write operation failed.<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">&lt;&lt;<\/span><span style=\"color: #D8DEE9FF\"> endl<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">return<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">false;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #ECEFF4\">}<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">file<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">close<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #81A1C1\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">return<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">true;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #ECEFF4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">As always, <strong>Ghidra <\/strong>is helpful to get the correct instruction offset.<br><\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a689e80cfd21&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a689e80cfd21\" class=\"wp-block-image size-full wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"450\" height=\"256\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-11.png\" alt=\"\" class=\"wp-image-77\" srcset=\"https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-11.png 450w, https:\/\/szczepan.gawkowski.com.pl\/wp-content\/uploads\/2025\/03\/image-11-300x171.png 300w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Cheers!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>But I tell you, if you do not repent, you will all perish as they did! Luke 13:3 For Tomb Raider III players \ud83d\ude80 If you came here by accident because you can&#8217;t play Tomb Raider III and get the error message &#8220;Tomb Raider III CD ?&#8221; even if your CD is in the drive, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[6,7],"class_list":["post-54","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-reverse-engineering","tag-tomb-raider-iii"],"_links":{"self":[{"href":"https:\/\/szczepan.gawkowski.com.pl\/index.php\/wp-json\/wp\/v2\/posts\/54","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/szczepan.gawkowski.com.pl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/szczepan.gawkowski.com.pl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/szczepan.gawkowski.com.pl\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/szczepan.gawkowski.com.pl\/index.php\/wp-json\/wp\/v2\/comments?post=54"}],"version-history":[{"count":18,"href":"https:\/\/szczepan.gawkowski.com.pl\/index.php\/wp-json\/wp\/v2\/posts\/54\/revisions"}],"predecessor-version":[{"id":189,"href":"https:\/\/szczepan.gawkowski.com.pl\/index.php\/wp-json\/wp\/v2\/posts\/54\/revisions\/189"}],"wp:attachment":[{"href":"https:\/\/szczepan.gawkowski.com.pl\/index.php\/wp-json\/wp\/v2\/media?parent=54"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/szczepan.gawkowski.com.pl\/index.php\/wp-json\/wp\/v2\/categories?post=54"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/szczepan.gawkowski.com.pl\/index.php\/wp-json\/wp\/v2\/tags?post=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}