所以发现这个小代码片段允许你用PHP ping一个Minecraft服务器,但现在我想在C#中这样做.
我尝试自己这样做,但由于某种原因它只是不起作用
UdpClient client = new UdpClient();
IPEndPoint ep;
try
{
ep = new IPEndPoint(IPAddress.Parse("-snip-"), -snip-);
client.Connect(ep);
}
catch { Console.WriteLine("Error"); Console.ReadLine(); return; }
byte[] bytes = new byte[1];
bytes[0] = (byte)0xFE;
client.Send(bytes, bytes.Length);
IPEndPoint rep = new IPEndPoint(IPAddress.Any, 0);
byte[] recv = client.Receive(ref rep);
Console.WriteLine(ASCIIEncoding.ASCII.GetString(recv));
Console.ReadLine();
Run Code Online (Sandbox Code Playgroud)
服务器似乎完全忽略了数据包.这是我发现的代码片段:
$fp = fsockopen($host, $port, $errno, $errstr, $timeout);
if (!$fp) return false;
//Send 0xFE: Server list ping
fwrite($fp, "\xFE");
//Read as much data as we can (max packet size: 241 bytes)
$d …Run Code Online (Sandbox Code Playgroud) 所以我过去几天一直在重新研究PE格式,我还有几个问题
数据部分是否已映射到进程的内存中,或程序是否从磁盘读取它?
如果确实将其映射到其内存中,那么该进程如何获取该部分的偏移量?(和其他部分)
有没有办法获取已经映射到内存中的进程的入口点,而不触及磁盘上的文件?
我对delphi很陌生,当我尝试访问我的数组"nieuwButtons"时,我一直遇到访问冲突.有谁知道我做错了什么?
unit UGeneral;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Grids, Vcl.DBGrids, SMDBGrid,
KJSMDBGrid, Vcl.ExtCtrls, KJPanel, Vcl.StdCtrls, Vcl.Mask, Vcl.DBCtrls,
Data.DB;
type
TGeneral = class(TObject)
private
{ Private declarations }
public
nieuwButtons: array of TButton;
nieuwButtonsDataSource: array of TDataSource;
procedure listEdits(x, y: Integer; owner: TComponent; parent: TWinControl;
source: TDataSource);
procedure nieuwClick(Sender: TObject);
{ Public declarations }
end;
var
General: TGeneral;
implementation
procedure TGeneral.nieuwClick(Sender: TObject);
var
i: Integer;
begin
for i := 0 to Length(nieuwButtons) - 1 do …Run Code Online (Sandbox Code Playgroud) 我想知道如何从带参数的字节数组中启动.NET程序集.我不想先把它写到磁盘上.谁能给我一个如何做到这一点的例子?谢谢.
我的问题:我正在查看IMAGE_SECTION_HEADER结构的特征成员.我想知道某个部分是否可执行.我该如何检查?特征成员是a DWORD,我希望能够知道它是否包含值IMAGE_SCN_MEM_EXECUTE(0x20000000).这个计算结果怎么样?我猜我必须使用模运算符,但不知道如何.