したらばTOP ■掲示板に戻る■ 全部 1-100 最新50 | メール | |

管理人の独り言(プログラミング関連)

1みみず★:2008/08/10(日) 23:28:15
あまりにもプログラミングの内容が増えすぎた。
よって隔離スレの中を更に隔離。

113 ◆rCEzuNnL0g:2008/08/29(金) 22:08:45
ぐわああああああああああああああ
もう、逆アセンブリ読むの疲れた。
明日のために寝ます(`・ω・´) シャキーン

114 ◆rCEzuNnL0g:2008/08/29(金) 22:21:05
CPU Disasm
Address Hex dump Command Comments
0046854D |. 51 PUSH ECX
0046854E |. 50 PUSH EAX
0046854F |. FF52 30 CALL DWORD PTR DS:[EDX+30]
00468552 |. 8B47 18 MOV EAX,DWORD PTR DS:[EDI+18]
00468555 |. 8B0428 MOV EAX,DWORD PTR DS:[EBP+EAX]
00468558 |. 8B08 MOV ECX,DWORD PTR DS:[EAX]
0046855A |. 50 PUSH EAX
0046855B |. FF51 1C CALL DWORD PTR DS:[ECX+1C] ←ここでアクション用の関数呼び出し(引数あり)
0046855E |. 8B57 18 MOV EDX,DWORD PTR DS:[EDI+18]
00468561 |. 8B042A MOV EAX,DWORD PTR DS:[EBP+EDX]
00468564 |. 8B08 MOV ECX,DWORD PTR DS:[EAX]
00468566 |. 68 5CDD4100 PUSH Sleipnir.0041DD5C
0046856B |. 50 PUSH EAX
0046856C |. FF51 30 CALL DWORD PTR DS:[ECX+30]
0046856F |. EB 0C JMP SHORT 0046857D
00468571 |> 8B57 18 MOV EDX,DWORD PTR DS:[EDI+18] ←ここでアクション用の関数呼び出し(引数なし)
00468574 |. 8B042A MOV EAX,DWORD PTR DS:[EBP+EDX]
00468577 |. 8B08 MOV ECX,DWORD PTR DS:[EAX]
00468579 |. 50 PUSH EAX
0046857A |. FF51 1C CALL DWORD PTR DS:[ECX+1C]
0046857D |> 897424 34 MOV DWORD PTR SS:[ESP+34],ESI
00468581 |. FF15 74104000 CALL DWORD PTR DS:[<&FenrirLib_fx.?FfxGetClient@@YGPAVFI

115 ◆rCEzuNnL0g:2008/08/29(金) 22:21:57
>>114は間違え
CPU Disasm
Address Hex dump Command Comments
0046854D |. 51 PUSH ECX
0046854E |. 50 PUSH EAX
0046854F |. FF52 30 CALL DWORD PTR DS:[EDX+30]
00468552 |. 8B47 18 MOV EAX,DWORD PTR DS:[EDI+18]
00468555 |. 8B0428 MOV EAX,DWORD PTR DS:[EBP+EAX]
00468558 |. 8B08 MOV ECX,DWORD PTR DS:[EAX]
0046855A |. 50 PUSH EAX
0046855B |. FF51 1C CALL DWORD PTR DS:[ECX+1C] ←ここでアクション用の関数呼び出し(引数あり)
0046855E |. 8B57 18 MOV EDX,DWORD PTR DS:[EDI+18]
00468561 |. 8B042A MOV EAX,DWORD PTR DS:[EBP+EDX]
00468564 |. 8B08 MOV ECX,DWORD PTR DS:[EAX]
00468566 |. 68 5CDD4100 PUSH Sleipnir.0041DD5C
0046856B |. 50 PUSH EAX
0046856C |. FF51 30 CALL DWORD PTR DS:[ECX+30]
0046856F |. EB 0C JMP SHORT 0046857D
00468571 |> 8B57 18 MOV EDX,DWORD PTR DS:[EDI+18]
00468574 |. 8B042A MOV EAX,DWORD PTR DS:[EBP+EDX]
00468577 |. 8B08 MOV ECX,DWORD PTR DS:[EAX]
00468579 |. 50 PUSH EAX
0046857A |. FF51 1C CALL DWORD PTR DS:[ECX+1C] ←ここでアクション用の関数呼び出し(引数なし)
0046857D |> 897424 34 MOV DWORD PTR SS:[ESP+34],ESI
00468581 |. FF15 74104000 CALL DWORD PTR DS:[<&FenrirLib_fx.?FfxGetClient@@YGPAVFI

116 ◆rCEzuNnL0g:2008/08/29(金) 22:27:16
ECXが0の時が引数なしみたい。
さて、何処でECXが来るのか。

117 ◆rCEzuNnL0g:2008/08/29(金) 22:38:51
どうやら
Action(Param)
のActionとParamを切り分ける関数があるらしい。
で、その関数へポインタへのポインタを渡して、そこにAction名とParamへのポインタを代入して貰う。
そのときに、Paramが存在しないならば、ParamへのポインタはNULLになる。
よってECXはその値を持ってくるので(ry
ということである。
さて、またアセンブリを読んでしまった。

118 ◆rCEzuNnL0g:2008/08/29(金) 22:44:11
今度こそ本当に寝よう。
(`・ω・´) シャキーン

119 ◆rCEzuNnL0g:2008/08/30(土) 15:37:42
mapと__noSuchMethod__(失敗) - 素人がプログラミングを勉強するブログ
http://d.hatena.ne.jp/javascripter/20080830/1220071227
-----
__noSuchMethod__って凄いなあ。ソースに直接書いたものを文字列をして得られる。

120 ◆rCEzuNnL0g:2008/08/30(土) 16:31:12
??_7系はヴァーチャルポインタですかねえ。
取り敢えず、自分でdllをエクスポートしてみる。

121 ◆rCEzuNnL0g:2008/08/30(土) 17:03:26
main.obj : error LNK2019: 未解決の外部シンボル "__declspec(dllimport) public: char const * __thiscall CSuper::GetStr(void)" (__imp_?GetStr@CSuper@@QAEPBDXZ) が関数 _main で参照されました。
main.obj : error LNK2019: 未解決の外部シンボル "__declspec(dllimport) public: int __thiscall CSuper::GetLength(void)" (__imp_?GetLength@CSuper@@QAEHXZ) が関数 _main で参照されました。

122 ◆rCEzuNnL0g:2008/08/30(土) 17:05:29
main.obj : error LNK2019: 未解決の外部シンボル "__declspec(dllimport) public: char * __thiscall CSuper::GetStr(void)" (__imp_?GetStr@CSuper@@QAEPADXZ) が関数 _main で参照されました。
main.obj : error LNK2019: 未解決の外部シンボル "__declspec(dllimport) public: int __thiscall CSuper::GetLength(char *)" (__imp_?GetLength@CSuper@@QAEHPAD@Z) が関数 _main で参照されました。

123 ◆rCEzuNnL0g:2008/08/30(土) 17:08:41
const char *CSuper::GetStr()
-> __imp_?GetStr@CSuper@@QAEPBDXZ
char *CSuper::GetStr()
-> __imp_?GetStr@CSuper@@QAEPADXZ
-----
int CSuper::GetLength()
-> __imp_?GetLength@CSuper@@QAEHXZ
int CSuper::GetLength()
-> __imp_?GetLength@CSuper@@QAEHPAD@Z

124 ◆rCEzuNnL0g:2008/08/30(土) 17:20:06
__imp_?Get@CSuper@@QAEXXZ <- void void
__imp_?Get@CSuper@@QAEHXZ <- int void
__imp_?Get@CSuper@@QAEFXZ <- short void
__imp_?Get@CSuper@@QAEJXZ <- long void
__imp_?Get@CSuper@@QAEDXZ <- char void
__imp_?Get@CSuper@@QAEMXZ <- float void
__imp_?Get@CSuper@@QAENXZ <- double void
__imp_?Get@CSuper@@QAEOXZ <- long double void
__imp_?Get@CSuper@@QAEPAXXZ <- void* void
__imp_?Get@CSuper@@QAEPAHXZ <- int* void
__imp_?Get@CSuper@@QAEPADXZ <- char* void
__imp_?Get@CSuper@@QAEPAMXZ <- float* void
__imp_?Get@CSuper@@QAEPANXZ <- double* void
__imp_?Get@CSuper@@QAEPAOXZ <- long double* void

返却値については、規則性が見えるなあ。

125 ◆rCEzuNnL0g:2008/08/30(土) 17:24:15
__imp_?Get@CSuper@@QAEIXZ <- unsigned int void
__imp_?Get@CSuper@@QAEEXZ <- unsigned char void

此れやってて気づいたんだけれども、unsignedは実数系には付けれない。
此れ基本事項だよねwww

126 ◆rCEzuNnL0g:2008/08/30(土) 17:32:25
__imp_?Get@CSuper@@QAEXXZ <- void void
__imp_?Get@CSuper@@QAEHXZ <- int void
__imp_?Get@CSuper@@QAEFXZ <- short void
__imp_?Get@CSuper@@QAEJXZ <- long void
__imp_?Get@CSuper@@QAEDXZ <- char void
__imp_?Get@CSuper@@QAEMXZ <- float void
__imp_?Get@CSuper@@QAENXZ <- double void
__imp_?Get@CSuper@@QAEOXZ <- long double void
__imp_?Get@CSuper@@QAEPAXXZ <- void* void
__imp_?Get@CSuper@@QAEPAHXZ <- int* void
__imp_?Get@CSuper@@QAEPADXZ <- char* void
__imp_?Get@CSuper@@QAEPAMXZ <- float* void
__imp_?Get@CSuper@@QAEPANXZ <- double* void
__imp_?Get@CSuper@@QAEPAOXZ <- long double* void
__imp_?Get@CSuper@@QAEAAHXZ <- int& void
__imp_?Get@CSuper@@QAEAADXZ <- char& void
__imp_?Get@CSuper@@QAEAAMXZ <- float& void
__imp_?Get@CSuper@@QAEAANXZ <- double& void
__imp_?Get@CSuper@@QAEAAOXZ <- long double& void

__imp_?Get@CSuper@@QAEIXZ <- unsigned int void
__imp_?Get@CSuper@@QAEEXZ <- unsigned char void
__imp_?Get@CSuper@@QAEPAIXZ <- unsigned int* void
__imp_?Get@CSuper@@QAEPAEXZ <- unsigned char* void
__imp_?Get@CSuper@@QAEAAIXZ <- unsigned int& void
__imp_?Get@CSuper@@QAEAAEXZ <- unsigned char& void

__imp_?Get@CSuper@@QAE?AV1@XZ <- CSuper void
__imp_?Get@CSuper@@QAEPAV1@XZ <- CSuper* void
__imp_?Get@CSuper@@QAEAAV1@XZ <- CSuper& void

127 ◆rCEzuNnL0g:2008/08/30(土) 17:37:37
__imp_?Get@CSuper@@QAEXXZ <- void | void
__imp_?Get@CSuper@@QAEHXZ <- int | void
__imp_?Get@CSuper@@QAEFXZ <- short | void
__imp_?Get@CSuper@@QAEJXZ <- long | void
__imp_?Get@CSuper@@QAEDXZ <- char | void
__imp_?Get@CSuper@@QAEMXZ <- float | void
__imp_?Get@CSuper@@QAENXZ <- double | void
__imp_?Get@CSuper@@QAEOXZ <- long double | void
__imp_?Get@CSuper@@QAEPAXXZ <- void* | void
__imp_?Get@CSuper@@QAEPAHXZ <- int* | void
__imp_?Get@CSuper@@QAEPADXZ <- char* | void
__imp_?Get@CSuper@@QAEPAMXZ <- float* | void
__imp_?Get@CSuper@@QAEPANXZ <- double* | void
__imp_?Get@CSuper@@QAEPAOXZ <- long double* | void
__imp_?Get@CSuper@@QAEAAHXZ <- int& | void
__imp_?Get@CSuper@@QAEAADXZ <- char& | void
__imp_?Get@CSuper@@QAEAAMXZ <- float& | void
__imp_?Get@CSuper@@QAEAANXZ <- double& | void
__imp_?Get@CSuper@@QAEAAOXZ <- long double& | void

__imp_?Get@CSuper@@QAEIXZ <- unsigned int | void
__imp_?Get@CSuper@@QAEEXZ <- unsigned char | void
__imp_?Get@CSuper@@QAEPAIXZ <- unsigned int* | void
__imp_?Get@CSuper@@QAEPAEXZ <- unsigned char* | void
__imp_?Get@CSuper@@QAEAAIXZ <- unsigned int& | void
__imp_?Get@CSuper@@QAEAAEXZ <- unsigned char& | void

__imp_?Get@CSuper@@QAE?AV1@XZ <- CSuper | void
__imp_?Get@CSuper@@QAEPAV1@XZ <- CSuper* | void
__imp_?Get@CSuper@@QAEAAV1@XZ <- CSuper& | void

__imp_?Get@CSuper@@QAE?BHXZ <- const int | void
__imp_?Get@CSuper@@QAE?BDXZ <- const char | void
__imp_?Get@CSuper@@QAEPBHXZ <- const int* | void
__imp_?Get@CSuper@@QAEPBDXZ <- const char* | void
__imp_?Get@CSuper@@QAEQAHXZ <- int* const | void
__imp_?Get@CSuper@@QAEQADXZ <- char* const | void

128 ◆rCEzuNnL0g:2008/08/30(土) 17:40:46
__imp_?Get@CSuper@@QAEXXZ <- void | void
__imp_?Get@CSuper@@QAEHXZ <- int | void
__imp_?Get@CSuper@@QAEFXZ <- short | void
__imp_?Get@CSuper@@QAEJXZ <- long | void
__imp_?Get@CSuper@@QAEDXZ <- char | void
__imp_?Get@CSuper@@QAEMXZ <- float | void
__imp_?Get@CSuper@@QAENXZ <- double | void
__imp_?Get@CSuper@@QAEOXZ <- long double | void
__imp_?Get@CSuper@@QAEPAXXZ <- void* | void
__imp_?Get@CSuper@@QAEPAHXZ <- int* | void
__imp_?Get@CSuper@@QAEPADXZ <- char* | void
__imp_?Get@CSuper@@QAEPAMXZ <- float* | void
__imp_?Get@CSuper@@QAEPANXZ <- double* | void
__imp_?Get@CSuper@@QAEPAOXZ <- long double* | void
__imp_?Get@CSuper@@QAEAAHXZ <- int& | void
__imp_?Get@CSuper@@QAEAADXZ <- char& | void
__imp_?Get@CSuper@@QAEAAMXZ <- float& | void
__imp_?Get@CSuper@@QAEAANXZ <- double& | void
__imp_?Get@CSuper@@QAEAAOXZ <- long double& | void

__imp_?Get@CSuper@@QAEIXZ <- unsigned int | void
__imp_?Get@CSuper@@QAEEXZ <- unsigned char | void
__imp_?Get@CSuper@@QAEPAIXZ <- unsigned int* | void
__imp_?Get@CSuper@@QAEPAEXZ <- unsigned char* | void
__imp_?Get@CSuper@@QAEAAIXZ <- unsigned int& | void
__imp_?Get@CSuper@@QAEAAEXZ <- unsigned char& | void

__imp_?Get@CSuper@@QAE?AV1@XZ <- CSuper | void
__imp_?Get@CSuper@@QAEPAV1@XZ <- CSuper* | void
__imp_?Get@CSuper@@QAEAAV1@XZ <- CSuper& | void

__imp_?Get@CSuper@@QAE?BHXZ <- const int | void
__imp_?Get@CSuper@@QAE?BDXZ <- const char | void
__imp_?Get@CSuper@@QAEPBHXZ <- const int* | void
__imp_?Get@CSuper@@QAEPBDXZ <- const char* | void
__imp_?Get@CSuper@@QAEABHXZ <- const int& | void
__imp_?Get@CSuper@@QAEABDXZ <- const char& | void
__imp_?Get@CSuper@@QAEQAHXZ <- int* const | void
__imp_?Get@CSuper@@QAEQADXZ <- char* const | void
__imp_?Get@CSuper@@QAEQBHXZ <- const int* const | void
__imp_?Get@CSuper@@QAEQBDXZ <- const char* cont | void

129 ◆rCEzuNnL0g:2008/08/30(土) 17:47:16
__imp_?Get@CSuper@@QAEXXZ <- void | void
__imp_?Get@CSuper@@QAEHXZ <- int | void
__imp_?Get@CSuper@@QAEFXZ <- short | void
__imp_?Get@CSuper@@QAEJXZ <- long | void
__imp_?Get@CSuper@@QAEDXZ <- char | void
__imp_?Get@CSuper@@QAEMXZ <- float | void
__imp_?Get@CSuper@@QAENXZ <- double | void
__imp_?Get@CSuper@@QAEOXZ <- long double | void
__imp_?Get@CSuper@@QAEPAXXZ <- void* | void
__imp_?Get@CSuper@@QAEPAHXZ <- int* | void
__imp_?Get@CSuper@@QAEPADXZ <- char* | void
__imp_?Get@CSuper@@QAEPAMXZ <- float* | void
__imp_?Get@CSuper@@QAEPANXZ <- double* | void
__imp_?Get@CSuper@@QAEPAOXZ <- long double* | void
__imp_?Get@CSuper@@QAEAAHXZ <- int& | void
__imp_?Get@CSuper@@QAEAADXZ <- char& | void
__imp_?Get@CSuper@@QAEAAMXZ <- float& | void
__imp_?Get@CSuper@@QAEAANXZ <- double& | void
__imp_?Get@CSuper@@QAEAAOXZ <- long double& | void

__imp_?Get@CSuper@@QAEIXZ <- unsigned int | void
__imp_?Get@CSuper@@QAEEXZ <- unsigned char | void
__imp_?Get@CSuper@@QAEPAIXZ <- unsigned int* | void
__imp_?Get@CSuper@@QAEPAEXZ <- unsigned char* | void
__imp_?Get@CSuper@@QAEAAIXZ <- unsigned int& | void
__imp_?Get@CSuper@@QAEAAEXZ <- unsigned char& | void

__imp_?Get@CSuper@@QAE?AV1@XZ <- CSuper | void
__imp_?Get@CSuper@@QAEPAV1@XZ <- CSuper* | void
__imp_?Get@CSuper@@QAEAAV1@XZ <- CSuper& | void

__imp_?Get@CSuper@@QAE?BHXZ <- const int | void
__imp_?Get@CSuper@@QAE?BDXZ <- const char | void
__imp_?Get@CSuper@@QAEPBHXZ <- const int* | void
__imp_?Get@CSuper@@QAEPBDXZ <- const char* | void
__imp_?Get@CSuper@@QAEABHXZ <- const int& | void
__imp_?Get@CSuper@@QAEABDXZ <- const char& | void
__imp_?Get@CSuper@@QAEQAHXZ <- int* const | void
__imp_?Get@CSuper@@QAEQADXZ <- char* const | void
__imp_?Get@CSuper@@QAEQBHXZ <- const int* const | void
__imp_?Get@CSuper@@QAEQBDXZ <- const char* cont | void

__imp_?Get@CSuper@@QAEPAPADXZ <- char** | void
__imp_?Get@CSuper@@QAEPAPBDXZ <- const char** | void
__imp_?Get@CSuper@@QAEPBQADXZ <- char* const* | void
__imp_?Get@CSuper@@QAEQAPADXZ <- char** const | void
__imp_?Get@CSuper@@QAEPBQBDXZ <- const char* const* | void
__imp_?Get@CSuper@@QAEQAPBDXZ <- const char** const | void
__imp_?Get@CSuper@@QAEQBQADXZ <- char* const* const | void
__imp_?Get@CSuper@@QAEQBQBDXZ <- const char* const* const | void

130 ◆rCEzuNnL0g:2008/08/30(土) 17:53:12
__imp_?Get@CSuper@@QAEXXZ <- void | void
__imp_?Get@CSuper@@QAEHXZ <- int | void
__imp_?Get@CSuper@@QAEFXZ <- short | void
__imp_?Get@CSuper@@QAEJXZ <- long | void
__imp_?Get@CSuper@@QAEDXZ <- char | void
__imp_?Get@CSuper@@QAEMXZ <- float | void
__imp_?Get@CSuper@@QAENXZ <- double | void
__imp_?Get@CSuper@@QAEOXZ <- long double | void
__imp_?Get@CSuper@@QAEPAXXZ <- void* | void
__imp_?Get@CSuper@@QAEPAHXZ <- int* | void
__imp_?Get@CSuper@@QAEPADXZ <- char* | void
__imp_?Get@CSuper@@QAEPAMXZ <- float* | void
__imp_?Get@CSuper@@QAEPANXZ <- double* | void
__imp_?Get@CSuper@@QAEPAOXZ <- long double* | void
__imp_?Get@CSuper@@QAEAAHXZ <- int& | void
__imp_?Get@CSuper@@QAEAADXZ <- char& | void
__imp_?Get@CSuper@@QAEAAMXZ <- float& | void
__imp_?Get@CSuper@@QAEAANXZ <- double& | void
__imp_?Get@CSuper@@QAEAAOXZ <- long double& | void

__imp_?Get@CSuper@@QAEIXZ <- unsigned int | void
__imp_?Get@CSuper@@QAEEXZ <- unsigned char | void
__imp_?Get@CSuper@@QAEPAIXZ <- unsigned int* | void
__imp_?Get@CSuper@@QAEPAEXZ <- unsigned char* | void
__imp_?Get@CSuper@@QAEAAIXZ <- unsigned int& | void
__imp_?Get@CSuper@@QAEAAEXZ <- unsigned char& | void

__imp_?Get@CSuper@@QAE?AV1@XZ <- CSuper | void
__imp_?Get@CSuper@@QAEPAV1@XZ <- CSuper* | void
__imp_?Get@CSuper@@QAEAAV1@XZ <- CSuper& | void

__imp_?Get@CSuper@@QAE?BHXZ <- const int | void
__imp_?Get@CSuper@@QAE?BDXZ <- const char | void
__imp_?Get@CSuper@@QAEPBHXZ <- const int* | void
__imp_?Get@CSuper@@QAEPBDXZ <- const char* | void
__imp_?Get@CSuper@@QAEABHXZ <- const int& | void
__imp_?Get@CSuper@@QAEABDXZ <- const char& | void
__imp_?Get@CSuper@@QAEQAHXZ <- int* const | void
__imp_?Get@CSuper@@QAEQADXZ <- char* const | void
__imp_?Get@CSuper@@QAEQBHXZ <- const int* const | void
__imp_?Get@CSuper@@QAEQBDXZ <- const char* cont | void

__imp_?Get@CSuper@@QAEPAPADXZ <- char** | void
__imp_?Get@CSuper@@QAEPAPBDXZ <- const char** | void
__imp_?Get@CSuper@@QAEPBQADXZ <- char* const* | void
__imp_?Get@CSuper@@QAEQAPADXZ <- char** const | void
__imp_?Get@CSuper@@QAEPBQBDXZ <- const char* const* | void
__imp_?Get@CSuper@@QAEQAPBDXZ <- const char** const | void
__imp_?Get@CSuper@@QAEQBQADXZ <- char* const* const | void
__imp_?Get@CSuper@@QAEQBQBDXZ <- const char* const* const | void

__imp_?Get@CSuper@@QAEPAPAPADXZ <- char*** | void
__imp_?Get@CSuper@@QAEPAPAPAPADXZ <- char**** | void
__imp_?Get@CSuper@@QAEPAPAPAPAPADXZ <- char***** | void

__imp_?Get@CSuper@@QAEAAPADXZ <- char*& | void
__imp_?Get@CSuper@@QAEAAPBDXZ <- const char*& | void
__imp_?Get@CSuper@@QAEABQADXZ <- char* const& | void

__imp_?Get@CSuper@@QAEAAPAPADXZ <- char**& | void

131 ◆rCEzuNnL0g:2008/08/30(土) 17:55:01
後で詳しく調べる。
-----------------------------------------
__imp_?Get@CSuper@@QAEXXZ <- void | void
__imp_?Get@CSuper@@QAEHXZ <- int | void
__imp_?Get@CSuper@@QAEFXZ <- short | void
__imp_?Get@CSuper@@QAEJXZ <- long | void
__imp_?Get@CSuper@@QAEDXZ <- char | void
__imp_?Get@CSuper@@QAEMXZ <- float | void
__imp_?Get@CSuper@@QAENXZ <- double | void
__imp_?Get@CSuper@@QAEOXZ <- long double | void
__imp_?Get@CSuper@@QAEPAXXZ <- void* | void
__imp_?Get@CSuper@@QAEPAHXZ <- int* | void
__imp_?Get@CSuper@@QAEPADXZ <- char* | void
__imp_?Get@CSuper@@QAEPAMXZ <- float* | void
__imp_?Get@CSuper@@QAEPANXZ <- double* | void
__imp_?Get@CSuper@@QAEPAOXZ <- long double* | void
__imp_?Get@CSuper@@QAEAAHXZ <- int& | void
__imp_?Get@CSuper@@QAEAADXZ <- char& | void
__imp_?Get@CSuper@@QAEAAMXZ <- float& | void
__imp_?Get@CSuper@@QAEAANXZ <- double& | void
__imp_?Get@CSuper@@QAEAAOXZ <- long double& | void

__imp_?Get@CSuper@@QAEIXZ <- unsigned int | void
__imp_?Get@CSuper@@QAEEXZ <- unsigned char | void
__imp_?Get@CSuper@@QAEPAIXZ <- unsigned int* | void
__imp_?Get@CSuper@@QAEPAEXZ <- unsigned char* | void
__imp_?Get@CSuper@@QAEAAIXZ <- unsigned int& | void
__imp_?Get@CSuper@@QAEAAEXZ <- unsigned char& | void

__imp_?Get@CSuper@@QAE?AV1@XZ <- CSuper | void
__imp_?Get@CSuper@@QAEPAV1@XZ <- CSuper* | void
__imp_?Get@CSuper@@QAEAAV1@XZ <- CSuper& | void

__imp_?Get@CSuper@@QAE?BHXZ <- const int | void
__imp_?Get@CSuper@@QAE?BDXZ <- const char | void
__imp_?Get@CSuper@@QAEPBHXZ <- const int* | void
__imp_?Get@CSuper@@QAEPBDXZ <- const char* | void
__imp_?Get@CSuper@@QAEABHXZ <- const int& | void
__imp_?Get@CSuper@@QAEABDXZ <- const char& | void
__imp_?Get@CSuper@@QAEQAHXZ <- int* const | void
__imp_?Get@CSuper@@QAEQADXZ <- char* const | void
__imp_?Get@CSuper@@QAEQBHXZ <- const int* const | void
__imp_?Get@CSuper@@QAEQBDXZ <- const char* cont | void

__imp_?Get@CSuper@@QAEPAPADXZ <- char** | void
__imp_?Get@CSuper@@QAEPAPBDXZ <- const char** | void
__imp_?Get@CSuper@@QAEPBQADXZ <- char* const* | void
__imp_?Get@CSuper@@QAEQAPADXZ <- char** const | void
__imp_?Get@CSuper@@QAEPBQBDXZ <- const char* const* | void
__imp_?Get@CSuper@@QAEQAPBDXZ <- const char** const | void
__imp_?Get@CSuper@@QAEQBQADXZ <- char* const* const | void
__imp_?Get@CSuper@@QAEQBQBDXZ <- const char* const* const | void

__imp_?Get@CSuper@@QAEPAPAPADXZ <- char*** | void
__imp_?Get@CSuper@@QAEPAPAPAPADXZ <- char**** | void
__imp_?Get@CSuper@@QAEPAPAPAPAPADXZ <- char***** | void

__imp_?Get@CSuper@@QAEAAPADXZ <- char*& | void
__imp_?Get@CSuper@@QAEAAPBDXZ <- const char*& | void
__imp_?Get@CSuper@@QAEABQADXZ <- char* const& | void

__imp_?Get@CSuper@@QAEAAPAPADXZ <- char**& | void

132 ◆rCEzuNnL0g:2008/08/30(土) 18:07:58
void | const int == void | int

133 ◆rCEzuNnL0g:2008/08/30(土) 18:12:53
後で詳しく調べる。
-----------------------------------------
__imp_?Get@CSuper@@QAEXXZ <- void | void
__imp_?Get@CSuper@@QAEXH@Z <- void | int
__imp_?Get@CSuper@@QAEXF@Z <- void | short
__imp_?Get@CSuper@@QAEXJ@Z <- void | long
__imp_?Get@CSuper@@QAEXD@Z <- void | char
__imp_?Get@CSuper@@QAEXM@Z <- void | float
__imp_?Get@CSuper@@QAEXN@Z <- void | double
__imp_?Get@CSuper@@QAEXO@Z <- void | long double

__imp_?Get@CSuper@@QAEXI@Z <- void | unsigned int
__imp_?Get@CSuper@@QAEXE@Z <- void | unsigned char

__imp_?Get@CSuper@@QAEXPAX@Z <- void | void*
__imp_?Get@CSuper@@QAEXPAH@Z <- void | int*
__imp_?Get@CSuper@@QAEXPAD@Z <- void | char*
__imp_?Get@CSuper@@QAEXPAM@Z <- void | float*
__imp_?Get@CSuper@@QAEXPAN@Z <- void | double*
__imp_?Get@CSuper@@QAEXPAO@Z <- void | long double*

__imp_?Get@CSuper@@QAEXAAH@Z <- void | int&
__imp_?Get@CSuper@@QAEXAAD@Z <- void | char&

__imp_?Get@CSuper@@QAEXPBD@Z <- void | const char*
__imp_?Get@CSuper@@QAEXQAD@Z <- void | char* const
__imp_?Get@CSuper@@QAEXQBD@Z <- void | const char* const

__imp_?Get@CSuper@@QAEXPAPAD@Z <- void | char**

134 ◆rCEzuNnL0g:2008/08/30(土) 19:12:06
その他、適当
-----------------------------------------
__imp_?Get@CSuper@@QAEXXZ <- void | void
__imp_?Get@CSuper@@QAEP6AXXZXZ <- void (__cdecl *)() | void
__imp_?Get@CSuper@@QAEP6GXXZXZ <- void (__stdcall *)() | void
__imp_?Get@CSuper@@QAEP6IXXZXZ <- void (__fastcall *)() | void
__imp_?Get@CSuper@@QAEP6AHXZXZ <- int (__cdecl *)() | void
__imp_?Get@CSuper@@QAEP6ADXZXZ <- char (__cdecl *)() | void
__imp_?Get@CSuper@@QAEP6APAXXZXZ <- void* (__cdecl *)() | void
__imp_?Get@CSuper@@QAEP6APADXZXZ <- char* (__cdecl *)() | void

__imp_?Get@CSuper@@QAEP6AXH@ZXZ <- void (__cdecl *)(int) | void
__imp_?Get@CSuper@@QAEP6AXD@ZXZ <- void (__cdecl *)(char) | void
__imp_?Get@CSuper@@QAEP6AXPAD@ZXZ <- void (__cdecl *)(char*) | void

__imp_?Get@CSuper@@QAEP6AXPAX@Z0@Z <- void (__cedcl *)(void *) | void*
__imp_?Get@CSuper@@QAEP6AXPAX@ZH@Z <- void (__cedcl *)(void *) | int

__imp_?Get@CSuper@@QAEPAY00DXZ <- char (*)[1] | void
__imp_?Get@CSuper@@QAEPAY01DXZ <- char (*)[2] | void
__imp_?Get@CSuper@@QAEPAY09DXZ <- char (*)[10] | void
__imp_?Get@CSuper@@QAEPAY0L@DXZ <- char (*)[11] | void
__imp_?Get@CSuper@@QAEPAY0M@DXZ <- char (*)[12] | void
__imp_?Get@CSuper@@QAEPAY0N@DXZ <- char (*)[13] | void
__imp_?Get@CSuper@@QAEPAY0O@DXZ <- char (*)[14] | void
__imp_?Get@CSuper@@QAEPAY0P@DXZ <- char (*)[15] | void
__imp_?Get@CSuper@@QAEPAY0BA@DXZ <- char (*)[16] | void
__imp_?Get@CSuper@@QAEPAY0BP@DXZ <- char (*)[31] | void
__imp_?Get@CSuper@@QAEPAY0CA@DXZ <- char (*)[32] | void
__imp_?Get@CSuper@@QAEPAY00HXZ <- int (*)[1] | void
__imp_?Get@CSuper@@QAEPAY00PADXZ <- char *(*)[1] | void

135 ◆rCEzuNnL0g:2008/08/30(土) 19:35:42
__imp_?Get@CSuper@@QAEP6AP6AXXZXZXZ <- void (__cdecl *(__cdecl *)())() | void

__imp_?Get@CSuper@@QAEPAY09P6AXXZXZ <- void (__cdecl*(*)[10])() | void
__imp_?Get@CSuper@@QAEPAY09P6APAY09P6APAY09P6APAY09P6AXXZXZXZXZXZ <- void (__cdecl *(*(__cdecl *(*(__cdecl *(*(__cdecl *(*)[10])(void))[10])(void))[10])(void))[10])(void)

136 ◆rCEzuNnL0g:2008/08/30(土) 19:51:01
詳しく調べる
-----------------------------------------
__imp_?Get@CSuper@@QAEXXZ <- void | void
__imp_?Get@CSuper@@QAEXH@Z <- void | int
__imp_?Get@CSuper@@QAEXHH@Z <- void | int, int
__imp_?Get@CSuper@@QAEXHD@Z <- void | int, char
__imp_?Get@CSuper@@QAEXHPAHAAH@Z <- void | int, int*, int&
__imp_?Get@CSuper@@QAEXV1@PAV1@AAV1@@Z <- void | CSuper, CSuper*, CSuper&
__imp_?Get@CSub@@QAEXVCSuper@@PAV2@AAV2@@Z <- void | CSuper, CSuper*, CSuper&
__imp_?Get@CSub@@QAEXHVCSuper@@PAD@Z <- void | int, CSuper, char*

137 ◆rCEzuNnL0g:2008/08/30(土) 20:31:08
int Get();
__imp_?Get@@YAHXZ
namespace AA{
int Get()
}
__imp_?Get@AA@@YAHXZ

138 ◆rCEzuNnL0g:2008/08/30(土) 20:34:42
class CSuper{public: static int Get();};
__imp_?Get@CSuper@@SAHXZ

139 ◆rCEzuNnL0g:2008/08/30(土) 22:53:03
今までに分かっていること・・・
・??_7FButton@@6B@
 FButtonの為の`vftable'。(何処から継承しているかは不明、継承元は一つ)
・??_7FActionData@@6BFIActionData2@@@
・??_7FActionData@@6BFObject@@@
 FActionDataの為のFIActionData2の`vftable'。(継承元は二つ以上)
 FActionDataの為のFObjectの`vftable'。

140 ◆rCEzuNnL0g:2008/08/30(土) 22:55:37
>>139の上は継承していない場合もある。
つまり、継承していないか、一つから継承している。

141 ◆rCEzuNnL0g:2008/08/30(土) 22:58:28
__imp_??0CSub@@QAE@XZ <- コンストラクタ void
__imp_??0CSub@@QAE@PBD@Z <- コンストラクタ const char*

142 ◆rCEzuNnL0g:2008/08/30(土) 23:00:39
__imp_??0CSub@@QAE@ABV0@@Z <- コピーコンストラクタ

143 ◆rCEzuNnL0g:2008/08/30(土) 23:19:21
自前で、コンストラクタ、コピーコンストラクタ、デストラクタを実装してエクスポートした。
エクスポートしているものは以下。
??0CClass@@QAE@ABV0@@Z
??0CClass@@QAE@XZ <- コンストラクタ
??1CClass@@QAE@XZ <- デストラクタ
??4CClass@@QAEAAV0@ABV0@@Z <- コピーコンストラクタ
一番は何かなあ?
多分此れも、コピーコンストラクタだと思う。
何故かって言うと、
-----
CClass e;
CClass e1 = e; // コピーコンストラクタ!
-----
これはコピーコンストラクタだと分かる。
だから??4CClass@@QAEAAV0@ABV0@@Zを見に行く。
次に、
-----
CClass e;
CClass e1(e);
-----
の時。
此れはコピーコンストラクタが実際は呼び出されるのだが、恐らくコンパイラの扱いでは、
“const CClass &”が渡されるコンストラクタだと思うのだろう。だから
??0CClass@@QAE@ABV0@@Z
を見に行く。だから二つ必要。

144 ◆rCEzuNnL0g:2008/08/30(土) 23:21:18
因みに、OllyDbgでエクスポート一覧を見ると、三つしか出ない。
多分、同じアドレスを指す奴が見つかったら後からの奴を採用するのだろう。

145 ◆rCEzuNnL0g:2008/08/30(土) 23:24:06
つまり、
??0********ABV0@@Z // コピーコンストラクタ!
??4*************** // コピーコンストラクタ!
??0*************** // コンストラクタ!
??1*************** // デストラクタ!
って言うことだ。
??4があると??0(ryもあるということ。

146 ◆rCEzuNnL0g:2008/08/30(土) 23:33:05
?Get@CSub@@UAEHXZ
のように、@UAEとなっているのは、仮想関数のようである。
純仮想関数はエクスポートされない。

147 ◆rCEzuNnL0g:2008/08/30(土) 23:33:48
@QAE <- 通常

@UAE <- virtual
だからAEの意味は分からない。

148 ◆rCEzuNnL0g:2008/08/30(土) 23:34:26
コピーコンストラクタは自動的に作られるっぽい。
まあ、元の仕様がそうだから、当たり前か。

149 ◆rCEzuNnL0g:2008/08/30(土) 23:36:37
class CSuper{public: virtual int Get() = 0;};
class CSub : public CSuper{private: int i; public: CSub(int v){i = v;} ~CSub{} virtual int Get(){return i}};

をエクスポートした結果。
-----
序数: 0001 名前: ??0CSub@@QAE@ABV0@@Z
序数: 0002 名前: ??0CSub@@QAE@H@Z
序数: 0003 名前: ??0CSuper@@QAE@ABV0@@Z
序数: 0004 名前: ??0CSuper@@QAE@XZ
序数: 0005 名前: ??1CSub@@UAE@XZ
序数: 0006 名前: ??1CSuper@@QAE@XZ
序数: 0007 名前: ??4CSub@@QAEAAV0@ABV0@@Z
序数: 0008 名前: ??4CSuper@@QAEAAV0@ABV0@@Z
序数: 0009 名前: ??_7CSub@@6B@
序数: 000A 名前: ??_7CSuper@@6B@
序数: 000B 名前: ?Get@CSub@@UAEHXZ

150 ◆rCEzuNnL0g:2008/08/30(土) 23:39:12
まだ、??7とか??8とか??9とか??Bとか??Yは分からん。
operator系の関数?

151 ◆rCEzuNnL0g:2008/08/30(土) 23:49:39
コピーコンストラスタは自動生成されるが
コンストラクタと、デストラクタは自動生成されない。
何故ならば、処理が無いならば何もしなくて良いから。
ただ、virtualな関数を持つクラスを継承したらどうなるのだろうか。
まあ、一個上のデストラクタを呼び出さないけないな。
多分、virtualな関数が無くても、継承していればその二つは自動生成されるのだろう。

152 ◆rCEzuNnL0g:2008/08/30(土) 23:52:05
??Bはoperatorっぽい。
int, char, short, long, float, double, long double
void*, int*, char*, short*, long*, float*, double*, long double*
をエクスポートしたけど無駄だった。じゃあ、後はoperator+=とかだけか。
序数: 0002 名前: ??BCSuper@@QAEDXZ
序数: 0003 名前: ??BCSuper@@QAEFXZ
序数: 0004 名前: ??BCSuper@@QAEHXZ
序数: 0005 名前: ??BCSuper@@QAEJXZ
序数: 0006 名前: ??BCSuper@@QAEMXZ
序数: 0007 名前: ??BCSuper@@QAENXZ
序数: 0008 名前: ??BCSuper@@QAEOXZ
序数: 0009 名前: ??BCSuper@@QAEPADXZ
序数: 000A 名前: ??BCSuper@@QAEPAFXZ
序数: 000B 名前: ??BCSuper@@QAEPAHXZ
序数: 000C 名前: ??BCSuper@@QAEPAJXZ
序数: 000D 名前: ??BCSuper@@QAEPAMXZ
序数: 000E 名前: ??BCSuper@@QAEPANXZ
序数: 000F 名前: ??BCSuper@@QAEPAOXZ
序数: 0010 名前: ??BCSuper@@QAEPAXXZ

153 ◆rCEzuNnL0g:2008/08/30(土) 23:53:26
後は??7,8,9,Yだけ。

154 ◆rCEzuNnL0g:2008/08/30(土) 23:58:21
??Yはoperator+=。

155 ◆rCEzuNnL0g:2008/08/31(日) 00:00:28
??Hはoperator+。
だけれども
??7,8,9は分からんなあ。

156 ◆rCEzuNnL0g:2008/08/31(日) 00:09:13
__imp_?Get@SClass@@QAEPA_WXZ <- wchar_t* | void
__imp_?Get@SClass@@QAE_JXZ <- long long int | void
__imp_?Get@SClass@@QAE_JXZ <- __int64 | void //上と同じ
__imp_?Get@SClass@@QAE_KXZ <- unsigned __int64 | void
__imp_?Get@SClass@@QAEPA_KXZ <- unsigned __int64* | void

157 ◆rCEzuNnL0g:2008/08/31(日) 07:54:18
__imp_??2CClass@@SAPAXI@Z <- operator new

158 ◆rCEzuNnL0g:2008/08/31(日) 18:08:51
サクラエディタである文字列を含まない行を消し去る正規表現
------
^(?!.*{対象文字列}).+[\r\n][\r\n]?$
------
{対象文字列}を置き換える。

159 ◆rCEzuNnL0g:2008/08/31(日) 19:09:24
MASMインラインアセンブラ
http://7ujm.net/C++/asm1.html
-----
インラインアセンブラメモ。

160 ◆rCEzuNnL0g:2008/08/31(日) 21:26:22
liveなquerySelectorAll - 素人がプログラミングを勉強するブログ
http://d.hatena.ne.jp/javascripter/20080831/1220184849

161 ◆rCEzuNnL0g:2008/08/31(日) 22:18:55
DLLをエクスポートするときにこんなのでも・・・
------------------------------------
#ifdef __cplusplus
# define CDLLExport extern "C" __declspec(dllexport)
#else
# define CDLLExport __declspec(dllexport)
#endif

#define DLLExport __declspec(dllexport)

162 ◆rCEzuNnL0g:2008/08/31(日) 23:19:29
無理やりfxプラグインを作ってやろうと思ったが、
関数ポインタ多すぎてやる気が起きないwwwwwwwwwwww
もう諦めよう。
だから、直接アクションを呼び出す方法だけを探そう!
早く、プラグインの作成の奴が出ないかなあ。

163 ◆rCEzuNnL0g:2008/08/31(日) 23:41:13
■ Takahashi's Web ■
http://www.nscripter.com/
-----
ひぐらし、うみねこはNScripterで作っている。

164 ◆rCEzuNnL0g:2008/08/31(日) 23:43:09
うpだて - みみず日記
http://d.hatena.ne.jp/sub_chon/20080827/1219808408#c
-----
VC++ 2008でコンパイルしないほうが良い件について。

165 ◆rCEzuNnL0g:2008/09/01(月) 00:07:08
CodeZine:プログラミングに役立つソースコードが満載な開発者のための実装系Webマガジン
http://codezine.jp/
-----
CodeZine!CodeZine!CodeZine!CodeZine!

166 ◆rCEzuNnL0g:2008/09/01(月) 00:36:17
MemoPanelの検索にBoostのRegexとか、正規表現のライブラリを使いたいけれども、
内部の文字列の持ち方が、Shift-JISなのでUnicodeに変換しなければいけない。
かなり、負荷が高そう。

167 ◆rCEzuNnL0g:2008/09/01(月) 00:40:01
 シンボリックリンクでアレコレ - Kei_9 なげやりにっき
http://d.hatena.ne.jp/Kei_9/20080831/1220195251
-----
後で読む。

168 ◆rCEzuNnL0g:2008/09/01(月) 17:54:05
>>167関連。
-----
リンク/ジャンクション作成ツール
http://homepage1.nifty.com/emk/symlink.html

169 ◆rCEzuNnL0g:2008/09/01(月) 18:59:53
Win32プログラミングノート
http://hp.vector.co.jp/authors/VA000092/win32/index.html

170 ◆rCEzuNnL0g:2008/09/01(月) 19:59:52
ntdll.dllの書き換えとCRCチェックの回避 - KENJI’S BLOG
http://d.hatena.ne.jp/kenjiaiko/20080817/1218980643
----
上手く利用すれば、PC(Windows XP以降?)が二度と起動できなくなるプログラムが作れるよー
作っても誰のパソコンを実験台にするかだなあ。
半年筆のパソコンにするかな?
ウィルス対策ソフトには引っかからない、素晴らしいウィルスになるんじゃない?
もう、誰かが作ってそうだけれども。

171 ◆rCEzuNnL0g:2008/09/02(火) 15:06:40
Lispのひび
http://d.hatena.ne.jp/tazant/
-----
Lispは面白いよね。全然理解できてないけれども。
因みにこの人中2だそうです。(1994年12月生まれ。)
すげー。
俺もLispが作れるか試してみよう! <- 嘘
但し整数だけだお。

172774さん:2008/09/02(火) 15:25:05
Lispを実行する環境はあるので試してみる。

173 ◆rCEzuNnL0g:2008/09/02(火) 15:31:43
上げちゃった・・・

まあ、基本を押さえているだけあってちゃんと分かっていた。

(setq x 1)
=> 1
(print x)
=> 1
面倒。

174 ◆rCEzuNnL0g:2008/09/02(火) 15:34:59
(defun double (x) (* x x))
=> double
(double 2)
=> 4

175 ◆rCEzuNnL0g:2008/09/02(火) 15:37:21
((lambda (x) (* x x)) 12)
=> 144
ね?簡単でしょ?(ボブ風に)
まあ、こんなもん、基本の基本。
というか、本当のLispなんて何も垣間見せていない。
まあ、詳しくはWikipediaでいいんじゃね?

176 ◆rCEzuNnL0g:2008/09/02(火) 15:46:12
悔しい悔しい悔しい悔しい悔しい悔しい悔しい悔しい悔しい悔しい

177 ◆rCEzuNnL0g:2008/09/02(火) 15:46:44
Sleipnir + Lispなんてどう?
まあ、出来ないけれども。

178 ◆rCEzuNnL0g:2008/09/02(火) 16:03:17
Lispは引数をちゃんとチェックするみたいだなあ。
ということは、引数の情報は(ry

まあ、ね。本当に凄い凄い、凄い凄い(ry

T216がとても気になる。

179 ◆rCEzuNnL0g:2008/09/02(火) 16:47:38
情報オリンピックおもすれー。
出たい出たい!

180 ◆rCEzuNnL0g:2008/09/02(火) 16:49:43
他のを上げて、此れはちゃんと下げるようにしないと・・・
強制sageを使おう!

181 ◆rCEzuNnL0g:2008/09/02(火) 16:52:04
これで、上げても大丈夫・・・

182 ◆rCEzuNnL0g:2008/09/02(火) 17:00:01
JOI2008-2009開催予定
http://www.ioi-jp.org/joi/2008/announce.html
-----
マジで出ようかなあ。

183 ◆rCEzuNnL0g:2008/09/02(火) 17:01:04
俺が出れるのは今年で最後っぽいし・・・

184 ◆rCEzuNnL0g:2008/09/02(火) 17:11:25
>>予選合格者の氏名・学校名・学年・性別は情報オリンピック日本委員会のウェブサイト他で公表されることがあります。また、予選合格者の氏名は在学している学校へ通知され、賞状(Aランク者のみ)は学校から本人へ渡していただきます。予めこれらのことを了承のうえで予選に参加してください。
予選合格しないから関係ないなwwwww

185 ◆rCEzuNnL0g:2008/09/02(火) 17:15:52
つまり、勝手に出ようかなということです。
勉強のためにCygwinを入れている。

186 ◆rCEzuNnL0g:2008/09/02(火) 17:17:49
まあいい、デバッガさえ使わなければVC++も他の環境と同じである。
どうせ、ブロックインデントはサクラエディタと一緒の設定にしているからな。

187 ◆rCEzuNnL0g:2008/09/02(火) 17:18:23
VC++で予選に出ても良いと思う。

188 ◆rCEzuNnL0g:2008/09/02(火) 17:31:04
日本予選の一番最近の奴の一問目の基本アルゴリズムは此れで良いとおも。
m が入力された値。
numが出力する値。
-----
int o = 1000 - m;

int num = 0;
while(o / 500){
num++;
o -= 500;
}
while(o / 100){
num++;
o -= 100;
}
while(o / 50){
num++;
o -= 50;
}
while(o / 10){
num++;
o -= 10;
}
while(o / 5){
num++;
o -= 5;
}
while(o / 1){
num++;
o -= 1;
}

189 ◆rCEzuNnL0g:2008/09/02(火) 17:35:48
オラが作ったプログラム、.cだとコンパイルできない><
.cppだとコンパイルできる。何故だ!

190 ◆rCEzuNnL0g:2008/09/02(火) 17:36:28
分かった!
変数を一番最初に列挙して宣言していないからだ!

191 ◆rCEzuNnL0g:2008/09/02(火) 17:52:42
Cで書いた。

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv){
FILE *in = fopen("input.txt", "r");
FILE *out = fopen("output.txt", "w");
char buff[1024];
int m; //出題元の値
int b; //バッファ
int c; //釣り
int num = 0; //枚数

if(!in || !out) return -1;

fgets(buff, sizeof(buff), in);
m = atoi(buff);
c = 1000 - m;

if(b = c / 500){
num += b;
c = c - b * 500;
}
if(b = c / 100){
num += b;
c = c - b * 100;
}
if(b = c / 50){
num += b;
c = c - b * 50;
}
if(b = c / 10){
num += b;
c = c - b * 10;
}
if(b = c / 5){
num += b;
c = c - b * 5;
}
if(b = c / 1){
num += b;
c = c - b * 1;
}

fprintf(out, "%d", num);

return 0;
}

192 ◆rCEzuNnL0g:2008/09/02(火) 18:03:56
二問目出来た。

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv){
FILE *in = fopen("input.txt", "r");
FILE *out = fopen("output.txt", "w");
char *buff = NULL;

int joi = 0, ioi = 0;


buff = calloc(10002, sizeof(char));
if(!in || !out || !buff) return -1;
fgets(buff, 10002, in);

while(*buff){
if(*buff == 'J' && *(buff + 1) == 'O' && *(buff + 2) == 'I'){
joi++;
}
if(*buff == 'I' && *(buff + 1) == 'O' && *(buff + 2) == 'I'){
ioi++;
}
buff++;
}

fprintf(out, "%d\r\n%d", joi, ioi);

return 0;
}

193 ◆rCEzuNnL0g:2008/09/02(火) 18:05:01
あ、メモリ開放するの忘れたwwww
よって、free(buff);をreturnの前へ。

194 ◆rCEzuNnL0g:2008/09/02(火) 19:00:52
飯を食っていたが、三問目も出来た。
-----
#include <stdio.h>
#include <stdlib.h>

struct data{
int num; //カード番号
int disable; //利用済みか 1:済
};

int cmp(const void *a, const void *b){
return ((struct data *)a)->num - ((struct data *)b)->num;
}

int main(int argc, char **argv){
FILE *in = fopen("input.txt", "r");
FILE *out = fopen("output.txt", "w");
char buff[32];
int length; //カードの量(n)
struct data *taro, *hanako; //太郎、花子
int taro_num, hanako_num;

int latest = -1; //今場に出ているカード
int next = 0; //次 0:太郎 1:花子

int i, j, k;

if(!in || !out) return -1;

fgets(buff, sizeof(buff), in);
length = atoi(buff);

taro = calloc(length + 1, sizeof(taro[0]));
hanako = calloc(length + 1, sizeof(hanako[0]));

if(!taro || !hanako) return -2;

for(i = 0; i < length; i++){
fgets(buff, sizeof(buff), in);
taro[i].num = atoi(buff);
}

qsort(taro, length, sizeof(taro[0]), cmp);


for(i = 1, j = 0, k = 0; i <= length * 2; i++){
if(i != taro[j].num){
hanako[k++].num = i;
}else{
j++;
}
}
taro_num = hanako_num = length;

//初期化終

while(taro_num != 0 && hanako_num != 0){
if(next == 0){ //太郎の番
for(i = 0; i < length; i++){
if(!taro[i].disable && latest < taro[i].num){
latest = taro[i].num;
taro[i].disable = 1;
taro_num--;
goto end1;
}
}

latest = -1;

end1:
next = 1;
}else{ //花子の番
for(i = 0; i < length; i++){
if(!hanako[i].disable && latest < hanako[i].num){
latest = hanako[i].num;
hanako[i].disable = 1;
hanako_num--;
goto end2;
}
}

latest = -1;

end2:
next = 0;
}
}

fprintf(out, "%d\r\n%d", hanako_num, taro_num);

free(taro);
free(hanako);

return 0;
}

195 ◆rCEzuNnL0g:2008/09/02(火) 19:02:38
今思えばファイルもクローズしていないなwww

196 ◆rCEzuNnL0g:2008/09/02(火) 19:44:11
此れを作るのに時間かかりすぎ。
四問目。
-----
#include <stdio.h>
#include <stdlib.h>

struct point{
int x;
int y;
};

int main(int argc, char **argv){
FILE *in = fopen("input.txt", "r");
FILE *out = fopen("output.txt", "w");
char buff[32];
int base_len, data_len; /*base : 探すの data: 星一杯*/
struct point *base, *data;
int def_x, def_y;

int i, j, k, l;

if(!in || !out) return -1;

fgets(buff, sizeof(buff), in);
base_len = atoi(buff);

base = calloc(base_len, sizeof(base[0]));

if(!base) return -2;

for(i = 0; i < base_len; i++){
fgets(buff, sizeof(buff), in);
sscanf(buff, "%d %d", &base[i].x, &base[i].y);
}

fgets(buff, sizeof(buff), in);
data_len = atoi(buff);

data = calloc(data_len, sizeof(data[0]));

if(!data) return -3;

for(i = 0; i < data_len; i++){
fgets(buff, sizeof(buff), in);
sscanf(buff, "%d %d", &data[i].x, &data[i].y);
}


for(i = 0; i < data_len; i++){
def_x = data[i].x - base[0].x;
def_y = data[i].y - base[0].y;
l = 0;

for(j = 1; j < base_len; j++){
for(k = 0; k < data_len; k++){
if(base[j].x + def_x == data[k].x && base[j].y + def_y == data[k].y) //見つかった
break;
}
if(k == data_len) //見つからなかった
break;
}
if(j == base_len) //見つかった
break;
}

fprintf(out, "%d %d", def_x, def_y);


return 0;
}

197 ◆rCEzuNnL0g:2008/09/02(火) 19:53:03
実は>>196二問正しい答えが出なかった。
頑張って直したのだ。

198 ◆rCEzuNnL0g:2008/09/02(火) 20:01:16
ちょwwwwwww
atoi関数でエラーが出たwwww

199 ◆rCEzuNnL0g:2008/09/02(火) 21:31:34
>>198
俺が馬鹿だっただけだ。

四問目が漸く出来た。
絶対三時間以内に出来ない。
-----
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct point{
int x;
int y;
};

int main(int argc, char **argv){
FILE *in = fopen("input.txt", "r");
FILE *out = fopen("output.txt", "w");
char buff[32];
int height, width;
char **mat;
char **c_mat;
int ret;

int i, j, k;

fgets(buff, sizeof(buff), in);
sscanf(buff, "%d %d", &height, &width);


mat = calloc(height, sizeof(mat[0]));
if(!mat) return -1;

for(i = 0; i < height; i++){
mat[i] = calloc(width, sizeof(mat[0][0]));
if(!mat[i]) return -2;
}

c_mat = calloc(height, sizeof(c_mat[0]));
if(!c_mat) return -3;

for(i = 0; i < height; i++){
c_mat[i] = calloc(width, sizeof(c_mat[0][0]));
if(!c_mat[i]) return -4;
}

for(i = 0; i < height; i++){
for(j = 0; j < width; j++){
mat[i][j] = fgetc(in) - '0' ? ~0 : 0;
fgetc(in);
}
}

//初期化終わり

//出来るだけ0へ

ret = -1;
for(i = 0; i < (1 << height); i++){
int carrent_max = 0;

for(j = 0; j < height; j++){
if((i >> j) & 1){
for(k = 0; k < width; k++){
c_mat[j][k] = ~mat[j][k];
}
}else{
for(k = 0; k < width; k++){
c_mat[j][k] = mat[j][k];
}
}
}

//第二初期化完了
for(j = 0; j < width; j++){
int count = 0;

for(k = 0; k < height; k++){
if(c_mat[k][j] == 0){
count++;
}
}

carrent_max += max(count, height - count);
}

ret = max(ret, carrent_max);
}

fprintf(out, "%d", ret);


return 0;
}

200 ◆rCEzuNnL0g:2008/09/02(火) 21:32:21
structいらないね。

201 ◆rCEzuNnL0g:2008/09/02(火) 21:38:05
というか解説読んでこんなに時間がかかっているんだから(ry
一時間四十五分かかっているのは、三十分ぐらい風呂かな。
多分もうちょっと少ないだろうが。

滅茶苦茶むずいじゃん。

202 ◆rCEzuNnL0g:2008/09/02(火) 21:38:44
今度は解説を読まずにやろう!
時間もちゃんと計ってね。

203 ◆rCEzuNnL0g:2008/09/02(火) 23:05:39
2007年度の俺の答え
1:>>191
2:>>192
3:>>194
4:>>196
5:まだ無い

204 ◆rCEzuNnL0g:2008/09/02(火) 23:08:00
4:は解説を見た
5:も解説を見てやろう。

205 ◆rCEzuNnL0g:2008/09/02(火) 23:19:46
C言語入門
http://www5c.biglobe.ne.jp/~ecb/c/c00.html
で、ファイルの操作について詳しく勉強する。
C++のファイル操作もkwskやりたい。

206 ◆rCEzuNnL0g:2008/09/02(火) 23:21:47
FrontPage - プログラミングTipsWiki - livedoor Wiki(ウィキ)
http://wiki.livedoor.jp/eruvasu/d/FrontPage

207 ◆rCEzuNnL0g:2008/09/02(火) 23:28:42
C++で一行ずつ文字列を取得する方法。他にもある?
------
stl_fstream - プログラミングTipsWiki - livedoor Wiki(ウィキ)
http://wiki.livedoor.jp/eruvasu/d/stl_fstream?wiki_id=62368

208 ◆rCEzuNnL0g:2008/09/03(水) 00:56:15
という事で、基本を押さえよう。std::名前空間。
因みに2007ねんのもんだいはおもいつけばなんとかなるとおもった。

まあ、1%の閃きと99%の努力だからなあ。
1%の閃きが重要なんだよな。
現実は厳しい。

209 ◆rCEzuNnL0g:2008/09/03(水) 18:26:03
Google Chrome入れた。
やっぱり軽い。
JavaScriptのコンソールも良い感じ。
だけれども常用には耐えかねる。

210 ◆rCEzuNnL0g:2008/09/03(水) 18:29:23
こんな風にしたら、ちゃんとインライン展開された!

#include <iostream>

template<unsigned int c>
void Call(void (__cdecl pf)(int)){
Call<c - 1>(pf);
pf(c);
}

template<>
void Call<0>(void (__cdecl pf)(int)){
return;
}

void test(int c){
__asm{
push eax
pop eax
}
}

int main(int argc, char **argv){
Call<10>(test);
}

211 ◆rCEzuNnL0g:2008/09/03(水) 18:31:14
これは展開されない!
testは同じね。
-----
int main(int argc, char **argv){
for(int i = 0; i < 10; ++i)
test(i);
}

212 ◆rCEzuNnL0g:2008/09/03(水) 18:33:22
まあ、使えるのは10までっぽい。


新着レスの表示


名前: E-mail(省略可)

※書き込む際の注意事項はこちら

※画像アップローダーはこちら

(画像を表示できるのは「画像リンクのサムネイル表示」がオンの掲示板に限ります)

掲示板管理者へ連絡 無料レンタル掲示板