{"id":222,"date":"2021-01-26T19:04:08","date_gmt":"2021-01-26T10:04:08","guid":{"rendered":"http:\/\/drroot.page\/wp\/?p=222"},"modified":"2021-01-31T00:22:58","modified_gmt":"2021-01-30T15:22:58","slug":"%e3%82%b2%e3%83%bc%e3%83%a0%e3%81%ae%e3%83%a1%e3%83%a2%e3%83%aa%e3%82%92%e7%9b%a3%e8%a6%96%e3%81%99%e3%82%8b-%ef%bd%9e-aslr%e3%81%8c%e6%9c%89%e5%8a%b9%e3%81%aa%e5%a0%b4%e5%90%88","status":"publish","type":"post","link":"https:\/\/drroot.page\/wp\/?p=222","title":{"rendered":"\u30b2\u30fc\u30e0\u306e\u30e1\u30e2\u30ea\u3092\u76e3\u8996\u3059\u308b \uff5e ASLR\u304c\u6709\u52b9\u306a\u5834\u5408"},"content":{"rendered":"<h1>\u30e1\u30e2\u30ea\u3092\u76e3\u8996\u3059\u308b<\/h1>\n<h2>\u3082\u304f\u3066\u304d<\/h2>\n<p>\u30b2\u30fc\u30e0\u306eHP\u3068\u304b\u3092\u76e3\u8996\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u308b\u3002<br \/>\n\u4eca\u56de\u306f<a href=\"https:\/\/store.steampowered.com\/app\/584400\/Sonic_Mania\/?l=japanese\" title=\"SONIC MANIA\">SONIC MANIA<\/a>\u3092\u5bfe\u8c61\u306b\u3001\u30b2\u30fc\u30e0\u5185\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u307f\u3088\u3046\u3002<\/p>\n<p><!--more--><\/p>\n<h2>\u305c\u3093\u3066\u3044<\/h2>\n<h3>\u52d5\u7684\u304b\u9759\u7684\u304b\u306e\u8a71<\/h3>\n<p>\u308f\u304b\u308a\u3084\u3059\u304f\u3059\u308b\u70ba\u306b\u3001\u30b2\u30fc\u30e0\u5185\u30ad\u30e3\u30e9\u306eHP\u3092\u8003\u3048\u3066\u307f\u3088\u3046\uff08\u30bd\u30cb\u30c3\u30af\u306e\u5834\u5408\u306f\u6b8b\u308a\u306e\u30ea\u30f3\u30b0\u6570\u3060\u304c\uff09\u3002<br \/>\nHP\u306e\u5024\u306f\u5f53\u7136\u30e1\u30e2\u30ea\u306e\u3069\u3053\u304b\u306b\u914d\u7f6e\u3055\u308c\u308b\u308f\u3051\u3060\u304c\u3001\u3053\u306e\u6642\u300c\u6bce\u56de\u30e1\u30e2\u30ea\u306e\u540c\u3058\u5834\u6240\u306b\u914d\u7f6e\u3055\u308c\u308b\u300d\u304b\u300c\u30b2\u30fc\u30e0\u3092\u8d77\u52d5\u3057\u305f\u308a\u30d7\u30ec\u30a4\u3092\u958b\u59cb\u3059\u308b\u5ea6\u306b\u7570\u306a\u308b\u5834\u6240\u306b\u914d\u7f6e\u3055\u308c\u308b\u300d\u304b\u306f\u30b2\u30fc\u30e0\u306b\u3088\u308b\u3002<br \/>\n\u30b2\u30fc\u30e0\u306b\u9650\u3089\u305a\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30e1\u30e2\u30ea\u7ba1\u7406\u306b\u306f\u3001\u3053\u306e\u3088\u3046\u306a\u6c7a\u307e\u3063\u305f\u30a2\u30c9\u30ec\u30b9\u306b\u78ba\u4fdd\u3055\u308c\u308b<strong>\u9759\u7684\u30e1\u30e2\u30ea<\/strong>\u3068\u3001\u6bce\u56de\u5fc5\u8981\u306a\u6642\u306b\u5fc5\u8981\u306a\u5834\u6240\u3092\u53d6\u3063\u3066\u304f\u308b<strong>\u52d5\u7684\u30e1\u30e2\u30ea<\/strong>\u306b\u5206\u3051\u3089\u308c\u308b\u3002<\/p>\n<p>\u3067\u3001\u30b2\u30fc\u30e0\u306e\u30c1\u30fc\u30c8\u3084\u30e1\u30e2\u30ea\u306e\u76e3\u8996\u3092\u3059\u308b\u306a\u3089\u3001\u5f53\u7136\u9759\u7684\u30e1\u30e2\u30ea\u306e\u30a2\u30c9\u30ec\u30b9\uff08\u4ee5\u4e0b\u9759\u7684\u30a2\u30c9\u30ec\u30b9\uff09\u3092\u63b4\u3093\u3060\u307b\u3046\u304c\u90fd\u5408\u304c\u3044\u3044\u3002<br \/>\n\u30b2\u30fc\u30e0\u3092\u8d77\u52d5\u3059\u308b\u5ea6\u306b\u3001HP\u306e\u30a2\u30c9\u30ec\u30b9\u306f\u4f55\u51e6\u3060\u3068Cheat Engine\u3067\u63a2\u3057\u3066\u304d\u3066\u3001\u30a2\u30c9\u30ec\u30b9\u5165\u529b\u3059\u308b\u3093\u3058\u3083\u3081\u3093\u3069\u304f\u3055\u304f\u3066\u3057\u3087\u3046\u304c\u306a\u3044\u3002<br \/>\n\u3082\u3063\u3068\u3082\u3001<a href=\"https:\/\/drroot.page\/wp\/?p=185\">UNDERTALE\u306e\u3088\u3046\u306a<\/a>HP\u304c\u52d5\u7684\u30a2\u30c9\u30ec\u30b9\u306b\u7f6e\u304b\u308c\u3066\u3044\u308b\u5834\u5408\u3067\u3082\u3001\u5fc5\u305a\u305d\u306e\u30a2\u30c9\u30ec\u30b9\u3092\u6307\u3057\u793a\u3059\u9759\u7684\u30e1\u30e2\u30ea\u304c\u5b58\u5728\u3059\u308b\u3002<br \/>\n\u3088\u3063\u3066Cheat Engine\u3067HP\u3092\u610f\u5473\u3059\u308b\u9759\u7684\u30e1\u30e2\u30ea\u3001\u3082\u3057\u304f\u306fHP\u3092\u610f\u5473\u3059\u308b\u52d5\u7684\u30e1\u30e2\u30ea\u306e\u30a2\u30c9\u30ec\u30b9\u3092\u4fdd\u6301\u3057\u305f\u9759\u7684\u30e1\u30e2\u30ea\u3092\u63a2\u3057\u3066\u304f\u308c\u3070\u3001\u4f55\u5ea6\u30b2\u30fc\u30e0\u3092\u518d\u8d77\u52d5\u3057\u3066\u3082\u30a2\u30d7\u30ea\u304b\u3089HP\u3092\u53c2\u7167\u3057\u306b\u3044\u3051\u308b\u308f\u3051\u3060\u3002<\/p>\n<h3>ASLR\u3063\u3066\u4f55\u3084<\/h3>\n<p>\u3068\u3053\u308d\u304c\u3001\u30e1\u30e2\u30ea\u7ba1\u7406\u306e\u90fd\u5408\u4e0a\u3001\u9759\u7684\u30e1\u30e2\u30ea\u3067\u3042\u308a\u306a\u304c\u3089\u30e1\u30e2\u30ea\u30a2\u30c9\u30ec\u30b9\u304c\u56fa\u5b9a\u3055\u308c\u306a\u3044\u30b1\u30fc\u30b9\u304c\u3042\u308b\u3002<br \/>\n\u305d\u3082\u305d\u3082\u9759\u7684\u3067\u3042\u308b\u3068\u306f\u3001exe\u30d5\u30a1\u30a4\u30eb\u306e\u914d\u7f6e\u4f4d\u7f6e\u304b\u3089\u56fa\u5b9a\u306e\u4f4d\u7f6e\u306b\u914d\u7f6e\u3055\u308c\u3066\u3044\u308b\u3068\u3044\u3046\u610f\u5473\u3060\u3002<\/p>\n<p>\u3069\u3046\u3044\u3046\u4e8b\u304b\u3068\u3044\u3046\u3068\u3001exe\u3092\u5b9f\u884c\u3057\u305f\u969b\u3001\u305d\u306e\u4e2d\u8eab\u306e\u5b9f\u884c\u3059\u3079\u304d\u30d7\u30ed\u30b0\u30e9\u30e0\u90e8\u5206\u304c\u30e1\u30e2\u30ea\u4e0a\u306b\u3069\u304b\u3063\u3068\u30b3\u30d4\u30fc\u3055\u308c\u308b\u3002<br \/>\n\u305d\u306e\u5f8c\u5fc5\u8981\u306aDLL\u306a\u3093\u304b\u3082\u3069\u304b\u30fc\u3063\u3068\u30e1\u30e2\u30ea\u4e0a\u306b\u30ed\u30fc\u30c9\u3057\u3066\u3044\u3063\u305f\u5f8c\u3001\u6674\u308c\u3066exe\u3060\u3063\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u90e8\u5206\u3092\u30e1\u30e2\u30ea\u304b\u3089\u8aad\u307f\u51fa\u3057\u3066\u5b9f\u884c\u3059\u308b\u308f\u3051\u3060\u3002<br \/>\n\u3053\u306e\u6642\u306e\u30e1\u30e2\u30ea\u4e0a\u306eexe\u30d5\u30a1\u30a4\u30eb\u306e\u7f6e\u304d\u5834\u3092\u30d9\u30fc\u30b9\u30a2\u30c9\u30ec\u30b9\u3068\u304b\u8a00\u3046\u3093\u3060\u304c\u3001\u30d9\u30fc\u30b9\u30a2\u30c9\u30ec\u30b9\u306f\u4e00\u822c\u306b0x400000(32bit\u30a2\u30d7\u30ea)\u307e\u305f\u306f0x140000000(64bit)\u3067\u56fa\u5b9a\u306b\u306a\u3063\u3066\u3044\u308b\u3002<br \/>\n\u3088\u3063\u3066\u524d\u8ff0\u306e\u300c\u9759\u7684\u3067\u3042\u308b\u300d\u3092\u3088\u308a\u4f7f\u3048\u308b\u8868\u73fe\u306b\u5909\u3048\u308b\u3068\u3001\u300c\u30d9\u30fc\u30b9\u30a2\u30c9\u30ec\u30b9+\u56fa\u5b9a\u5024\u3067\u8868\u3055\u308c\u308b\u300d\u3068\u3044\u3046\u98a8\u306b\u306a\u308b\u308f\u3051\u3060\u3002<br \/>\n\u4ee5\u5f8c\u306f\u3053\u306e\u30d9\u30fc\u30b9\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u5e7e\u3089\u306e\u5024\u3092\u30aa\u30d5\u30bb\u30c3\u30c8\u3068\u547c\u3076\u3002<\/p>\n<p>\u3068\u3053\u308d\u304c\u3001\u300c\u3044\u3084\u30fc\u3084\u3063\u3071\u30e1\u30e2\u30ea\u30a2\u30c9\u30ec\u30b9\u304c\u6bce\u56de\u56fa\u5b9a\u3060\u3068\u6016\u3044\u3088\u306d\u2015\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u7684\u306b\u5371\u306a\u3055\u305d\u3046\u3060\u3057\u2026\u300d\u3068\u3044\u3046\u7406\u7531\u3067\u3001<a href=\"https:\/\/ja.wikipedia.org\/wiki\/%E3%82%A2%E3%83%89%E3%83%AC%E3%82%B9%E7%A9%BA%E9%96%93%E9%85%8D%E7%BD%AE%E3%81%AE%E3%83%A9%E3%83%B3%E3%83%80%E3%83%A0%E5%8C%96\">ASLR<\/a>\u3068\u3044\u3046\u3082\u306e\u304c\u5c0e\u5165\u3055\u308c\u305f\u3002<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u30aa\u30f3\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u306e\u6a5f\u80fd\u306f\u3001\u30d9\u30fc\u30b9\u30a2\u30c9\u30ec\u30b9\u81ea\u4f53\u3092\u6bce\u56de\u5909\u3048\u3066\u3057\u307e\u3046\u3068\u3044\u3046\u5384\u4ecb\u306a\u30d5\u30a1\u30c3\u30af\u3060\u3002<br \/>\n\u305d\u306e\u305f\u3081\u30d7\u30ed\u30b0\u30e9\u30e0\u304b\u3089\u7279\u5b9a\u306e\u9759\u7684\u30a2\u30c9\u30ec\u30b9\u3092\u53c2\u7167\u3057\u306b\u884c\u304f\u5834\u5408\u3001<strong>\u30d9\u30fc\u30b9\u30a2\u30c9\u30ec\u30b9\u3092\u53d6\u5f97<\/strong>\u2192+\u30aa\u30d5\u30bb\u30c3\u30c8\u5206\u306e\u30a2\u30c9\u30ec\u30b9\u3092\u53c2\u7167\u3001\u3068\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3002<br \/>\n\u3061\u306a\u307f\u306bCheat Engine\u3067\u306f\u3053\u306e\u3088\u3046\u306a\u300c\u7dd1\u5b57+HEX\u5024\u300d\u3067\u8868\u3055\u308c\u308b\u305e\u3002<br \/>\n<a href=\"https:\/\/drroot.page\/wp\/wp-content\/uploads\/2021\/01\/2.png\"><img decoding=\"async\" src=\"https:\/\/drroot.page\/wp\/wp-content\/uploads\/2021\/01\/2.png\" alt=\"\" \/><\/a><\/p>\n<h2>\u5177\u4f53\u7684\u306a\u624b\u9806<\/h2>\n<p>Cheat Engine\u3067\u30aa\u30d5\u30bb\u30c3\u30c8\u5024\u3092\u7279\u5b9a\u3059\u308b\u3068\u3053\u308d\u307e\u3067\u306f\u7701\u7565\u3059\u308b\u3002<\/p>\n<h3>\u6982\u8981<\/h3>\n<p>Windows\u306b\u304a\u3044\u3066\u3001EXE\u3068DLL\uff08\u3088\u3046\u306f\u5b9f\u884c\u53ef\u80fd\u306a\u30b3\u30fc\u30c9\u3092\u542b\u3080\u3084\u3064\uff09\u3092\u307e\u3068\u3081\u3066\u300c\u30e2\u30b8\u30e5\u30fc\u30eb\u300d\u3068\u547c\u3076\u3002<br \/>\n\u5b9f\u884c\u4e2d\u306e\u30d7\u30ed\u30bb\u30b9\u3068\u3001\u305d\u306e\u30d7\u30ed\u30bb\u30b9\u304c\u63b4\u3093\u3067\u3044\u308b\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u3069\u308c\u3082WinAPI\u304b\u3089\u53d6\u5f97\u3067\u304d\u308b\u3002<br \/>\n\u624b\u9806\u3068\u3057\u3066\u306f\u3001<\/p>\n<ul>\n<li>CreateToolhelp32Snapshot\u3067\u5b9f\u884c\u4e2d\u306e\u30d7\u30ed\u30bb\u30b9\u4e00\u89a7\uff08\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u3068\u8a00\u3046\uff09\u306e\u30cf\u30f3\u30c9\u30eb\u53d6\u5f97<\/li>\n<li>Process32First\/Process32Next\u3067\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u3092\u8210\u3081\u3066\u3044\u304f<\/li>\n<li>\u76ee\u7684\u306e\u30d7\u30ed\u30bb\u30b9\uff08\u540d\u524d\u304csonicmania.exe\uff09\u3092\u898b\u3064\u3051\u305f\u3089\u3001\u305d\u306e\u30d7\u30ed\u30bb\u30b9ID\u306b\u5bfe\u3057OpenProcess\u3067\u30d7\u30ed\u30bb\u30b9\u30cf\u30f3\u30c9\u30eb\u53d6\u5f97<\/li>\n<li>\u30d7\u30ed\u30bb\u30b9\u30cf\u30f3\u30c9\u30eb\u304b\u3089EnumProcessModules\u3067\u30e2\u30b8\u30e5\u30fc\u30eb\u30cf\u30f3\u30c9\u30eb\u306e\u4e00\u89a7\u53d6\u5f97<\/li>\n<li>exe\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u898b\u3064\u3051\u305f\u3089\u305d\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u30cf\u30f3\u30c9\u30eb\u304c\u30d9\u30fc\u30b9\u30a2\u30c9\u30ec\u30b9\u3060\uff01\uff01\uff01<\/li>\n<\/ul>\n<p>\u3068\u3044\u3063\u305f\u611f\u3058\u3002<br \/>\n\u3053\u306e\u6642\u3001WinAPI\u3067\u306f\u304a\u306a\u3058\u307f\u306e\u300c\u30cf\u30f3\u30c9\u30eb\u300d\u304c\u7528\u3044\u3089\u308c\u308b\u304c\u3001\u30d7\u30ed\u30bb\u30b9\u306e\u30cf\u30f3\u30c9\u30eb\u304c\u3053\u308c\u3068\u8a00\u3063\u3066\u4ed6\u306b\u4f7f\u3044\u307f\u3061\u304c\u306a\u3044\u306e\u306b\u5bfe\u3057\u3001<a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/psapi\/ns-psapi-moduleinfo\"><strong>\u30e2\u30b8\u30e5\u30fc\u30eb\u30cf\u30f3\u30c9\u30eb\u306f\u305d\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u30a2\u30c9\u30ec\u30b9\u305d\u306e\u3082\u306e\u3092\u6307\u3059<\/strong><\/a>\u3002<br \/>\n\u3064\u307e\u308a\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u30cf\u30f3\u30c9\u30eb\u3092\u5f97\u3066\u3057\u307e\u3048\u3070\u3001\u305d\u3044\u3064\u3092\u30d9\u30fc\u30b9\u306b\u56fa\u5b9a\u30aa\u30d5\u30bb\u30c3\u30c8\u5206\u305a\u3089\u3057\u305f\u30a2\u30c9\u30ec\u30b9\u3092\u8aad\u307f\u8fbc\u3081\u3070\u3044\u3044\u308f\u3051\u3060\u3002<\/p>\n<h3>\u5b9f\u969b\u306e\u30b3\u30fc\u30c9<\/h3>\n<p>\u4ee5\u4e0a\u3092\u3075\u307e\u3048\u305f\u30b3\u30fc\u30c9\u304c\u3053\u3046\u3002<\/p>\n<pre><code class=\"language-cpp\">\n#include &lt;iostream&gt;\n#include &lt;Windows.h&gt;\n#include &lt;conio.h&gt;\n#include &lt;charconv&gt;\n#include &lt;TlHelp32.h&gt;\n#include &lt;random&gt;\n#include &lt;string&gt;\n#include &lt;Psapi.h&gt;\n\n#pragma comment(lib,&quot;psapi.lib&quot;)\n\n\/\/ \u300c\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u30bb\u30c3\u30c8\u3092\u5229\u7528\u3059\u308b\u300d\u3058\u3083\u306a\u3044\u3068\u30b3\u30b1\u308b\u3068\u601d\u3046\n\nusing playtime = UINT32;\nHANDLE getHandleFromName(LPCSTR app_name);\nvoid getProps(HANDLE hProcess, size_t baseAddr, int* ring, int* life, playtime* time);\nsize_t getBaseAddress(HANDLE hProcess, LPCSTR procName);\n\nint main()\n{\n    auto processName = &quot;SonicMania.exe&quot;;\n\n    \/\/ \u30b2\u30fc\u30e0\u306e\u30d7\u30ed\u30bb\u30b9\u63b4\u307f\u306b\u884c\u304f\n    HANDLE hProcess = getHandleFromName(processName);\n\n    std::cout &lt;&lt; &quot;process handle:&quot; &lt;&lt; hProcess &lt;&lt; std::endl;\n\n    \/\/ error check\n    if (hProcess == NULL) {\n        std::cout &lt;&lt; &quot;\u30d7\u30ed\u30bb\u30b9\u30cf\u30f3\u30c9\u30eb\u63e1\u308c\u3093\u304b\u3063\u305f\u308f&quot; &lt;&lt; std::endl;\n        exit(0);\n    }\n\n    \/\/ \u30d7\u30ed\u30bb\u30b9\u30cf\u30f3\u30c9\u30eb\u304b\u3089\u30e2\u30b8\u30e5\u30fc\u30eb\u30cf\u30f3\u30c9\u30eb\u5f15\u3044\u3066\u304f\u308b\n    auto baseAddr = getBaseAddress(hProcess, processName);\n\n    std::cout &lt;&lt; &quot;module handle:&quot; &lt;&lt; baseAddr &lt;&lt; std::endl;\n\n    \/\/ \u76e3\u8996\u958b\u59cb\n    int rings = 0;\n    int life = 0;\n    playtime time = 0;\n    while (!_kbhit()) {\n        \/\/ \u7d42\u4e86\u78ba\u8a8d\n        DWORD status;\n        GetExitCodeProcess(hProcess, &amp;status);\n        if (status != STILL_ACTIVE) break;\n\n        \/\/ \u53d6\u3063\u3066\u304f\u308b\n        getProps(hProcess, baseAddr, &amp;rings, &amp;life, &amp;time);\n\n        std::cout &lt;&lt; rings &lt;&lt; &quot; : &quot; &lt;&lt; life &lt;&lt; &quot; : &quot; &lt;&lt; time &lt;&lt; &quot;\\r&quot;;\n\n        Sleep(200);\n    }\n    \/\/ close\n    \/\/ \u307b\u3093\u3068\u306f\u4f55\u3089\u304b\u306e\u65b9\u6cd5\u3067\u7d42\u4e86\u6642\u306b\u30d5\u30c3\u30af\u3057\u305f\u3044\n    if (hProcess != NULL) {\n        CloseHandle(hProcess);\n    }\n}\n\nunion number {\n    float f;\n    int i;\n    uint32_t bytes;\n};\n\n\/\/ 1\u30d0\u30a4\u30c8\u305a\u3064\u306e\u30d6\u30ed\u30c3\u30af\u30924\u30d0\u30a4\u30c8\u5206\u7d44\u307f\u7acb\u3066\u308b\nnumber build4Bytes(BYTE* buf) {\n    number ret;\n    ret.bytes = 0;\n\n    for (int i = 0; i &lt; 4; i++) {\n        auto bits = buf[i] &lt;&lt; (8 * i);\n        ret.bytes |= (uint32_t)bits;\n    }\n    return ret;\n}\n\n\/\/ \u30ea\u30f3\u30b0\u3001\u6b8b\u6a5f\u3001\u30bf\u30a4\u30e0\u3092\u5f15\u3063\u3053\u629c\u304f\nvoid getProps(HANDLE hProcess, size_t baseAddr, int* ring, int* life, playtime* time) {\n    \/\/ \u30ea\u30f3\u30b0  (exe + 469ad4:4)\n    \/\/ \u6b8b\u6a5f       (exe + 469ae0:4)\n    \/\/ \u6642\u9593       (exe + A8F074:4)\n    BYTE buf[4];\n    size_t pRing = baseAddr + 0x469ad4;\n    size_t pLife = baseAddr + 0x469ae0;\n    size_t pTime = baseAddr + 0xA8F074;\n\n    \/\/ dump rings\n    if (ReadProcessMemory(hProcess, (LPCVOID)pRing, (LPVOID)buf, 4, NULL)) {\n        *ring = build4Bytes(buf).i;\n    }\n\n    \/\/ dump lifes\n    if (ReadProcessMemory(hProcess, (LPCVOID)pLife, (LPVOID)buf, 4, NULL)) {\n        *life = build4Bytes(buf).i;\n    }\n\n    \/\/ dump times\n    if (ReadProcessMemory(hProcess, (LPCVOID)pTime, (LPVOID)buf, 4, NULL)) {\n        *time = build4Bytes(buf).bytes;\n    }\n}\n\n\/\/ \u30a6\u30a3\u30f3\u30c9\u30a6\u540d\u2192\u30d7\u30ed\u30bb\u30b9\u30cf\u30f3\u30c9\u30eb\n\/\/ \u3053\u306e\u8fba\u5ac1 https:\/\/www.keicode.com\/windows\/win07.php\nHANDLE getHandleFromName(LPCSTR app_name) {\n    HANDLE hSnap;\n    PROCESSENTRY32 pe;\n    DWORD dwProcessId = 0;\n    BOOL bResult;\n\n    if ((hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)) == INVALID_HANDLE_VALUE) {\n        return NULL;\n    }\n\n    pe.dwSize = sizeof(pe);\n\n    \/\/ \u30d7\u30ed\u30bb\u30b9\u5217\u6319\u2192\u6bd4\u8f03\u306e\u30eb\u30fc\u30d7\n    bResult = Process32First(hSnap, &amp;pe);\n    while (bResult) {\n        if (!lstrcmpi(pe.szExeFile, app_name)) {\n            dwProcessId = pe.th32ProcessID;\n            CloseHandle(hSnap);\n            break;\n        }\n        bResult = Process32Next(hSnap, &amp;pe);\n    }\n\n    \/\/ \u53d6\u308c\u3066\u305f\u3089Open\u3059\u308b\n    if (dwProcessId != 0) {\n        return OpenProcess(PROCESS_ALL_ACCESS, TRUE, dwProcessId);\n    }\n    else {\n        return NULL;\n    }\n}\n\n\/\/ \u30d7\u30ed\u30bb\u30b9\u30cf\u30f3\u30c9\u30eb\u2192\u30e2\u30b8\u30e5\u30fc\u30eb\u30cf\u30f3\u30c9\u30eb\n\/\/ \u307b\u307c\u30d1\u30af\u30ea\u2193\n\/\/ http:\/\/eternalwindows.jp\/windevelop\/dll\/dll12.html\nsize_t getBaseAddress(HANDLE hProcess, LPCSTR procName) {\n    DWORD size;\n    HMODULE lphModules[128];\n    EnumProcessModules(hProcess, lphModules, sizeof(lphModules), &amp;size);\n\n    for (int i = 0; i &lt; size \/ (sizeof(HMODULE)); i++) {\n        CHAR name[1024];\n        MODULEINFO info;\n\n        GetModuleBaseName(hProcess, lphModules[i], name, sizeof(name));\n        GetModuleInformation(hProcess, lphModules[i], &amp;info, sizeof(info));\n\n        \/\/ \u3068\u308a\u3042\u3048\u305a\u8868\u793a\n        \/\/ std::cout &lt;&lt; &quot;NAME:&quot; &lt;&lt; name &lt;&lt; &quot;\\nInfo:baseAddr --- &quot; &lt;&lt; info.lpBaseOfDll\n        \/\/  &lt;&lt; &quot;\\nInfo:entry --- &quot; &lt;&lt; info.lpBaseOfDll &lt;&lt; &quot;\\n\\n&quot;;\n\n        \/\/ \u30d7\u30ed\u30bb\u30b9\u540d\u3068\u540c\u3058\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u3044\u305f\u3089\u305d\u3044\u3064\u3092\u8fd4\u3059\n        \/\/ \u5c1a\u30e2\u30b8\u30e5\u30fc\u30eb\u30cf\u30f3\u30c9\u30eb\u3068\u30d9\u30fc\u30b9\u30a2\u30c9\u30ec\u30b9\u306f\u4e00\u81f4\u3059\u308b\n        if (!lstrcmpi(name, procName)) {\n            return (size_t)lphModules[i];\n        }\n    }\n    return NULL;\n}\n<\/code><\/pre>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u3067\u306f\u7d30\u304b\u3044\u3068\u3053\u308d\u3067\u4f59\u8a08\u306a\u3053\u3068\u3092\u3057\u3066\u3044\u308b\u304c\u3001\u30e1\u30a4\u30f3\u306fgetHandleFromName\u3068getBaseAddress\u306e2\u3064\u3060\u3068\u601d\u3063\u3066\u304f\u308c\u3002<br \/>\n\u5b9f\u969b\u306b\u30e1\u30e2\u30ea\u30a2\u30c9\u30ec\u30b9\u3092\u6307\u5b9a\u3057\u3066\u3076\u3063\u3053\u629c\u304f\u306e\u306fReadProcessMemory\u95a2\u6570\u3092\u4f7f\u3046\u308f\u3051\u3060\u304c\u3001\u3053\u308c\u3082\u8abf\u3079\u308a\u3083\u3044\u304f\u3089\u3067\u3082\u51fa\u308b\u306e\u3067\u7701\u7565\u3002<br \/>\n\u3068\u3082\u304b\u304f\u3053\u3093\u306a\u611f\u3058\u3067\u30e1\u30e2\u30ea\u304c\u629c\u3051\u308b\u3002<\/p>\n<h2>\u7dcf\u62ec<\/h2>\n<p>ASLR\u306f\u30af\u30bd<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30e1\u30e2\u30ea\u3092\u76e3\u8996\u3059\u308b \u3082\u304f\u3066\u304d \u30b2\u30fc\u30e0\u306eHP\u3068\u304b\u3092\u76e3\u8996\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u308b\u3002 \u4eca\u56de\u306f &hellip; <a href=\"https:\/\/drroot.page\/wp\/?p=222\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-222","post","type-post","status-publish","format-standard","hentry","category-it"],"_links":{"self":[{"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=\/wp\/v2\/posts\/222","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=222"}],"version-history":[{"count":1,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=\/wp\/v2\/posts\/222\/revisions"}],"predecessor-version":[{"id":225,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=\/wp\/v2\/posts\/222\/revisions\/225"}],"wp:attachment":[{"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/drroot.page\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}