hi,<div>I'm trying to call NtUnmapViewOfSection from ntdll.dll. According to the msdn docs it should look like</div><div><pre style="padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;margin-top:0px;margin-bottom:0px;font-family:Consolas,Courier,monospace;word-break:break-all;word-wrap:break-word;overflow-x:auto;overflow-y:auto;font-size:12px">
NTSTATUS NtUnmapViewOfSection(
__in HANDLE ProcessHandle,
__in_opt PVOID BaseAddress
);</pre><pre style="padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;margin-top:0px;margin-bottom:0px;font-family:Consolas,Courier,monospace;word-break:break-all;word-wrap:break-word;overflow-x:auto;overflow-y:auto;font-size:12px">
<br></pre><pre style="padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;margin-top:0px;margin-bottom:0px;font-family:Consolas,Courier,monospace;word-break:break-all;word-wrap:break-word;overflow-x:auto;overflow-y:auto;font-size:12px">
I tried to call it by simply declaring </pre><pre style="padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;margin-top:0px;margin-bottom:0px;word-break:break-all;word-wrap:break-word;overflow-x:auto;overflow-y:auto">
<font face="Consolas, Courier, monospace"><span style="font-size:12px">extern(Windows) uint NtUnmapViewOfSection(HANDLE hProcess,PVOID baseAddress);</span></font></pre><pre style="padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;margin-top:0px;margin-bottom:0px;word-break:break-all;word-wrap:break-word;overflow-x:auto;overflow-y:auto">
<font face="Consolas, Courier, monospace"><span style="font-size:12px">But now I get </span></font></pre><pre style="padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;margin-top:0px;margin-bottom:0px;word-break:break-all;word-wrap:break-word;overflow-x:auto;overflow-y:auto">
<font face="Consolas, Courier, monospace"><span style="font-size:12px"> Error 42: Symbol Undefined _NtUnmapViewOfSection@8</span></font></pre><pre style="padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;margin-top:0px;margin-bottom:0px;word-break:break-all;word-wrap:break-word;overflow-x:auto;overflow-y:auto">
<font face="Consolas, Courier, monospace"><span style="font-size:12px"><br></span></font></pre><pre style="padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;margin-top:0px;margin-bottom:0px;word-break:break-all;word-wrap:break-word;overflow-x:auto;overflow-y:auto">
<font face="Consolas, Courier, monospace"><span style="font-size:12px">I've also tried using GetProcAddress</span></font></pre><pre style="padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;margin-top:0px;margin-bottom:0px;word-break:break-all;word-wrap:break-word;overflow-x:auto;overflow-y:auto">
<font face="Consolas, Courier, monospace"><span style="font-size:12px">cast(uint function(HANDLE hProcess,PVOID address))GetProcAddress(Runtime.loadLibrary("ntdll.dll"), "NtUnmapViewOfSection")</span></font></pre>
<pre style="padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;margin-top:0px;margin-bottom:0px;word-break:break-all;word-wrap:break-word;overflow-x:auto;overflow-y:auto"><font face="Consolas, Courier, monospace"><span style="font-size:12px">but when I looked at GetLastError I get error 127 (specified procedure could not be found) and the function doesn't work.</span></font></pre>
<pre style="padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;margin-top:0px;margin-bottom:0px;word-break:break-all;word-wrap:break-word;overflow-x:auto;overflow-y:auto"><font face="Consolas, Courier, monospace"><span style="font-size:12px"><br>
</span></font></pre><pre style="padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;margin-top:0px;margin-bottom:0px;word-break:break-all;word-wrap:break-word;overflow-x:auto;overflow-y:auto"><font face="Consolas, Courier, monospace"><span style="font-size:12px">It's likely I'm missing something easy here, I just can't figure out what it is.</span></font></pre>
<pre style="padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;margin-top:0px;margin-bottom:0px;word-break:break-all;word-wrap:break-word;overflow-x:auto;overflow-y:auto"><font face="Consolas, Courier, monospace"><span style="font-size:12px">Someone knows what it is?</span></font></pre>
<pre style="padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;margin-top:0px;margin-bottom:0px;word-break:break-all;word-wrap:break-word;overflow-x:auto;overflow-y:auto"><font face="Consolas, Courier, monospace"><span style="font-size:12px"><br>
</span></font></pre><pre style="padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;margin-top:0px;margin-bottom:0px;word-break:break-all;word-wrap:break-word;overflow-x:auto;overflow-y:auto"><font face="Consolas, Courier, monospace"><span style="font-size:12px">Maarten</span></font></pre>
<pre style="padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;margin-top:0px;margin-bottom:0px;word-break:break-all;word-wrap:break-word;overflow-x:auto;overflow-y:auto"><font face="Consolas, Courier, monospace"><span style="font-size:12px"><br>
</span></font></pre></div>