重新将主程序重新置于其自己的图像库之后.
我如何保证加载的DLL将加载0x400000
dllImageBase = LoadLibrary("test.dll");
printf("imagebase = 0x%x", dllImageBase);
Run Code Online (Sandbox Code Playgroud)
我总是得到0x460000而不是0x400000
我需要我的dll第一条指令从0x401000开始,它曾经在重新定位之前从0x600000开始
链接器到rebase的命令是
#pragma comment( linker, "/BASE:8000000")
Run Code Online (Sandbox Code Playgroud)
所以0x400000现在实际上是免费的,但它默认不使用它.所以我可以控制它,它应该重新定位的任何方式.有些WIN32API可能吗?
我已经调试REP STOS DWORD PTR ES:[EDI]了一段时间了
从我的结论它总是使用
ECX作为反击.
EAX作为将被复制的值EDI然后附加ECX时间,因此在放入指向的转储后EDI
它似乎在EDI上覆盖指向的数据,看起来它总是只使用ECX作为计数器,同时将EDI改变4个字节.当计数器击中0时它停止工作
所以我提出了这种代码
while(regs.d.ecx != 0)
{
*(unsigned int *)(regs.d.edi) = regs.d.eax;
regs.d.edi += 4;
regs.d.ecx--;
}
Run Code Online (Sandbox Code Playgroud)
似乎工作..但我很担心,因为我只是运气和猜测工作.它结实吗?就像数据一样,它总是ECX作为计数器,EAX它总是复制4个字节永远不会少?
我的问题与这篇文章类似.但是我不会发送数据包长度而不是最后一个0字节. 在Java中读取tcp流的最有效方法
所以我想知道我将如何编写代码.
目前我只是使用
this.socketIn = new BufferedReader(new InputStreamReader(this.socket.getInputStream()));
String line = this.socketIn.readLine();
Run Code Online (Sandbox Code Playgroud)
如果在您发送数据包时发送数据包,它将计算尚未作为完全读取线路到达的数据包,但它不完整并且会弄乱整个协议.
在我的协议中,每个数据包以0字节(0x00)结束,以确定单个数据包的结束,如果数据包最终合并/堆叠在一起.
所以我真正要做的就是继续读取套接字流,直到达到0x00表示数据包已经完全制作并准备好进行处理..当然还有某种安全性(我认为超时是最好的)来确定数据包是垃圾,因为它没有在特定时间帧的0字节中结束,比如5秒.
我该怎么做呢?
PS>我没有使用NIO框架,只是每个连接套接字的常规线程,我不想切换到NIO,因为很难用完全不同的全局线程注入数据,该线程处理更新并向随机用户发送特定更新(不播出).
这是我到目前为止所尝试的.
String line = "";
int read;
long timeOut = System.currentTimeMillis();
while(true) {
read = this.socketIn.read();
if (read == -1 || read == 0 || (System.currentTimeMillis()-timeOut) > 5000)
break;
line += read
}
Run Code Online (Sandbox Code Playgroud) class Player
{
private Location location;
public Location getLocation()
{
return location;
}
public void setLocation(Location location)
{
this.location = location;
}
}
Run Code Online (Sandbox Code Playgroud)
...
class Location
{
int x,y,z;
public Location(int x, int y, int z)
{
this.x = x;
this.y = y;
this.z = z;
}
public Location(Location location)
{
this.x = location.x;
this.y = location.y;
this.z = location.z;
}
public void updateLocation(Location location) //the fix..
{
this.x = location.x;
this.y = location.y;
this.z = location.z;
}
}
Run Code Online (Sandbox Code Playgroud)
说..你做 …
c# multiple-instances visual-studio default-copy-constructor
我正在看一些C代码,我找到了这一行.
if (temp==NULL)
while (1) ;
Run Code Online (Sandbox Code Playgroud)
根据我的理解,当你进入一个无限循环时,除非你打破,否则没有出局,这是如何工作的?如果if语句不为NULL,它是否会中断,如果是这样,是什么让它一遍又一遍地检查if语句?
有关更多信息,请查找realboy源代码,该文件为gboy_lcd.c
第304行
https://github.com/guilleiguaran/realboy/blob/ed30dee751c3f78964e71930a8f87d2074362b9b/gboy_lcd.c
对于linux来说,它是一个非常稳定和优秀的gameboy模拟器
我正在尝试将python脚本转换为C#,我正在尝试确保它在一行代码中.
我该如何转换这条线?
if op.scale in (2, 4, 8):
Run Code Online (Sandbox Code Playgroud)
是的op.scale是一个整数数据类型,所以它检查它是否匹配数组中的任何值.
我知道在C#中你可以使用Range但这不是范围问题
if (Enumerable.Range(2,8).Contains(op.scale))
Run Code Online (Sandbox Code Playgroud)
我刚试过的一次尝试......看起来很有希望,但我得把它编译好.
if(Array.Exists(new Integer() {2,4,8}, element => element == op.scale))
Run Code Online (Sandbox Code Playgroud) 我有这段代码,似乎支持将许多列表参数传递给它,它会将每个参数相互比较,以便同时在所有其他列表中找到一个公共列表.
我无法弄清楚如何将多个列表传递给一个IEnmerable的参数.
说我的测试代码看起来像这样
List<uint> List1 = new List<uint>();
List<uint> List2 = new List<uint>();
List<uint> List3 = new List<uint>();
List<uint> Commons = FindCommon(List1, List2, List3); //no compile
List<uint> Commons = FindCommon<List<uint>>(List1, List2, List3); //no compile?? why
Run Code Online (Sandbox Code Playgroud)
我怎么称呼这个?我必须以某种方式将它们合并到IEnumerable中吗?或者我必须以某种方式将它们全部合并到一个列表中,同时保留某种不可见的分隔符?
static List<T> FindCommon<T>(IEnumerable<List<T>> lists)
{
Dictionary<T, int> map = new Dictionary<T, int>();
int listCount = 0; // number of lists
foreach (IEnumerable<T> list in lists)
{
listCount++;
foreach (T item in list)
{
// Item encountered, increment count
int currCount;
if (!map.TryGetValue(item, out currCount)) …Run Code Online (Sandbox Code Playgroud) 您好我使用jQuery的.append()函数来获取XSS漏洞
我正在做的是附加来自用户的原始聊天消息,我不想剥离服务器或客户端的html标签我只是想显示它们.然而,jquery的.append()方法呈现了html标记.
无论如何像appendText()?我尝试过.text()但它无法正常生成正确的html.
我目前正在使用.
var li = $('<div></div>').addClass('chatmsg');
var al = $('<span></span>').addClass(chatClass).text("You");
li.append(al);
li.append(" " + msg);
$('.chat').append(li);
Run Code Online (Sandbox Code Playgroud)
如何修复li.append(""+ msg);
忽略渲染html的行谢谢你,没有像正则表达式那样先进的东西.
谢谢
我很难过,为什么这不起作用似乎无法找到任何问题.
这是代码.
Public Const MULTIPART_BOUNDARY = "speed"
Function getBalance() As String
Dim sEntityBody As String
Dim postBody() As Byte
Dim username As String
Dim password As String
username = CStr(frmMain.txtUser.text)
password = CStr(frmMain.txtPass.text)
sEntityBody = "--" & MULTIPART_BOUNDARY & vbCrLf
sEntityBody = sEntityBody & "Content-Disposition: form-data; name=""function""" & vbCrLf & vbCrLf & "balance" & vbCrLf
sEntityBody = sEntityBody & "--" & MULTIPART_BOUNDARY & vbCrLf
sEntityBody = sEntityBody & "Content-Disposition: form-data; name=""username""" & vbCrLf & vbCrLf & username & vbCrLf
sEntityBody …Run Code Online (Sandbox Code Playgroud) 错误看起来像这样
Exception in thread "Thread-1" java.lang.NullPointerException
at java.util.LinkedHashMap$Entry.remove(LinkedHashMap.java:332)
at java.util.LinkedHashMap$Entry.recordAccess(LinkedHashMap.java:356)
at java.util.LinkedHashMap.get(LinkedHashMap.java:304)
at Server.getLastFinishedCommands(Server.java:9086)
at Server.processPacket(Server.java:484)
at PacketWorker.run(PacketWorker.java:34)
at java.lang.Thread.run(Thread.java:744)
Run Code Online (Sandbox Code Playgroud)
里面getLastFinishedCommands我用
public List<CCommand> getLastFinishedCommands(UserProfile player) {
List<CCommand> returnList = new ArrayList<CCommand>();
if(!finishedCommands.containsKey(player.myWebsitecmd-1)) {
getSavedState(player);
return null;
}
try { //<-- added this try/catch so it doesn't happen again.
//Get commands.
CCommand cmd;
long i;
long startIndex = player.myWebsitecmd;
long endIndex = startIndex+LIMIT_COMMANDS;
for(i = startIndex; i <= endIndex; i++) {
cmd = finishedCommands.get(i); //<-- this is line 9086 …Run Code Online (Sandbox Code Playgroud) c# ×3
c ×2
java ×2
.net ×1
append ×1
arrays ×1
assembly ×1
c++ ×1
contains ×1
dictionary ×1
find ×1
get ×1
if-statement ×1
jquery ×1
list ×1
loadlibrary ×1
loops ×1
lru ×1
machine-code ×1
packet ×1
python ×1
relocation ×1
sockets ×1
stream ×1
vb.net ×1
vb6 ×1
while-loop ×1
winapi ×1
x86 ×1
xss ×1