att

GDB step over command

天大地大妈咪最大 提交于 2019-12-25 06:55:18
问题 I have the following C code: #include <inc/x86.h> #include <inc/elf.h> #define SECTSIZE 512 #define ELFHDR ((struct Elf *)0x10000) // scratch space void readsect(void*, unit32_t); void readsec(uint32_t, uint32_t, uint32_t); void bootmain(void) { struct Proghdr *ph, *eph; // read 1st page off disk readseg((uint32_t) ELFHDR, SECTSIZE*8, 0); . . // REST OF CODE . } I am using gdb to step in my code and see what is happening. I found the address of bootmain 0x7d0a and I put a breakpoint there. b

GLSL 三种变量类型(uniform,attribute和varying)

我只是一个虾纸丫 提交于 2019-12-25 01:23:35
1.uniform变量 uniform变量是外部程序传递给(vertex和fragment)shader的变量。因此它是application通过函数glUniform**()函数赋值的。在(vertex和fragment)shader程序内部,uniform变量就像是C语言里面的常量(const ),它不能被shader程序修改。(shader只能用,不能改) 如果uniform变量在vertex和fragment两者之间声明方式完全一样,则它可以在vertex和fragment共享使用。(相当于一个被vertex和fragment shader共享的全局变量) uniform变量一般用来表示:变换矩阵,材质,光照参数和颜色等信息。 以下是例子: uniform mat4 viewProjMatrix; //投影+视图矩阵 uniform mat4 viewMatrix; //视图矩阵 uniform vec3 lightPosition; //光源位置 uniform float lumaThreshold; uniform float chromaThreshold; uniform sampler2D SamplerY; uniform sampler2D SamplerUV; uniform mat3 colorConversionMatrix; 2

What does 0x4 from cmp 0x4(%esi),%ebx assembly instruction mean?

白昼怎懂夜的黑 提交于 2019-12-24 13:12:44
问题 What does 0x4 from the following assembly line mean? cmp 0x4(%esi),%ebx je ... When this compare returns equal and the jump is performed the registers have the values: %esi 0xe944d6d0 %ebx 0xe94ceccc Sorry for asking such a simple question but I'm having a hard time searching such paranthesis notation with google. Spent more than half an hour while under time pressure. 回答1: That is AT&T syntax, in Intel syntax it would be: cmp ebx,[esi+4] Note that the order of operands is reversed. In Intel

Trying to reverse engineer a function

拜拜、爱过 提交于 2019-12-24 10:46:20
问题 I'm trying to understand assembly in x86 more. I have a mystery function here that I know returns an int and takes an int argument. So it looks like int mystery(int n){} . I can't figure out the function in C however. The assembly is: mov %edi, %eax lea 0x0(,%rdi, 8), %edi sub %eax, %edi add $0x4, %edi callq < mystery _util > repz retq < mystery _util > mov %edi, %eax shr %eax and $0x1, %edi and %edi, %eax retq I don't understand what the lea does here and what kind of function it could be.

ASM call Printf

£可爱£侵袭症+ 提交于 2019-12-24 10:44:25
问题 movl %ebx, %esi movl $.LC1, %edi movl $0, %eax call printf I use the following asm code to print what is in EBX register. When I use movl $1,%eax int 0x80 and the echo $? I get the correct answer but segmentation fault in the first case. I am using the GNU Assembler and AT&T syntax. How can I fix this problem? 回答1: Judging by the code, you are probably in 64 bit mode (please confirm) in which case pointers are 64 bit in size. In a position-depended executable on Linux movl $.LC1, %edi is safe

Understanding ATT Assembly Language

别来无恙 提交于 2019-12-24 03:43:28
问题 C version: int arith(int x, int y, int z) { int t1 = x+y; int t2 = z*48; int t3 = t1 & 0xFFFF; int t4 = t2 * t3; return t4; } ATT Assembly version of the same program: x at %ebp+8, y at %ebp+12, z at %ebp+16 movl 16(ebp), %eax leal (%eax, %eax, 2), %eax sall $4, %eax // t2 = z* 48... This is where I get confused movl 12(%ebp), %edx addl 8(%ebp), %edx andl $65535, %edx imull %edx, %eax I understand everything it is doing at all points of the program besides the shift left. I assume it is going

What's the difference between 'push' and 'pushq' in at&t assembly

与世无争的帅哥 提交于 2019-12-23 07:46:30
问题 I've recently started my quest of obtaining a greater understanding as to how my computer works. My question is in regards to the differences between push and pushq. I'm aware that push writes a value to the stack and my assumption is that pushq does the something similar. The fact the q is there makes me think that there should be a subtle difference but I can't seem to make sense of the difference. I stated to ponder this question while debugging the file /lib/udev/iphone-set-info using gdb

What does JL mean in at&t syntax?

三世轮回 提交于 2019-12-23 03:14:56
问题 I'm working on a project for school and I cannot find anything on the what JL means in at&t syntax. For reference, the question is to find the value of %eax when NOP runs. Here is the code it's used in: MOV $492,%ebx MOV $2494,%eax MOV $28063,%ecx CMP %eax,%ebx JL L1 JMP L2 L1: IMUL %eax,%ebx ADD %eax,%ebx MOV %ebx,%eax SUB %ecx,%eax JMP L3 L2: IMUL %eax,%ebx SUB %eax,%ebx MOV %ebx,%eax ADD %ecx,%eax L3: NOP Also I would appreciate what JMP does as well as how the addition/subtraction

Progressive Self-Supervised Attention Learning forAspect-Level Sentiment Analysis论文阅读

你。 提交于 2019-12-23 03:07:08
Progressive Self-Supervised Attention Learning forAspect-Level Sentiment Analysis翻译及理解 1.本文针对神经网络在学习过程中存在的强模式过学习和弱模式欠学习的问题,提出了渐进自监督注意力机制算法,有效缓解了上述问题。主要基于擦除的思想,使得模型能够渐进的挖掘文本中需要关注的信息,并平衡强模式和弱模式的学习程度。在基于方面层次的情感分析三个公开数据集和两个经典的基础模型上测试表明,所提出的方法取得了不错的性能表现。 2.在方面层次的情感分类任务中,经典方法为使用注意力机制来捕获上下文文本中与给定方面最为相关的信息。然而,注意力机制容易过多的关注数据中少部分有强烈情感极性的高频词汇,而忽略那些频率较低的词。 摘要 在方面级别的情感分类(ASC)中,普遍的做法是为优势神经模型配备注意机制,以便获得给定方面每个上下文词的重要性。 但是,这种机制倾向于过分关注少数带有情感极性的频繁单词,而忽略了很少出现的单词。 本文提出了一种针对神经ASC模型的渐进式自我监督注意学习方法,该方法会自动从训练语料库中挖掘有用的注意监督信息,以细化注意机制。特别是,我们对所有训练实例进行 迭代的情感预测 。 将具有最大注意力权重的上下文单词提取为对每个实例的正确/不正确预测具有积极/误导性影响的上下文单词

x86 lea instruction

梦想与她 提交于 2019-12-22 14:44:04
问题 I am trying to get a good grip on the LEA instruction in x86: leal (%edx, %edx, 4), %eax leal (%edx, %edx, 2), %eax Given these two lines, i know that: eax = edx + edx*4 and then eax = edx + edx*2 Two questions. First, if these instructions appear in sequence as in this example, the eax register is overwritten once the second line executes? And what exactly would be loaded into the register? Another address? Or is this doing arithmetic on the values that these registers point to? 回答1: if