Register for your free account! | Forgot your password?

You last visited: Today at 10:19

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[ConquerServerV2]Bug

Discussion on [ConquerServerV2]Bug within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2010
Posts: 97
Received Thanks: 11
[ConquerServerV2]Bug

Hello guys, when i debug the game server is 5379 hybird's source i get this, i tryied every suggestion without any positive result , i googled it and i didn't found



Translation :
Quote:
A call to PInvoke 'ConquerServer_v2! ConquerServer_v2.MSVCRT:: malloc' has unbalanced the stack. This may occur because the managed PInvoke signature does not match the target unmanaged signature. Verify that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
if someone knows the fix, he can put reply or add me on msn to fix it TeamViewer




PS: i have windows xp service pack 3

PS2: i was reading the same C# file and i found things for "msvcrt.dll" so i gona to the source folder and searched for it and didn't found it at all

may this be the problem?


PHP Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.IO;
using Microsoft.Win32.SafeHandles;

namespace 
ConquerServer_v2
{
    public 
unsafe class MSVCRT
    
{
        [
DllImport("msvcrt.dll")]
        public static 
extern voidmemcpy(voiddstvoidsrcint length);
        [
DllImport("msvcrt.dll")]
        public static 
extern voidmemset(voiddstbyte fillint length);
        [
DllImport("msvcrt.dll")]
        public static 
extern voidmalloc(int size);
        [
DllImport("msvcrt.dll")]
        public static 
extern void free(voidmemblock);
        [
DllImport("msvcrt.dll")]
        public static 
extern voidrealloc(voidmemblockint size);
        [
DllImport("msvcrt.dll")]
        public static 
extern int memcmp(voidbuf1voidbuf2int count);
        [
DllImport("msvcrt.dll"CharSet CharSet.Unicode)]
        public static 
extern FILE_wfopen(string filenamestring mode);
        [
DllImport("msvcrt.dll")]
        public static 
extern void fclose(FILEhFile);
        [
DllImport("msvcrt.dll")]
        public static 
extern voidfgets(voidu_strint u_str_sizeFILEhFile);
        [
DllImport("msvcrt.dll")]
        public static 
extern int fgetpos(FILEhFilelongpos);
        [
DllImport("msvcrt.dll")]
        public static 
extern int fsetpos(FILEhFilelongpos);
        [
DllImport("msvcrt.dll")]
        public static 
extern int fread(voidptrint sizeint countFILEhFile);
        [
DllImport("msvcrt.dll")]
        public static 
extern int fwrite(voidptrint sizeint countFILEhFile);
        [
DllImport("msvcrt.dll")]
        public static 
extern int fseek(FILEhFileint offsetSeekOrigin origin);
    }

    public 
unsafe partial class WinMM
    
{
        [
DllImport("winmm.dll")]
        public static 
extern TIME timeGetTime();
    }

    public 
unsafe partial class Kernel32
    
{
        [
DllImport("kernel32.dll"CharSet CharSet.Unicode)]
        public static 
extern uint GetPrivateProfileIntW(string Sectionstring Keyint Default, string FileName);
        [
DllImport("kernel32.dll"CharSet CharSet.Unicode)]
        public static 
extern uint GetPrivateProfileStringW(string Sectionstring Keystring Default, charReturnedStringint Sizestring FileName);
        [
DllImport("kernel32.dll"CharSet CharSet.Ansi)]
        public static 
extern uint GetPrivateProfileStringA(string Sectionstring Keyvoid* Default, sbyteReturnedStringint Sizestring FileName);
        [
DllImport("kernel32.dll"CharSet CharSet.Unicode)]
        [return: 
MarshalAs(UnmanagedType.Bool)]
        public static 
extern bool GetPrivateProfileStructW(string Sectionstring KeyvoidlpStructint StructSizestring FileName);
        [
DllImport("kernel32.dll"CharSet CharSet.Unicode)]
        public static 
extern int GetPrivateProfileSectionNamesW(charReturnBufferint Sizestring FileName);
        [
DllImport("kernel32.dll"CharSet CharSet.Unicode)]
        public static 
extern int GetPrivateProfileSectionW(string SectioncharReturnBufferint Sizestring FileName);
        [
DllImport("kernel32.dll"CharSet CharSet.Unicode)]
        [return: 
MarshalAs(UnmanagedType.Bool)]
        public static 
extern bool WritePrivateProfileStringW(string Sectionstring Keystring Valuestring FileName);
        [
DllImport("kernel32.dll"CharSet CharSet.Unicode)]
        [return: 
MarshalAs(UnmanagedType.Bool)]
        public static 
extern bool WritePrivateProfileStructW(string Sectionstring KeyvoidlpStructint StructSizestring FileName);
        [
DllImport("kernel32.dll"CharSet CharSet.Unicode)]
        [return: 
MarshalAs(UnmanagedType.Bool)]
        public static 
extern bool WritePrivateProfileSectionW(string Sectionstring Stringstring FileName);

        [
DllImport("kernel32.dll"SetLastError true)]
        public static 
extern unsafe int WriteFile(SafeFileHandle handlebytebytesint numBytesToWriteintnumBytesWrittenIntPtr lpOverlapped);
        [
DllImport("kernel32.dll"SetLastError true)]
        public static 
extern unsafe int ReadFile(SafeFileHandle handlebytebytesint numBytesToReadintnumBytesReadIntPtr lpOverlapped);
        [
DllImport("kernel32.dll")]
        public static 
extern unsafe int SetFilePointer(SafeFileHandle handleint lointhiSeekOrigin origin);
    }

    
/// <summary>
    /// The file structure implemented for the file-api functions in msvcrt.dll
    /// </summary>
    
public unsafe struct FILE
    
{
        public 
sbyte_ptr;
        public 
int _cnt;
        public 
sbyte_base;
        public 
int _flag;
        public 
int _file;
        public 
int _charbuf;
        public 
int _bufsiz;
        public 
sbyte_tmpfname;
    };

    
/// <summary>
    /// Simplifies the native 4-byte sized time provided by timeGetTime()
    /// </summary>
    
public struct TIME
    
{
        private static 
TIME LastNowTime;

        public 
readonly uint Time;
        public 
TIME(uint _Value)
        {
            
Time _Value;
        }
        public 
TIME(int _Value)
        {
            
Time = (uint)_Value;
        }
        public 
TIME AddMilliseconds(int Add)
        {
            return new 
TIME((uint)(Time Add));
        }
        public 
TIME AddSeconds(int Add)
        {
            return new 
TIME((uint)(Time + (Add 1000)));
        }
        public 
TIME AddMinutes(int Add)
        {
            return new 
TIME((uint)(Time + (Add 60000)));
        }
        public 
TIME AddHours(int Add)
        {
            return new 
TIME((uint)(Time + (Add 3600000)));
        }
        public 
override string ToString()
        {
            return 
Time.ToString();
        }
        public 
override int GetHashCode()
        {
            return (int)
Time;
        }
        public static 
TIME Parse(string str)
        {
            return new 
TIME(uint.Parse(str));
        }

        public static 
TIME Now
        
{
            
get
            
{
                
TIME now WinMM.timeGetTime();
                if (
LastNowTime.Time >= now.Time)
                    throw new 
ApplicationException("timeGetTime() has been reset.");
                return 
now;
            }
        }
    }

    
/// <summary>
    /// Exposes a keep-alive pointer to the managed world.
    /// Pointer created with malloc(), freed with free(), realloced with realloc().
    /// </summary>
    
public unsafe class SafePointer
    
{
        private 
bool freed;
        private 
bytem_Addr;
        private 
int m_MemoryInBytes;
        public 
byteAddr get { return m_Addr; } }
        public 
int MemoryInBytes get { return m_MemoryInBytes; } }

        public 
SafePointer(int Size)
        {
            
m_Addr = (byte*)MSVCRT.malloc(Size);
            
MSVCRT.memset(m_Addr0Size);
            
m_MemoryInBytes Size;
            
freed false;
        }
        public 
void Realloc(int Size)
        {
            
m_Addr = (byte*)MSVCRT.realloc(m_AddrSize);
            
MSVCRT.memset(m_Addr0Size);
            
m_MemoryInBytes Size;
            
freed false;
        }
        public 
void Free()
        {
            if (!
freed)
            {
                
MSVCRT.free(Addr);
                
freed true;
            }
        }
        ~
SafePointer()
        {
            
Free();
        }
    }

    
/// <summary>
    /// Implements support to existing .NET classes to allows them to interact
    /// with native functions, and actions more easily
    /// </summary>
    
public static unsafe class NativeExtended
    
{
        public static 
void CopyTo(this string svoidpDest)
        {
            
byteDest = (byte*)pDest;
            for (
int i 0s.Lengthi++)
            {
                
Dest[i] = (byte)s[i];
            }
        }
        public static 
bool CheckBitFlag(this uint valueuint flag)
        {
            return ((
value flag) == flag);
        }
    }

Pro4Never2 is offline  
Old 03/31/2011, 23:26   #2


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
The fix has been posted before, search please.
Korvacs is offline  
Old 04/01/2011, 12:34   #3
 
elite*gold: 0
Join Date: Dec 2010
Posts: 97
Received Thanks: 11
hmmm, i searched yesterday , and i researched today, and unfortunatly i couldn't, some good ppl posted some suggestions on the old thread and no one worked
Pro4Never2 is offline  
Old 04/01/2011, 12:56   #4


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Took me all of 10 seconds to find using search.

Korvacs is offline  
Old 04/01/2011, 15:35   #5
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
Quote:
Originally Posted by Korvacs View Post
The fix has been posted before, search please.
He would need to switch the blowfish etc. out then. That won't fix it at all. The libraries is from C++.
He just need to force it as 32bit I think.
Syst3m_W1z4rd is offline  
Old 04/01/2011, 16:05   #6


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Quote:
Originally Posted by Syst3m_W1z4rd View Post
He would need to switch the blowfish etc. out then. That won't fix it at all. The libraries is from C++.
He just need to force it as 32bit I think.
Read the *** **** error message, then read the thread i posted:

Quote:
A call to PInvoke 'ConquerServer_v2! ConquerServer_v2.MSVCRT:: malloc' has unbalanced the stack. This may occur because the managed PInvoke signature does not match the target unmanaged signature. Verify that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
The hell is wrong with people these days?
Korvacs is offline  
Old 04/01/2011, 16:14   #7
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
I know, but if he replace it it won't help anyways. He would have to recode some things in the source.
Syst3m_W1z4rd is offline  
Old 04/01/2011, 17:15   #8


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
It will fix his current problem >_>"
Korvacs is offline  
Old 04/02/2011, 15:52   #9
 
elite*gold: 0
Join Date: Dec 2010
Posts: 97
Received Thanks: 11
okay, i put the project x86 (32bit) and i debugged, i got the same error , so it's not a 32/64bit problem, it can't be from appserv or navicat but the source is not SQL, so from where
Pro4Never2 is offline  
Old 04/03/2011, 11:26   #10


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Did you change the calling conventions for all of your dll imports like i suggest in that thread?
Korvacs is offline  
Old 08/10/2011, 10:45   #11
 
EgyWolf's Avatar
 
elite*gold: 0
Join Date: Jul 2011
Posts: 9
Received Thanks: 0
same prb here
EgyWolf is offline  
Reply


Similar Threads Similar Threads
[ConquerServerV2] Bug , Need Help
04/03/2011 - CO2 Private Server - 14 Replies
Hello, i downloaded Conquer_Server V2 5379+ , a friend told me that i just have to extract it and run the auth/game server and i gets the ip automatically so i've done everything like my friend told me ,gone to my client, pit the ip in LoaderSet.ini and ran the ConquerLoader.exe , logged in and the client says that server's off(but it's online) here's a video that shows everything YouTube - TheError



All times are GMT +1. The time now is 10:19.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.