首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看C语言
.text
.global main
.type main, @function

main:
  pushq %rax
  pushq %rbx
  pushq %rcx
  pushq %rdx

  movq $8, %rax
  movq $.L, %rbx
......................
阅读全部 | gougoudan 贴于 2020年6月11日 12:30     hide bbsi
#include <stdio.h>

int main()
{
    printf("This is the program, which will be injected.");
    return 0;
}
阅读全部 | gougoudan 贴于 2020年6月11日 11:15     hide bbsi
#include<stdio.h>
#include<unistd.h>
#include<elf.h>
#include<fcntl.h>
#include<stdlib.h>
//暂定为4096,即默认被插入的代码大小 < 4096
#define pageSize 4096

Elf64_Addr program_head_vaddr;
Elf64_Xword program_head_size;
Elf64_Off entry_section_offset;
Elf64_Xword entry_section_size;
......................
阅读全部 | gougoudan 贴于 2020年6月11日 11:06     hide bbsi
// 功能:统计输入字符串长度
// ih: 输入字符串
// 返回字符个数
unsigned int _strlen(const char* s)
{
    if (!s) return 0u;

    const char *sc = s;
    for (; *sc; ++sc);

    return unsigned int(sc - s);
}
......................
阅读全部 | gougoudan 贴于 2020年6月11日 10:18     hide bbsi
// 功能:跳过字符串前导空白与正负符号
// ih: 输入字符串
// cnt: 输入字符个数
const char* __SkipLeadSignBlank(const char ih, unsigned int cnt)
{
    const char *s = ih, *h = ih;
    do {
        const auto c = *s;
        if (('-') == c) continue;
        if (('+') == c) continue;
        if (::isblank(c)) continue;//(c == (' ')) || (c == ('\t'))
        if (0 == c) return NULL;
......................
阅读全部 | gougoudan 贴于 2020年6月11日 10:07     hide bbsi
// 功能:跳过字符串前导空白与正负符号
// ih: 输入字符串
// cnt: 输入字符个数
const char* __SkipLeadSignBlank(const char ih, unsigned int cnt)
{
    const char *s = ih, *h = ih;
    do {
        const auto c = *s;
        if (('-') == c) continue;
        if (('+') == c) continue;
        if (::isblank(c)) continue;//(c == (' ')) || (c == ('\t'))
        if (0 == c) return NULL;
......................
阅读全部 | gougoudan 贴于 2020年6月11日 10:03     hide bbsi
#include <stdio.h>
#include <string.h>
#pragma warning(disable:4996)
#define  N 20

#define Bool  int
#define True  1
#define False 0

typedef struct AddressBook
{
    char _name[N];
......................
阅读全部 | gougoudan 贴于 2020年6月8日 16:59     hide bbsi
#include "../require.h"
#include <iostream>
#include <sstream>
#include <cstring>
using namespace std;

template <typename Type, int Count>
class Array
{
    enum { sz = Count };
    Type i[Count];

......................
阅读全部 | gougoudan 贴于 2020年6月8日 11:31     hide bbsi
#include "stdio.h"

typedef unsigned char   uint8;
void showBinary(const char* name, int c)
{
    char res[32] = {};
    char* p = &res[31];
    for (int i = 8; i--; c >>= 1){
        *--p = (c & 1) + '0';
    }
    printf("%s = %s", name, p);
}
......................
阅读全部 | gougoudan 贴于 2020年6月7日 22:10     hide bbsi
#include "stdio.h"

typedef unsigned char   uint8;
void showBinary(const char* name, int c)
{
    char res[32] = {};
    char* p = &res[31];
    for (int i = 8; i--; c >>= 1){
        *--p = (c & 1) + '0';
    }
    printf("%s = %s", name, p);
}
......................
阅读全部 | gougoudan 贴于 2020年6月7日 22:10     hide bbsi
上一页 42 43 44 45 46 47 48 49 50 51 下一页