low-level

Most efficient way to manipulate ISN numbers in TCP headers [closed]

女生的网名这么多〃 提交于 2019-12-23 12:26:28
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I am currently trying to write a program that will be able to create stable a TCP connection and have complete control over the ISN numbers. I've been writing in C and I am at a point where my very limited

How to enable ARMv6 unaligned access on WinMobile6?

青春壹個敷衍的年華 提交于 2019-12-23 03:11:21
问题 ARMv6 introduce a great feature - unaligned memory access , which make some things in code much more simplier and faster. But microsoft gives API for it only in winCE6. And most PDAs now based on WinMobile6 (which is on CE 5.x). And unaligned access is disabled by default :( I've try to set unaligned flag in CP15 register, but this doesn't work - I have a crash on read unaligned data. Is it possible to enable unaligned access on WinMobile6? Edit: I've found the tool, which can enable

How do I use low-level 8 bit flags as conditionals?

孤者浪人 提交于 2019-12-22 05:36:17
问题 In my keyboard hook, each keypress gets a flag that states if it was injected or not. http://msdn.microsoft.com/en-us/library/ms644967(VS.85).aspx I've distilled a KBDLLHOOKSTRUCT from the lParam. I can access kbd.flags.XXX. I just don't know how to convert this 8bit flag into an if (injected) {... type conditional that I know how to use. If one of you smart computer-science types would help me out I'd really appreciate it. private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr

How to view the disassembly in Code::Blocks?

二次信任 提交于 2019-12-21 04:35:27
问题 I read this article about some low level underpinnings of C/C++, and the author is basically showing us through the assembly code generated by the compiler, line by line. He is using VS 2010, but I don't, I use Code::Blocks. How do I view the disassembly there? When I go to debugger, and click disassembly, it shows me a blank window... This is the C++ (.cpp) code (the whole code) I compiled: int main() { int x = 1; int y = 2; int z = 0; z = x + y; return 0; } 回答1: The kind of disassembly that

Problems with running an application under controlled environment (Win32)

做~自己de王妃 提交于 2019-12-20 06:25:30
问题 I'm not exactly sure how to tag this question or how to write the title, so if anyone has a better idea, please edit it Here's the deal: Some time ago I had written a little but cruicial part of a computing olympiad management system . The system's job is to get submissions from participants (code files), compile them, run them against predefined test cases, and return results. Plus all the rest of the stuff you can imagine it should do. The part I had written was called Limiter . It was a

What happens when different CPU cores write to the same RAM address without synchronization?

折月煮酒 提交于 2019-12-19 10:35:06
问题 Let's assume that 2 cores are trying to write different values to the same RAM address (1 byte), at the same moment of time (plus-minus eta), and without using any interlocked instructions or memory barriers. What happens in this case and what value will be written to the main RAM? The first one wins? The last one wins? Undetermined behavior? 回答1: x86 (like every other mainstream SMP CPU architecture) has coherent data caches . It's impossible for two difference caches (e.g. L1D of 2

x86 equivalent for LWARX and STWCX

天涯浪子 提交于 2019-12-18 05:55:46
问题 I'm looking for an equivalent of LWARX and STWCX (as found on the PowerPC processors) or a way to implement similar functionality on the x86 platform. Also, where would be the best place to find out about such things (i.e. good articles/web sites/forums for lock/wait-free programing). Edit I think I might need to give more details as it is being assumed that I'm just looking for a CAS (compare and swap) operation. What I'm trying to do is implement a lock-free reference counting system with

What has a better performance: multiplication or division?

三世轮回 提交于 2019-12-18 05:11:32
问题 Which version is faster ? x * 0.5 or x / 2 Ive had a course at the university called computer systems some time ago. From back then i remember that multiplying two values can be achieved with comparably "simple" logical gates but division is not a "native" operation and requires a sum register that is in a loop increased by the divisor and compared to the dividend. Now i have to optimise an algorithm with a lot of divisions. Unfortunately its not just dividing by two so binary shifting is no

How to open disks in windows and read data at low level?

孤街醉人 提交于 2019-12-18 04:21:50
问题 I know in linux it is as simple as /dev/sda but in Windows how do you open a disk and start reading data at the low level? In python I've tried: f = open("K:", "r") and I get this error: Traceback (most recent call last): File "<stdin>", line 1, in <module> IOError: [Errno 13] Permission denied: 'K:' I get this error even as administrator. 回答1: From http://support.microsoft.com/kb/100027 To open a physical hard drive for direct disk access (raw I/O) in a Win32-based application, use a device

How to open disks in windows and read data at low level?

和自甴很熟 提交于 2019-12-18 04:21:14
问题 I know in linux it is as simple as /dev/sda but in Windows how do you open a disk and start reading data at the low level? In python I've tried: f = open("K:", "r") and I get this error: Traceback (most recent call last): File "<stdin>", line 1, in <module> IOError: [Errno 13] Permission denied: 'K:' I get this error even as administrator. 回答1: From http://support.microsoft.com/kb/100027 To open a physical hard drive for direct disk access (raw I/O) in a Win32-based application, use a device