diff --git a/Client/Client/Executable/NeoRylClient.lib b/Client/Client/Executable/NeoRylClient.lib deleted file mode 100644 index 9296892..0000000 Binary files a/Client/Client/Executable/NeoRylClient.lib and /dev/null differ diff --git a/Client/Client/RYLClient/RYLClient.vcxproj b/Client/Client/RYLClient/RYLClient.vcxproj index 45ac77a..de758b8 100644 --- a/Client/Client/RYLClient/RYLClient.vcxproj +++ b/Client/Client/RYLClient/RYLClient.vcxproj @@ -75,12 +75,18 @@ ../../Executable/$(Configuration)\ ../../Intermediate/$(ProjectName)/$(Configuration)\ false + F:\YouxiLand\ROW + WindowsLocalDebugger ../../Executable/$(Configuration)\ ../../Intermediate/$(ProjectName)/$(Configuration)\ false + F:\YouxiLand\ROW + WindowsLocalDebugger ../../Executable/$(Configuration)\ ../../Intermediate/$(ProjectName)/$(Configuration)\ false + F:\YouxiLand\ROW + WindowsLocalDebugger ../../Executable/$(Configuration)\ ../../Intermediate/$(ProjectName)/$(Configuration)\ false @@ -130,8 +136,8 @@ true $(OutDir)Client.pdb Windows - - + 8388608 + false MachineX86 false HighestAvailable diff --git a/Client/Client/RYLClient/RYLClient.vcxproj.user b/Client/Client/RYLClient/RYLClient.vcxproj.user index f4bc2d2..fdaea8c 100644 --- a/Client/Client/RYLClient/RYLClient.vcxproj.user +++ b/Client/Client/RYLClient/RYLClient.vcxproj.user @@ -5,7 +5,7 @@ WindowsLocalDebugger - $(OutDir)Client.exe + F:\YouxiLand\ROW\Client.exe WindowsLocalDebugger \ No newline at end of file diff --git a/Client/Client/ScriptEngine/VirtualMachine.cpp b/Client/Client/ScriptEngine/VirtualMachine.cpp index b6cd4d0..3c545ac 100644 --- a/Client/Client/ScriptEngine/VirtualMachine.cpp +++ b/Client/Client/ScriptEngine/VirtualMachine.cpp @@ -86,14 +86,14 @@ void File_XOR( const char * szSrcFilename, const char * szDstFilename, int keyVa if( !infile.is_open() ) { - ErrorMessage2( "ȭ ϴ.(At File_XOR) : %s", szSrcFilename ); + ErrorMessage2( "ȭ���� �� �� �����ϴ�.(At File_XOR) : %s", szSrcFilename ); } fstream outfile( szDstFilename, ios_base::out | ios_base::binary ); if( !outfile.is_open() ) { - ErrorMessage2( "ȭ ϴ.(At File_XOR) : %s", szDstFilename ); + ErrorMessage2( "ȭ���� �� �� �����ϴ�.(At File_XOR) : %s", szDstFilename ); } infile.seekg( 0, ios_base::end ); @@ -119,7 +119,7 @@ void CVirtualMachine::Create( const char * szFilename ) ifstream file( szFilename, ios::binary | ios::in ); if( !file.is_open() ) - ErrorMessage2( " ȭ ã ϴ. (At CVirtualMachine::Create) : %s", szFilename ); + ErrorMessage2( "������ ȭ���� ã�� �� �����ϴ�. (At CVirtualMachine::Create) : %s", szFilename ); file.seekg( 0, ios_base::end ); unsigned int filesize = (unsigned int)file.tellg(); @@ -132,6 +132,16 @@ void CVirtualMachine::Create( const char * szFilename ) file.read( pBuf, filesize ); Data_XOR( pBuf, filesize, xor_key_valueT ); + // 복호?�된 ?�이?��? 로그 ?�일�??�??(?�버깅용) + char szLogPath[MAX_PATH]; + strcpy(szLogPath, szFilename); + strcat(szLogPath, ".decrypted.log"); + FILE* fpLog = fopen(szLogPath, "wb"); + if (fpLog) { + fwrite(pBuf, 1, filesize, fpLog); + fclose(fpLog); + } + Create( pBuf, filesize ); delete [] pBuf; @@ -141,7 +151,7 @@ void CVirtualMachine::Create( const char * szFilename ) ifstream file( szFilename, ios::binary | ios::in ); if( !file.is_open() ) - ErrorMessage2( " ȭ ã ϴ. (At CVirtualMachine::Create) : %s", szFilename ); + ErrorMessage2( "������ ȭ���� ã�� �� �����ϴ�. (At CVirtualMachine::Create) : %s", szFilename ); m_pRelocation->Create( file ); @@ -277,13 +287,13 @@ void CVirtualMachine::Create( CIntermediateCode & IMCode, CSymbolTable & Symbo m_pCodeBuffer = (char*)m_pStringBuffer + StringBufferSize; if( IMCode.ToMachineCode( m_pCodeBuffer, m_pRelocation ) != m_iCodeSize ) - ScriptSystemError( " ڵ ڵ  ٸϴ.( at CVirtualMachine::Create )" ); + ScriptSystemError( "���� �ڵ� �������?���� �ڵ� ����� �ٸ��ϴ�.( at CVirtualMachine::Create )" ); - //̼ + //�������̼� m_pRelocation->Relocate( m_pGlobalVars, m_pStringBuffer, m_pCodeBuffer ); m_bRelocated = true; - //Լ ̺ + //�Լ� ���̺� �����? typedef CIntermediateCode::FUNCTABLE FUNCTABLE; FUNCTABLE & funcTable = IMCode.GetFuncTable(); @@ -334,18 +344,18 @@ void CVirtualMachine::Destroy() } /////////////////////////////////////////////////////////////////////////////////// -// ȭ -// 1. Relocation (int) -// 2. ڿ Relocation (int) -// 3. Relocation Table -// 4. ڿ Relocation Table -// 5. ũ(int) -// 6. ڿ ũ(int) -// 7. ڵ ũ(int) -// 8. ڿ -// 9. ڵ -// 10. Լ -// 11. < ڿ, Լ Ÿ(long), (long) > * +// ȭ�� ���� +// 1. ���� ���� Relocation ����(int) +// 2. ���ڿ� ���?Relocation ����(int) +// 3. ���� ���� Relocation Table +// 4. ���ڿ� ���?Relocation Table +// 5. �������� ���� ũ��(int) +// 6. ���ڿ� ���� ũ��(int) +// 7. �ڵ� ���� ũ��(int) +// 8. ���ڿ� ���� +// 9. �ڵ� ���� +// 10. �Լ��� ������ +// 11. < ���ڿ�, �Լ� Ÿ��(long), ������(long) > * ������ /////////////////////////////////////////////////////////////////////////////////// bool CVirtualMachine::Save( const char * szFilename ) @@ -412,6 +422,31 @@ bool CVirtualMachine::Save( const char * szFilename ) void CVirtualMachine::Execute() { + // 디버깅: 실행 전 상태 로그 + FILE* fpLog = fopen("script_execute.log", "a"); + if (fpLog) { + fprintf(fpLog, "=== Execute Start ===\n"); + fprintf(fpLog, "m_pCodeBuffer: %p\n", m_pCodeBuffer); + fprintf(fpLog, "m_iCodeSize: %d\n", m_iCodeSize); + fprintf(fpLog, "m_pGlobalVars: %p\n", m_pGlobalVars); + fprintf(fpLog, "m_pStringBuffer: %p\n", m_pStringBuffer); + fprintf(fpLog, "m_bRelocated: %d\n", m_bRelocated); + + // 코드 버퍼 첫 16바이트 덤프 + if (m_pCodeBuffer && m_iCodeSize > 0) { + fprintf(fpLog, "Code buffer first 16 bytes: "); + unsigned char* p = (unsigned char*)m_pCodeBuffer; + int dumpSize = (m_iCodeSize < 16) ? m_iCodeSize : 16; + for (int i = 0; i < dumpSize; i++) { + fprintf(fpLog, "%02X ", p[i]); + } + fprintf(fpLog, "\n"); + } + fprintf(fpLog, "===================\n"); + fflush(fpLog); + fclose(fpLog); + } + void * pCodeBuffer = m_pCodeBuffer; __asm call pCodeBuffer; } @@ -460,18 +495,18 @@ union long_byte }; /////////////////////////////////////////////////////////////////////////////////// -//NativeԼ ũƮ ε ϴ +//Native�Լ��� ��ũ��Ʈ�� ���ε� �ϴ� ���? // -// : Լ ġ Ѵ. ( ӵ ϴ. ) -// 1-1. ְ, ǰ Լ鸸 Լ ڵ忡 ó κп 5Ʈ ̻ (nop) д. -// 1-2. RegisterFunction ȣ 1-1 κп call ret ִ´. -// 󸶳 ? Լ nop 2 ̻ ߰ǰ, native call ȣ ȴ. -// Empty Function Ѵ. +//���� ���?: �Լ��� �� �� ��ġ�� �Ѵ�. ( ���� �ӵ��� �� �� �������� �� �����ϴ�. ) +// 1-1. ���� �ְ�, ���ǰ� ���� �Լ��鸸 �Լ� �ڵ忡�� ó�� �κп� 5����Ʈ �̻��� ����(nop)�� �����д�. +// 1-2. RegisterFunction�� ȣ�����?�� 1-1���� ������ ���� �κп� call �� ret�� ����ִ´�? +// �󸶳� ������? ���?�Լ��� nop�� 2�� �̻� �߰��ǰ�, native call�� ���� ȣ���� �ȴ�. +// Empty Function�� �����Ѵ�. // -//ٸ : Ϸ Լ ȣϴ κ Լ ּҸ ٲ۴.( ӵ ϴ. ) -// 2-1. Լ ȣ κ Relocation Tableó call table صд. -// 2-2. RegisterFunction ȣǾ call table ؼ callϰ ִ κ ٲ۴. -// call table? map< string, pair< SFuncType, vector > > +//�ٸ� ���?: ����Ϸ���?�Լ��� ȣ���ϴ� ���?�κ��� �Լ� �ּҸ� �ٲ۴�.( ���� �ӵ��� ������ �����ϴ�. ) +// 2-1. ���?�Լ� ȣ�� �κ��� Relocation Tableó�� call table�� �����صд�. +// 2-2. RegisterFunction�� ȣ��Ǿ���?�� call table�� �����ؼ� call�ϰ� �ִ� �κ��� ���� �ٲ۴�. +// call table��? map< string, pair< SFuncType, vector > > /////////////////////////////////////////////////////////////////////////////////// @@ -490,9 +525,9 @@ void CVirtualMachine::RegisterFunction( ANY_FUNCTION FuncPtr, eDataType return byte * pFunc = (byte*)GetFuncPtr( *m_pFunctionMap, szFuncName, funcType ); if( pFunc == NULL ) - ErrorMessage2( "Լ Ͽ ߽ϴ. Լ ã ϴ. : %s", funcType.ToString( szFuncName ) ); + ErrorMessage2( "�Լ� ��Ͽ�?�����߽��ϴ�. �Լ��� ã�� �� �������ϴ�. : %s", funcType.ToString( szFuncName ) ); - if( pFunc[3] != 0x90 ) //nop ƴ + if( pFunc[3] != 0x90 ) //nop�� �ƴ� �� ScriptSystemError( "RegisterFunction Error!!( at CVirtualMachine::RegisterFunction )" ); int nArg = funcType.GetArgCount(); @@ -528,7 +563,7 @@ ScriptFunc CVirtualMachine::GetScriptFunction( eDataType returnType, const char void * pFunc = GetFuncPtr( *m_pFunctionMap, szFuncName, funcType ); if( pFunc == NULL ) - ErrorMessage2( "ũƮ Լ µ ߽ϴ. Լ ã ϴ. : %s", funcType.ToString( szFuncName ) ); + ErrorMessage2( "��ũ��Ʈ �Լ��� �����µ� �����߽��ϴ�. �Լ��� ã�� �� �������ϴ�. : %s", funcType.ToString( szFuncName ) ); return ScriptFunc( pFunc, funcType.m_data ); } diff --git a/Client/Executable/copyfile.bat b/Client/Executable/copyfile.bat index 1db8ce3..bd30b37 100644 --- a/Client/Executable/copyfile.bat +++ b/Client/Executable/copyfile.bat @@ -1,3 +1,4 @@ echo copy file copy *.* S:\YouxiLand\ROW +copy *.* F:\YouxiLand\ROW pause \ No newline at end of file diff --git a/Game/Client.exe b/Game/Client.exe new file mode 100644 index 0000000..db109fb Binary files /dev/null and b/Game/Client.exe differ diff --git a/Game/NeoRylClient.exe.manifest b/Game/NeoRylClient.exe.manifest new file mode 100644 index 0000000..11bb704 --- /dev/null +++ b/Game/NeoRylClient.exe.manifest @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file