[announce] Add CHttpClient and util stubs

This commit is contained in:
RD42 2023-10-22 17:10:27 +08:00
parent f0516a9467
commit 9c0651a883
8 changed files with 210 additions and 0 deletions

View File

@ -1,9 +1,46 @@
#ifdef WIN32
#include <windows.h>
#endif
#include "httpclient.h"
#ifdef WIN32
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
{
if(!strlen(lpszCmdLine) || strlen(lpszCmdLine) > 5) return 0;
CHttpClient* pHttpClient = new CHttpClient(NULL);
// TODO: WinMain
delete pHttpClient;
ExitProcess(0);
return 0;
}
#else
int main(int argc, char *argv[])
{
char *src = NULL;
if((argc <= 1 || argc > 3) || strlen(argv[1]) > 5) return 0;
if(argc == 3) {
src = argv[2];
}
CHttpClient* pHttpClient = new CHttpClient(src);
// TODO: main
delete pHttpClient;
return 0;
}
#endif

Binary file not shown.

Binary file not shown.

View File

@ -31,6 +31,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib"
OutputFile="$(OutDir)/announce.exe"
LinkIncremental="2"
GenerateDebugInformation="TRUE"
@ -76,6 +77,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib"
OutputFile="$(OutDir)/announce.exe"
LinkIncremental="1"
GenerateDebugInformation="TRUE"
@ -111,6 +113,18 @@
<File
RelativePath=".\announce.cpp">
</File>
<File
RelativePath=".\httpclient.cpp">
</File>
<File
RelativePath=".\httpclient.h">
</File>
<File
RelativePath=".\runutil.cpp">
</File>
<File
RelativePath=".\runutil.h">
</File>
</Files>
<Globals>
</Globals>

62
announce/httpclient.cpp Normal file
View File

@ -0,0 +1,62 @@
#include "httpclient.h"
CHttpClient::CHttpClient(char *src)
{
// TODO: CHttpClient::CHttpClient W: 004010C0 L: 08048B74
}
CHttpClient::~CHttpClient()
{
// TODO: CHttpClient::~CHttpClient W: 00401150 L: 08048C2E
}
int CHttpClient::ProcessURL(int, int, char *src, char *, char *)
{
// TODO: CHttpClient::ProcessURL W: 004018F0 L: 08048C34
return 0;
}
void CHttpClient::GetHeaderValue()
{
// TODO: CHttpClient::GetHeaderValue W: 00401160 L: 08048C78
}
int CHttpClient::Connect(char *name, unsigned short hostshort, char *)
{
// TODO: CHttpClient::Connect W: 00401680 L: 08048D44
return 1;
}
void CHttpClient::CloseConnection()
{
// TODO: CHttpClient::CloseConnection L: 08048F22
}
int CHttpClient::Send(int, char *s)
{
// TODO: CHttpClient::Send L: 08048F38
return 0;
}
int CHttpClient::Recv(int, void *buf, size_t n)
{
// TODO: CHttpClient::Recv L: 08048F90
return 0;
}
int CHttpClient::InitRequest(int, int, char *src, char *, char *)
{
// TODO: CHttpClient::InitRequest W: 004011F0 L: 08048FBC
return 0;
}
void CHttpClient::Process()
{
// TODO: CHttpClient::Process W: 004017D0 L: 0804914C
}
void CHttpClient::HandleEntity()
{
// TODO: CHttpClient::HandleEntity W: 00401350 L: 080493EA
}

30
announce/httpclient.h Normal file
View File

@ -0,0 +1,30 @@
//----------------------------------------------------
#pragma pack(1)
class CHttpClient
{
private:
int field_0;
char field_4[17926];
char field_460A[65040];
int field_1441A;
char field_1441E[256];
int field_1451E;
public:
CHttpClient(char *src);
~CHttpClient();
int ProcessURL(int, int, char *src, char *, char *);
void GetHeaderValue();
int Connect(char *name, unsigned short hostshort, char *);
void CloseConnection();
int Send(int, char *s);
int Recv(int, void *buf, size_t n);
int InitRequest(int, int, char *src, char *, char *);
void Process();
void HandleEntity();
};
//----------------------------------------------------

55
announce/runutil.cpp Normal file
View File

@ -0,0 +1,55 @@
void Util_UrlUnencode()
{
// TODO: Util_UrlUnencode L: 08049864
}
void Util_toupper()
{
// TODO: Util_toupper L: 08049948
}
void Util_stristr()
{
// TODO: Util_stristr W: 00401920 L: 0804997A
}
void Util_strupr()
{
// TODO: Util_strupr L: 08049A40
}
void Util_wildcmp()
{
// TODO: Util_wildcmp L: 08049A72
}
void Util_strnicmp()
{
// TODO: Util_strnicmp L: 08049B42
}
void Util_strrev()
{
// TODO: Util_strrev L: 08049BDC
}
void Util_itoa()
{
// TODO: Util_itoa L: 08049C60
}
void Util_Base64Encode()
{
// TODO: Util_Base64Encode L: 08049D8C
}
void FilterInvalidNickChars()
{
// TODO: FilterInvalidNickChars L: 08049E90
}
void CanFileBeOpenedForReading()
{
// TODO: CanFileBeOpenedForReading L: 08049EBA
}

12
announce/runutil.h Normal file
View File

@ -0,0 +1,12 @@
void Util_UrlUnencode();
void Util_toupper();
void Util_stristr();
void Util_strupr();
void Util_wildcmp();
void Util_strnicmp();
void Util_strrev();
void Util_itoa();
void Util_Base64Encode();
void FilterInvalidNickChars();
void CanFileBeOpenedForReading();