{"action":"closed","issue":{"url":"https://api.github.com/repos/yufengzjj/PoCUltraISOKeyGen/issues/1","repository_url":"https://api.github.com/repos/yufengzjj/PoCUltraISOKeyGen","labels_url":"https://api.github.com/repos/yufengzjj/PoCUltraISOKeyGen/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/yufengzjj/PoCUltraISOKeyGen/issues/1/comments","events_url":"https://api.github.com/repos/yufengzjj/PoCUltraISOKeyGen/issues/1/events","html_url":"https://github.com/yufengzjj/PoCUltraISOKeyGen/issues/1","id":181337429,"number":1,"title":"关于源码的几个问题","user":{"login":"rexdf","id":4038241,"avatar_url":"https://avatars.githubusercontent.com/u/4038241?v=3","gravatar_id":"","url":"https://api.github.com/users/rexdf","html_url":"https://github.com/rexdf","followers_url":"https://api.github.com/users/rexdf/followers","following_url":"https://api.github.com/users/rexdf/following{/other_user}","gists_url":"https://api.github.com/users/rexdf/gists{/gist_id}","starred_url":"https://api.github.com/users/rexdf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rexdf/subscriptions","organizations_url":"https://api.github.com/users/rexdf/orgs","repos_url":"https://api.github.com/users/rexdf/repos","events_url":"https://api.github.com/users/rexdf/events{/privacy}","received_events_url":"https://api.github.com/users/rexdf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-10-06T06:53:17Z","updated_at":"2016-10-13T09:19:34Z","closed_at":"2016-10-13T09:19:34Z","body":"我是用的CUDA8.0，VS2015(没装Intel Compiler)，因为发现你的gmp库里面有BMI2指令mulx，这是一条Haswell的指令，我的CPU不支持这条指令。所以我重新用VS编译了gmp等库。\r\n\r\n虽然我自己的编译版本算出来的都是错误的注册码，但是发现如果算出一个注册码之后如果继续跑，从第二个开始，不是位数对不上，就是出现乱码符号如下：\r\n```\r\nREGISTRATION CODE:4aa9d2ef8f5b5634\r\nREGISTRATION CODE:dddb265f4a8b442\r\nREGISTRATION CODE:1494e68e961ca6c2€\r\nREGISTRATION CODE:712a1887a8c1ca4a€\r\n```\r\n\r\n1.对于那个gmp库的几个问题。\r\n1)mpz_get_str(reinterpret_cast<char *>(&msg[len]), 16, m);如何返回大写的？\r\n我算出了很多都是小写的。\r\n根据 https://gmplib.org/manual/Converting-Integers.html 这个上面的说法，16应该返回小写才对。是不是你在gmp库上面做过什么特殊修改？\r\n\r\n2.校验器的问题\r\n1)校验器我也是完全用VS编译了opensll以及源码，校验52pojie上的注册码是正确的。而我自己算出来的10多组全部不对。\r\n2)貌似著名的王姓中文注册码校验对不上。不知道是不是编码方面的问题。\r\n\r\n3.代码修改的部分\r\n除了修改gmp的头文件，链接库。还修改了如下的几个地方。不修改，貌似编译通不过。\r\n第一处是std::chrono::system_clock::time_poin与std::chrono::steady_clock::time_point类型不同不能相减。不知道有没有利用这里的某些未定义行为。\r\n\r\n第二处修改是unsigned自动转换为int会被vs2015认为是narrowing conversion，直接编译报错。我把int的几个定义都改为unsigned了。不知道源代码是否利用了这里的，unsigned转int的溢出处理的未定义行为？\r\n\r\n\r\n```\r\n--- a/PoCUtraISOKeyGen/TimeProbe.cpp\r\n+++ b/PoCUtraISOKeyGen/TimeProbe.cpp\r\n@@ -25,7 +25,7 @@ void TimeProbe::tick_start(std::string probe_name)\r\n void TimeProbe::tick_stop(std::string probe_name)\r\n {\r\n     m_mtx.lock();\r\n-    std::chrono::system_clock::time_point t = std::chrono::system_clock::now();\r\n+    std::chrono::steady_clock::time_point t = std::chrono::steady_clock::now();\r\n     if (m_ticker.find(probe_name) != m_ticker.end())\r\n     {\r\n         if (std::get<3>(m_ticker[probe_name]) == Status::started)\r\n--- a/PoCUtraISOKeyGen/Helper.cpp\r\n+++ b/PoCUtraISOKeyGen/Helper.cpp\r\n@@ -1,9 +1,9 @@\r\n #include \"Helper.h\"\r\n \r\n \r\n-Helper::factor Helper::factoring(int num, int max_factor_b)\r\n+Helper::factor Helper::factoring(unsigned num, unsigned max_factor_b)\r\n {\r\n-    int factor_a = 1, factor_b = 1;\r\n+    unsigned factor_a = 1, factor_b = 1;\r\n     while (factor_a * factor_b != num)\r\n     {\r\n         if (num%factor_a != 0)\r\ndiff --git a/PoCUtraISOKeyGen/Helper.h b/PoCUtraISOKeyGen/Helper.h\r\nindex 3d070d0..dafd2eb 100644\r\n--- a/PoCUtraISOKeyGen/Helper.h\r\n+++ b/PoCUtraISOKeyGen/Helper.h\r\n@@ -4,15 +4,15 @@ class Helper\r\n public:\r\n     struct factor\r\n     {\r\n-        int a;\r\n-        int b;\r\n+        unsigned a;\r\n+        unsigned b;\r\n     };\r\n \r\n     /*\r\n     * always return the minimum factor_a and the maximum under\r\n     * max_factor_b.\r\n     * */\r\n-    static factor factoring(int num, int max_factor_b);\r\n+    static factor factoring(unsigned num, unsigned max_factor_b);\r\n     Helper();\r\n     ~Helper();\r\n };\r\n```\r\n\r\n4.关于那些常数\r\n好多奇怪的常数啊，有几页那么多啊，怎么生成的…… 只是吐槽下"}}
{"actor":{"display_login":"rexdf"}}