<?xml version="1.0" encoding="utf-8"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>gemot encubed</title>
		<link>http://forums.novelnews.net/</link>
		<description>VisualNews Gemot: Discussion Forums for Visual Novels.</description>
		<language>en</language>
		<lastBuildDate>Sat, 25 May 2013 07:21:24 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://forums.novelnews.net/images/godsface/misc/rss.jpg</url>
			<title>gemot encubed</title>
			<link>http://forums.novelnews.net/</link>
		</image>
		<item>
			<title>Remember11 .BIP format</title>
			<link>http://forums.novelnews.net/showthread.php?t=36237&amp;goto=newpost</link>
			<pubDate>Fri, 24 May 2013 17:44:35 GMT</pubDate>
			<description>What program can hack .BIP format?</description>
			<content:encoded><![CDATA[<div>What program can hack .BIP format?</div>

]]></content:encoded>
			<category domain="http://forums.novelnews.net/forumdisplay.php?f=60"><![CDATA[Production & Help]]></category>
			<dc:creator>DiNeX</dc:creator>
			<guid isPermaLink="true">http://forums.novelnews.net/showthread.php?t=36237</guid>
		</item>
		<item>
			<title>New API hooking tool</title>
			<link>http://forums.novelnews.net/showthread.php?t=36236&amp;goto=newpost</link>
			<pubDate>Wed, 22 May 2013 05:07:32 GMT</pubDate>
			<description><![CDATA[Hi folks, 
 
Now that it's complete I don't know where to start, it's really huge. Anyway let's try a small example. There's an oldy RPG from 2000s...]]></description>
			<content:encoded><![CDATA[<div>Hi folks,<br />
<br />
Now that it's complete I don't know where to start, it's really huge. Anyway let's try a small example. There's an oldy RPG from 2000s called &quot;<a href="http://vndb.org/v3036" target="_blank">Avaton</a>&quot;; I'll use it as a test subject (it's about 120 MiB).<br />
<br />
My tool - <a href="http://proger.i-forge.net/ApiHook_-_Win32_API_hooking_tool/7wP" target="_blank">ApiHook</a> - allows you to execute custom scripts attached to any exported function of a DLL loaded into a process. In other words it's like a debugger where you set breakpoints with conditions but here you can run full-blown scripts instead of some simple conditions. You can dump call stack, dump memory segments, log stuff to console, etc.<br />
<br />
Among other things it's very useful in finding initial call points when you're dealing with a new engine. <br />
<br />
ApiHook has several strong points and one of them is that it can use both IAT table patching and prologue rewriting (the default) to attach its own handler to subject. IAT is fast but unreliable (e.g. it won't work for dynamic binding with LoadLibrary/GetProcAddress) and it only affects particular module (unless you patch every process module). Prologue patching is unavoidable - first instructions of target function body are overwritten to point to ApiHook's handler so you can't call the hooked function bypassing ApiHook itself. It's a technique used by rootkits and low-level apps like antiviruses.<br />
<br />
Let's say we want to see what files does Avaron access via CreateFileA. Here's what you need to do:<ol style="list-style-type: decimal"><li><a href="http://proger.i-forge.net/ApiHook_-_Win32_API_hooking_tool/7wP#download" target="_blank">Download ApiHook</a> and extract it anywhere</li>
<li>Create hook script - let's call it &quot;avaron.oo&quot; (you can use .txt too if you wish). It's a plain text file, we'll fill it below</li>
<li>Open command prompt at ah.exe (it doesn't matter but usually is more convenient - no typing of long paths)</li>
<li>Now type this command (but don't run it yet): <b>ah.exe launch &lt;avaron.exe&gt; avaron.oo</b> - or it can be shortened to <b>ah l &lt;avaron&gt; avaron</b> (l = launch, .exe and .oo/.txt are added automatically)</li>
</ol><br />
Now it's set up. We need to fill in the hook script (<a href="http://proger.i-forge.net/ApiHook_-_Win32_API_hooking_tool/7wP#script" target="_blank">docs</a>) - it specifies what ApiHook should hook and what to do once a trapped call happens. Script file has a basic INI-like format:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">[CreateFileA]<br />
log :fn</code><hr />
</div>That's it. Now as soon as CreateFileA is called we'll see a line like <b>CreateFileA: save0000.dat</b> in the console, log or both.<br />
<br />
Now you can run the command line above. (<font color="DarkRed">Note: you should have DEP disabled!</font>) The game title opens and... nothing happens. You will see something like this:<br />
<img src="http://i.imgur.com/rY1sJBB.png" border="0" alt="" /><br />
<br />
Now that's strange, isn't it? But let's try to Load a saved game (don't close ApiHook) - it's the top clickable menu item. You should immediately see new lines appearing in the console as the game lists empty slots:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">Your choice...<br />
21:44: CreateFileA: save0000.dat<br />
* CreateFileA: save0001.dat<br />
* CreateFileA: save0002.dat<br />
* CreateFileA: save0003.dat<br />
* CreateFileA: save0004.dat<br />
* CreateFileA: save0005.dat<br />
* CreateFileA: save0006.dat<br />
* CreateFileA: save0007.dat<br />
* CreateFileA: save0008.dat<br />
* CreateFileA: save0009.dat</code><hr />
</div>As we see ApiHook works and listens for CreateFileA calls. If so - why we didn't see them, the game at least had to read title image from somewhere?<br />
<br />
This is because most of the engine isn't contained in avaron.exe but rather in <b>uty32dll.dll</b> (see it in the game's folder?). By default ApiHook only triggers on calls originating from the process itself (the EXE) but not its modules (DLLs) - since it uses prologue rewriting even calls from system libraries like kernel32.dll will be intercepted and output and believe me that's a huge stream - you'll see it in a moment.<br />
<br />
So we need to hook <b>uty32dll.dll</b> instead of/in addition to avaron.exe. Close the game and ApiHook (you can type <b>t</b> in its console and press Enter) and change the command line so it looks like this: <b>ah l &lt;avaron&gt; avaron --module=uty</b>.<br />
<br />
<b>--module</b> can be <b>*</b> to hook everything including system DLLs or it can be full or part module name to which hooks should be attached. We could type <b>path\...\uty32dll.dll</b>, <b>uty32dll</b> or any other unique file name portion like <b>uty</b>, which we did.<br />
<br />
Now run it again and this time you will see much more activity:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">...<br />
* CreateFileA: win_up.bmp<br />
* CreateFileA: graphic.md<br />
* CreateFileA: gwaku_up.bmp<br />
* CreateFileA: graphic.md<br />
* CreateFileA: ewaku.bmp<br />
* CreateFileA: graphic.md<br />
* CreateFileA: swaku.bmp<br />
* CreateFileA: graphic.md<br />
* CreateFileA: t.bmp<br />
* CreateFileA: graphic.md<br />
* CreateFileA: t.bmp<br />
* CreateFileA: graphic.md</code><hr />
</div>Aha! <b>graphic.md</b> and others including some non-existent files like <b>t.bmp</b>. Great. Now if you try to Load a game you'll notice that there are no new lines in the console - unless you have used <b>--module=*</b>.<br />
<br />
This is very basic usage. You can do a lot more but I'll keep this first post short and if anyone is interested - feel free to drop a comment. ApiHook is yet in early beta stage so there are glitches.<br />
<br />
You can find a more appealing teaser script under the spoiler.<br />
<div>
    <div class="pre-spoiler">
    <span style="float:left; padding-top: 2px;">Spoiler</span> <input type="button" value="Show" style="width:80px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.value = 'Show';}">
    </div>
    <div>
        <div class="spoiler" style="display: none;"><br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">[CreateFileA]<br />
&nbsp; save fn<br />
. save &lt;H2FN ^ x fmt cat&gt; ^fn<br />
. if ^ 4294967295 NEQ<br />
. log {gi ^fn} (h = ^)<br />
<br />
[CreateFileA]<br />
. if ^ 4294967295 EQU<br />
. log {ri ^fn}<br />
<br />
[SetFilePointer]<br />
&nbsp; save h, pos<br />
&nbsp; save fn H2FN :h x fmt cat load<br />
. if ^ 4294967295 NEQ<br />
* if ^fn 'graphic.md' EQU<br />
. log ^fn -&gt; &lt;^pos X fmt&gt;<br />
<br />
[ReadFile]<br />
&nbsp; save fn H2FN :h x fmt cat load<br />
* if ^fn 'graphic.md' EQU<br />
&nbsp; log ^fn (:size B by :EIP:x)</code><hr />
</div>You will likely get a crash because of intensive calls to ReadFile so change the command line to this: <br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">ah l &lt;avaron.exe&gt; avaron.oo --module=uty --lib-logs=lib.log --detach=w</code><hr />
</div>When you run it there will be a delay before game shows title screen due to heavy use of these functions. After a few seconds you will see it though and the log will be about 350 KiB large. In particular, its last lines will be like:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">* [usr] CreateFileA: win_up.bmp<br />
* [usr] CreateFileA: graphic.md (h = 388)<br />
* [usr] SetFilePointer: graphic.md -&gt; 4E4A000<br />
* [usr] ReadFile: graphic.md (1380 B by 10004334)<br />
* [usr] CreateFileA: gwaku_up.bmp<br />
* [usr] CreateFileA: graphic.md (h = 400)<br />
* [usr] SetFilePointer: graphic.md -&gt; 23CC000<br />
* [usr] ReadFile: graphic.md (68848 B by 10004334)</code><hr />
</div>Better in color: <br />
<img src="http://i.imgur.com/iOj3R8Y.png" border="0" alt="" /><br />
<br />
Red entries mark non-existent files, green ones - successful calls to CreateFileA (see <a href="http://proger.i-forge.net/ColorConsole_Delphi_unit/7Sk#features" target="_blank">ColorConsole syntax</a> for <b>{ri ...}</b>). As we see the game first tries to use an uncompressed file outside of archive, then opens the archive (graphic.md (h = 388)), seeks to, say, 4E4A000 and then reads 1380 bytes - and that <b>by 10004334</b> is the caller's address that we can follow in OllyDbg or IDA (here it belongs to uty32dll.dll).<br />
<br />
Knowing the caller is great but if you check it you'll see it's exported function <b>GetMDDataAllocRead</b> that doesn't do anything except reading part of the archive. Isn't very helpful, right? <br />
<br />
No worries. We can find out the call chain by <a href="http://proger.i-forge.net/ApiHook_-_Win32_API_hooking_tool/7wP#a-stack" target="_blank">dumping stack</a> at the moment of the call. For this we will need to hook <b>GetMDDataAllocRead</b> itself by adding it to Catalog.ini (<a href="http://proger.i-forge.net/ApiHook_-_Win32_API_hooking_tool/7wP#api-cat" target="_blank">docs</a>) - right, it's not a system API function but ApiHook works on any export function from any library, 3rd party or not. (In fact it can technically hook even internal program's subroutines using the same technique but it's not implemented.)<br />
<br />
To keep it short I ill only show you the final result:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">* [usr] GetMDDataAllocRead: Stack trace: 0078F9E4 <u>[SELF]</u>, 100031C0 <u>[uty32dll]</u>, 0109712B, 00000000, 100031C0 [uty32dll], 012EB7E0, 000002CA, 00000000, 00000000, 7C900000 <u>[ntdll]</u>, ...</code><hr />
</div>Brackets tell us to which loaded module this memory address belongs to. So we see that it's called by <b>100031C0</b> which belongs to <b>LZFileOpen2</b> export which upon examination in IDA appears to be only called by <b>LZFileOpen</b> export - and most interestingly it also calls <b>SlideDecode</b> on this data. Now we have pinned-point the decompression function - in just 5 minutes and without complex debugging. Great result.<br />
</div>
    </div>
</div><br />
<br />
That's it for now. Hopefully it is useful. Let me know what you think.</div>

]]></content:encoded>
			<category domain="http://forums.novelnews.net/forumdisplay.php?f=60"><![CDATA[Production & Help]]></category>
			<dc:creator>Proger</dc:creator>
			<guid isPermaLink="true">http://forums.novelnews.net/showthread.php?t=36236</guid>
		</item>
		<item>
			<title>Sword Art Online: Infinity Moment PSP Translation Project</title>
			<link>http://forums.novelnews.net/showthread.php?t=36235&amp;goto=newpost</link>
			<pubDate>Wed, 22 May 2013 00:27:10 GMT</pubDate>
			<description><![CDATA[Hey guys, I was interested in translating this and was hoping for a project to start up so that I could help. From what I've read somewhere else, the...]]></description>
			<content:encoded><![CDATA[<div>Hey guys, I was interested in translating this and was hoping for a project to start up so that I could help. From what I've read somewhere else, the issue is hacking which seems to work a bit differently in this game. However, the hackers working on it didn't seem to be very good.<br />
<br />
So, I'm looking a hacker that knows what he's doing. Someone that could get me the script, and put everything back together in proper, working order. It would be nice to also have a QC or editor to help and even another translator would be great also. Since I've already played the game, I can say that the script is quite easy. I also have plenty of spare time so I think this could go pretty fast.</div>

]]></content:encoded>
			<category domain="http://forums.novelnews.net/forumdisplay.php?f=60"><![CDATA[Production & Help]]></category>
			<dc:creator>Kahr</dc:creator>
			<guid isPermaLink="true">http://forums.novelnews.net/showthread.php?t=36235</guid>
		</item>
		<item>
			<title><![CDATA[Where can I download the "Bug Fix"?]]></title>
			<link>http://forums.novelnews.net/showthread.php?t=36234&amp;goto=newpost</link>
			<pubDate>Tue, 21 May 2013 01:39:21 GMT</pubDate>
			<description><![CDATA[When mounting the SEENXXXX in SEEN.TXT appears this error message: 
 
 
---Quote--- 
Fatal error : exception Sys_error("Permission denied") 
---End...]]></description>
			<content:encoded><![CDATA[<div>When mounting the SEENXXXX in SEEN.TXT appears this error message:<br />
<br />
<div style="margin:20px; margin-top:5px; ">
	<div class="smallfont" style="margin-bottom:2px">Quote:</div>
	<table cellpadding="6" cellspacing="0" border="0" width="100%">
	<tr>
		<td class="alt2">
			<hr />
			
				Fatal error : exception Sys_error(&quot;Permission denied&quot;)
			
			<hr />
		</td>
	</tr>
	</table>
</div>Rummaging through old posts, I saw that I need to download this &quot;Bug Fix&quot;. Which in this case would be?<br />
<br />
<div style="margin:20px; margin-top:5px; ">
	<div class="smallfont" style="margin-bottom:2px">Quote:</div>
	<table cellpadding="6" cellspacing="0" border="0" width="100%">
	<tr>
		<td class="alt2">
			<hr />
			
				<a href="http://www.haeleth.net/temp/kprl.exe" target="_blank">http://www.haeleth.net/temp/kprl.exe</a>
			
			<hr />
		</td>
	</tr>
	</table>
</div>Could someone give it to me?<br />
<br />
Contact: <a href="mailto:henriquesz@live.com">henriquesz@live.com</a><br />
<br />
Thank you!</div>

]]></content:encoded>
			<category domain="http://forums.novelnews.net/forumdisplay.php?f=55">Technical Issues</category>
			<dc:creator>Henrique</dc:creator>
			<guid isPermaLink="true">http://forums.novelnews.net/showthread.php?t=36234</guid>
		</item>
		<item>
			<title>Weird Graphical Errors in XP3 File for Fate/Stay Night</title>
			<link>http://forums.novelnews.net/showthread.php?t=36233&amp;goto=newpost</link>
			<pubDate>Wed, 08 May 2013 12:52:34 GMT</pubDate>
			<description><![CDATA[I've created an XP3 file for Fate/Stay Night, but somewhere along the line, things go wrong... and I'm not sure why. 
 
What I'm trying to do is to...]]></description>
			<content:encoded><![CDATA[<div>I've created an XP3 file for Fate/Stay Night, but somewhere along the line, things go wrong... and I'm not sure why.<br />
<br />
What I'm trying to do is to replace some of the existing CGs.  However, although I can replace them, the some of the replacement images have graphical bugs in-game.  See the attachments: the 'no error' picture is what a part of my original bmp file looks like.  the 'error' picture is what it looks like in-game.<br />
<br />
I read somewhere that this may be related to the XP3 tools not working propely with some pictures, with the compression messing things up.<br />
<br />
In any case, here's the process I've been following:<br />
<br />
- Open the bmp file in Photoshop CS5<br />
- Go to Channels, create a new (alpha) channel.  Set it completely to white.<br />
- Save as a 32bit Windows BMP file, with 'Alpha Channels' ticked<br />
- Go to kr219b15 (kirikiri folder), kirikiri2/tools/ and start krkrtpc.exe<br />
- Ensure that in the first and second columns, the TLG options (3rd options) are selected.<br />
- Drag the image to the window.  It converts it to TLG<br />
- Use xp3-repacker.exe from the command line (with the fate_full flag) to pack the TLG file into an .xp3.<br />
- Put the XP3 file into the Fate-Stay Night directory and play.<br />
<br />
I also tried creating a alpha channel in gimp, but the same thing happened when I turned that image into a tlg, then an xp3 and tried it out in-game.<br />
<br />
I've tried using the tool here: <a href="http://tlwiki.org/index.php?title=File:Kikiriki.rar" target="_blank">http://tlwiki.org/index.php?title=File:Kikiriki.rar</a> to create the XP3 file too using the command line:<br />
kikiriki.exe -c -i C:\TLG -o patch9.xp3<br />
but the XP3 file I create with that doesn't seem to get picked up in-game at all.<br />
<br />
So what's wrong?  Is there some other good XP3 packer that will work for Fate/Stay Night?  Or can someone advise me what I'm doing wrong with the ones I'm using?</div>


	<br />
	<div style="padding:6px">

	

	
		<fieldset class="fieldset">
			<legend>Attached Images</legend>
			<div style="padding:3px">
			<img class="attach" src="http://forums.novelnews.net/attachment.php?attachmentid=141&amp;stc=1&amp;d=1368017039" border="0" alt="" />&nbsp;<img class="attach" src="http://forums.novelnews.net/attachment.php?attachmentid=142&amp;stc=1&amp;d=1368017056" border="0" alt="" />&nbsp;
			</div>
		</fieldset>
	

	

	

	</div>
]]></content:encoded>
			<category domain="http://forums.novelnews.net/forumdisplay.php?f=60"><![CDATA[Production & Help]]></category>
			<dc:creator>Soul Reaver</dc:creator>
			<guid isPermaLink="true">http://forums.novelnews.net/showthread.php?t=36233</guid>
		</item>
		<item>
			<title>getting around region locks - how?</title>
			<link>http://forums.novelnews.net/showthread.php?t=36232&amp;goto=newpost</link>
			<pubDate>Tue, 30 Apr 2013 19:48:40 GMT</pubDate>
			<description>Hello friends, I need advice... I bought the game Rewrite recently, unaware of such a thing as region locks. If I want to start it up I get the...</description>
			<content:encoded><![CDATA[<div>Hello friends, I need advice... I bought the game Rewrite recently, unaware of such a thing as region locks. If I want to start it up I get the message ''Japan Only&quot;... My question: how do you get around this? I have windows 8, if that is useful information. Thanks!</div>

]]></content:encoded>
			<category domain="http://forums.novelnews.net/forumdisplay.php?f=54">General Discussion</category>
			<dc:creator>VN lover</dc:creator>
			<guid isPermaLink="true">http://forums.novelnews.net/showthread.php?t=36232</guid>
		</item>
		<item>
			<title>Help with puttext in NScripter</title>
			<link>http://forums.novelnews.net/showthread.php?t=36231&amp;goto=newpost</link>
			<pubDate>Tue, 30 Apr 2013 18:33:49 GMT</pubDate>
			<description><![CDATA[Hi, I'm trying to use the gettext function to insert entire script lines for a VN that I'm translating. This method is somewhat working, but chokes...]]></description>
			<content:encoded><![CDATA[<div>Hi, I'm trying to use the gettext function to insert entire script lines for a VN that I'm translating. This method is somewhat working, but chokes upon reaching an @ in the script. Strangely, the @ is processed and the game enters clickwait mode, but upon clicking it immediately crashes with an error message stating that EOF was unexpectedly reached. The line number it is giving is 10884, while the script file itself has 10895 lines - so almost, but not quite the end of the file. <br />
<br />
I can't find any way to make this symbol work. Nothing I put after it avoids the crash, including nothing at all. Doing a separate puttext &quot;@&quot; doesn't work either; in that case nothing happens at all.<br />
<br />
Is there any way to make puttext work with the script token?</div>

]]></content:encoded>
			<category domain="http://forums.novelnews.net/forumdisplay.php?f=60"><![CDATA[Production & Help]]></category>
			<dc:creator>qazmlpok</dc:creator>
			<guid isPermaLink="true">http://forums.novelnews.net/showthread.php?t=36231</guid>
		</item>
	</channel>
</rss>
