repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
reinvanimschoot/c-programming-a-modern-approach-solutions | chapter_7/projects/12/12.c | <filename>chapter_7/projects/12/12.c
#include <stdio.h>
int main(void)
{
char c, operation;
float operand_1, operand_2, total;
printf("Enter an expression: ");
scanf("%f", &operand_1);
while ((c = getchar()) != '\n')
{
operation = c;
scanf("%f", &operand_2);
switch (... |
reinvanimschoot/c-programming-a-modern-approach-solutions | chapter_5/projects/04/04.c | <filename>chapter_5/projects/04/04.c
#include <stdio.h>
int main(void)
{
int windspeed;
printf("Enter windspeed in knots:");
scanf("%d", &windspeed);
if (windspeed < 1)
printf("Windspeed is currently categorized as Calm.");
else if (windspeed < 4)
printf("Windspeed is currently categorized as Light... |
reinvanimschoot/c-programming-a-modern-approach-solutions | chapter_13/projects/07/7.c | <reponame>reinvanimschoot/c-programming-a-modern-approach-solutions<filename>chapter_13/projects/07/7.c
#include <stdio.h>
int main(void) {
int n;
char *tens[] = {"twenty", "thirty", "forty", "fifty",
"sixty", "seventy", "eighty", "ninety"},
*teens[] = {"ten", "eleven", "twelve", ... |
reinvanimschoot/c-programming-a-modern-approach-solutions | chapter_4/projects/02/02.c | #include <stdio.h>
int main(void)
{
int number, digit_1, remainder, digit_2, digit_3;
printf("Enter a three-digit number:");
scanf("%d", &number);
digit_1 = number / 100;
remainder = number % 100;
digit_2 = remainder / 10;
digit_3 = remainder % 10;
printf("The reversal is: %d%d%d", digit_3, digit_... |
reinvanimschoot/c-programming-a-modern-approach-solutions | chapter_6/projects/05/05.c | #include <stdio.h>
int main(void)
{
int number;
printf("Please enter a number: ");
scanf("%d", &number);
do
{
printf("%d", number % 10);
number /= 10;
} while (number > 0);
return 0;
} |
reinvanimschoot/c-programming-a-modern-approach-solutions | chapter_3/projects/02/02.c | #include <stdio.h>
int main(void)
{
int item_number, purchase_date_month, purchase_date_day, purchase_date_year;
float unit_price;
printf("Enter item number: ");
scanf("%d", &item_number);
printf("Enter unit price: ");
scanf("%f", &unit_price);
printf("Enter purchase date (mm/dd/yyy): ");
scanf("%d ... |
reinvanimschoot/c-programming-a-modern-approach-solutions | chapter_6/projects/01/01.c | <gh_stars>0
#include <stdio.h>
int main(void)
{
float max, number;
max = 0;
while (number != 0)
{
printf("Enter a number:");
scanf("%f", &number);
if (number > max)
{
max = number;
}
}
printf("The largest number entered was %.2f", max);
return 0;
} |
reinvanimschoot/c-programming-a-modern-approach-solutions | chapter_5/projects/01/01.c | #include <stdio.h>
int main(void)
{
int number, digit_amount;
printf("Enter a number:");
scanf("%d", &number);
if (number < 10)
digit_amount = 1;
else if (number < 100)
digit_amount = 2;
else if (number < 1000)
digit_amount = 3;
else
digit_amount = 4;
printf("The number %d has %d dig... |
reinvanimschoot/c-programming-a-modern-approach-solutions | chapter_5/projects/02/02.c | <gh_stars>0
#include <stdio.h>
int main(void)
{
int hours_in_24, minutes, hours_in_12;
printf("Enter a 24-hour time: ");
scanf("%2d:%2d", &hours_in_24, &minutes);
hours_in_12 = (hours_in_24 == 12 || hours_in_24 == 0) ? 12 : hours_in_24 - 12;
printf("Equivalent 12-hour time: %2.2d:%2.2d", hours_in_12, minu... |
reinvanimschoot/c-programming-a-modern-approach-solutions | chapter_5/projects/09/09.c | #include <stdio.h>
int main(void)
{
int date_1_day, date_1_month, date_1_year, date_2_day, date_2_month, date_2_year;
printf("Enter first date (mm/dd/yyyy): ");
scanf("%d/%d/%d", &date_1_day, &date_1_month, &date_1_year);
printf("Enter second date (mm/dd/yyyy): ");
scanf("%d/%d/%d", &date_2_day, ... |
reinvanimschoot/c-programming-a-modern-approach-solutions | chapter_7/projects/09/09.c | #include <stdio.h>
#include <ctype.h>
int main(void)
{
int hours_in_12, hours_in_24, minutes;
char indicator;
printf("Enter a 12-hour time: ");
scanf("%2d:%2d %c", &hours_in_12, &minutes, &indicator);
if (tolower(indicator) == 'a')
hours_in_24 = hours_in_12;
else
hours_in_24 ... |
BenElhadj/get_next_line | get_next_line.c | <gh_stars>0
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line.c :+: ... |
jvanhoefer/AMICI | models/model_robertson/model_robertson.h | #ifndef _amici_model_robertson_h
#define _amici_model_robertson_h
/* Generated by amiwrap (R2017b) 2bd39716102b9842354964196889d40d2eb2731c */
#include <cmath>
#include <memory>
#include "amici/defines.h"
#include <sunmatrix/sunmatrix_sparse.h> //SUNMatrixContent_Sparse definition
#include "amici/solver_idas.h"
#includ... |
jvanhoefer/AMICI | include/amici/simulation_parameters.h | <gh_stars>10-100
#ifndef AMICI_SIMULATION_PARAMETERS_H
#define AMICI_SIMULATION_PARAMETERS_H
#include "amici/defines.h"
#include <vector>
namespace amici {
/**
* @brief Container for various simulation parameters.
*/
class SimulationParameters {
public:
SimulationParameters() = default;
/**
* @brief... |
jvanhoefer/AMICI | models/model_jakstat_adjoint_o2/model_jakstat_adjoint_o2.h | <filename>models/model_jakstat_adjoint_o2/model_jakstat_adjoint_o2.h
#ifndef _amici_model_jakstat_adjoint_o2_h
#define _amici_model_jakstat_adjoint_o2_h
/* Generated by amiwrap (R2017b) 2bd39716102b9842354964196889d40d2eb2731c */
#include <cmath>
#include <memory>
#include "amici/defines.h"
#include <sunmatrix/sunmatri... |
jvanhoefer/AMICI | tests/cpputest/testfunctions.h | <reponame>jvanhoefer/AMICI<filename>tests/cpputest/testfunctions.h
#ifndef TESTFUNCTIONS_H
#define TESTFUNCTIONS_H
#include <amici/amici.h>
#include <amici/hdf5.h>
#include <H5Cpp.h>
#ifndef __APPLE__
#include <iostream>
#endif
#include <sstream> // make std::ostringstream available (needs to come before TestHarnes... |
jvanhoefer/AMICI | models/model_events/model_events.h | <reponame>jvanhoefer/AMICI<gh_stars>10-100
#ifndef _amici_model_events_h
#define _amici_model_events_h
/* Generated by amiwrap (R2017b) 2bd39716102b9842354964196889d40d2eb2731c */
#include <cmath>
#include <memory>
#include "amici/defines.h"
#include <sunmatrix/sunmatrix_sparse.h> //SUNMatrixContent_Sparse definition
#... |
jvanhoefer/AMICI | include/amici/exception.h | <reponame>jvanhoefer/AMICI
#ifndef amici_exception_h
#define amici_exception_h
#include "amici/defines.h" // necessary for realtype
#include <exception>
#include <array>
namespace amici {
/**
* @brief AMICI exception class
*
* Has a printf style interface to allow easy generation of error messages
*/
class AmiE... |
jvanhoefer/AMICI | src/model_header.ODE_template.h | <gh_stars>0
#ifndef _amici_TPL_MODELNAME_h
#define _amici_TPL_MODELNAME_h
#include <cmath>
#include <memory>
#include <gsl/gsl-lite.hpp>
#include "amici/model_ode.h"
#include "amici/solver_cvodes.h"
#include "sundials/sundials_types.h"
namespace amici {
class Solver;
namespace model_TPL_MODELNAME {
extern std::ar... |
JA7XJ/Examen2_JosephMoscoso_P3 | Object.h | #ifndef OBJECT_H
#define OBJECT_H
#include <string>
using std::string;
class Object{
public:
virtual string toString()=0;
virtual bool equals(Object*)=0;
virtual ~Object();
};
#endif
|
JA7XJ/Examen2_JosephMoscoso_P3 | Node.h | <reponame>JA7XJ/Examen2_JosephMoscoso_P3
#ifndef NODE_H
#define NODE_H
#include "Usuario.h"
class Node{
private:
Usuario* data;
Node* next;
public:
Node(Usuario*);
Node();
Usuario* getData();
void setData(Usuario*);
void setNext(Node*);
Node* getNext();
~Node();
};
#endif
|
JA7XJ/Examen2_JosephMoscoso_P3 | ListaEnlace.h | <reponame>JA7XJ/Examen2_JosephMoscoso_P3
#ifndef LISTAENLACE_H
#define LISTAENLACE_H
#include "Node.h"
#include "Usuario.h"
class ListaEnlace{
private:
int size;
Node* inicio;
public:
ListaEnlace();
bool push(Usuario*);
Usuario* pop();
Usuario* top();
void print();
int getSize();
... |
JA7XJ/Examen2_JosephMoscoso_P3 | Usuario.h | <gh_stars>0
#ifndef USUARIO_H
#define USUARIO_H
#include <vector>
using std::vector;
#include <fstream>
using std::ifstream;
using std::ofstream;
#include <string>
using std::string;
class Usuario{
private:
string nombre;
int edad;
string password;
string genero;
vector<string> intereses;
... |
onlyAngelia/YAAdapterTableViewWithResponderChain | ARTableViewExample/ARTableViewExample/ViewController.h | <reponame>onlyAngelia/YAAdapterTableViewWithResponderChain<filename>ARTableViewExample/ARTableViewExample/ViewController.h
//
// ViewController.h
// ARTableViewExample
//
// Created by lanjiying on 2018/6/4.
// Copyright © 2018年 lanjiying. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ViewController ... |
onlyAngelia/YAAdapterTableViewWithResponderChain | ARTableViewExample/Pods/Headers/Public/ARTableView/UIResponder+Rout.h | <reponame>onlyAngelia/YAAdapterTableViewWithResponderChain
//
// UIResponder+Rout.h
// KcalOfDriver
//
// Created by 关门滢 on 2018/5/28.
// Copyright © 2018年 liang. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIResponder (Rout)
- (void)rountEvent:(NSString *)eventName userInfo:(NSDictionary *)userIn... |
onlyAngelia/YAAdapterTableViewWithResponderChain | ARTableViewExample/ARTableViewExample/YAWebViewController.h | <gh_stars>10-100
//
// YAWebViewController.h
// ARTableViewExample
//
// Created by lanjiying on 2018/6/4.
// Copyright © 2018年 lanjiying. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface YAWebViewController : UIViewController
+(instancetype)showWKWebViewController:(NSString *)url;
@end
|
onlyAngelia/YAAdapterTableViewWithResponderChain | ARTableViewExample/ARTableViewExample/YATableViewAdapter.h | //
// YATableViewAdapter.h
// ARTableViewExample
//
// Created by lanjiying on 2018/6/4.
// Copyright © 2018年 lanjiying. All rights reserved.
//
#import "UITableViewAdapter.h"
@interface YATableViewAdapter : UITableViewAdapter
@end
|
onlyAngelia/YAAdapterTableViewWithResponderChain | ARTableViewExample/Pods/Headers/Public/ARTableView/UITableViewAdapter.h | //
// UITableViewAdapter.h
// KcalOfDriver
//
// Created by 关门滢 on 2018/5/28.
// Copyright © 2018年 liang. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
static NSString *kCCellSeletedEventName = @"TableViewAdapterDidSeletedCellEvent";
static NSString *kCTableViewDidSrollEventNam... |
onlyAngelia/YAAdapterTableViewWithResponderChain | ARTableViewExample/Pods/Headers/Private/ARTableView/UITableView+Adater.h | <reponame>onlyAngelia/YAAdapterTableViewWithResponderChain<gh_stars>10-100
//
// UITableView+Adater.h
// KcalOfDriver
//
// Created by 关门滢 on 2018/5/28.
// Copyright © 2018年 liang. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "UITableViewAdapter.h"
#import "UIResponder+Rout.h"
@interface UITableView (Ad... |
revengsmK/exploader | src/exploader.c | <reponame>revengsmK/exploader
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include "memtools.h"
/**
* Memory loader that temporarily removes Windows 10 (32-bit) 'Activate Windows' watermark by
* modifying explorer.exe process.
*
* Tested on 32-bit versions of Windows 10 20H2 and Windows 10 2... |
revengsmK/exploader | src/memtools.c | #include <windows.h>
#include <tlhelp32.h>
#include <stdio.h>
#include "memtools.h"
/* Returns image base address of suspended process */
DWORD GetBaseAddress(HANDLE hProc ,HANDLE hThread){
DWORD baseAddr = 0;
CONTEXT ctx;
ctx.ContextFlags = CONTEXT_INTEGER;
if(!GetThreadContext(hThread,&ctx... |
revengsmK/exploader | src/memtools.h | <reponame>revengsmK/exploader
#ifndef MEMTOOLS_H
#define MEMTOOLS_H
#include <stdint.h>
DWORD GetBaseAddress(HANDLE hProc , HANDLE hThread);
void KillProcessByName(const char *filename);
uintptr_t seekbytes (HANDLE hProc, uintptr_t base_addr , uintptr_t end_addr, char *pattern , char *mask);
#endif |
discovery/slapd-ssha-totp | slapd-ssha-totp.c | /* slapd-ssha-totp.c - Password module for combined password+MFA (depends on slapd-totp) */
/* $OpenLDAP$ */
/* Authors: <NAME> <<EMAIL>>, <NAME> <<EMAIL>>
MIT License
Copyright (c) 2018 Discovery Communications
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software ... |
Spidfail/libft_extended | ft_strtrim.c | <reponame>Spidfail/libft_extended<gh_stars>0
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strtrim.c ... |
Spidfail/libft_extended | ft_strnstr_nb.c | <filename>ft_strnstr_nb.c
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strnstr_nb.c ... |
Spidfail/libft_extended | ft_memjoin.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memjoin.c :+: :+: :+: ... |
Spidfail/libft_extended | ft_uatoi.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_uatoi.c :+: :+: :+: ... |
Spidfail/libft_extended | ft_substr.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_substr.c :+: :+: :+: ... |
Spidfail/libft_extended | ft_strsvchr.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strsvchr.c :+: :+: :+: ... |
Spidfail/libft_extended | ft_itoa.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_itoa.c :+: :+: :+: ... |
Spidfail/libft_extended | ft_atoi.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_atoi.c :+: :+: :+: ... |
Spidfail/libft_extended | ft_lstmap.c | <reponame>Spidfail/libft_extended<filename>ft_lstmap.c
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstmap.c ... |
Spidfail/libft_extended | ft_split.c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_split.c :+: :+: :+: ... |
uberyoji/gbdk-2020 | gbdk-support/bankpack/bankpack.c | // This is free and unencumbered software released into the public domain.
// For more information, please refer to <https://unlicense.org>
// bbbbbr 2020
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
// #include <unistd.h>
#include <stdbool.h>
#include <stdint.h>
#include "obj_data.h"
#include "files.h"
... |
uberyoji/gbdk-2020 | gbdk-support/lcc/gb.h | <filename>gbdk-support/lcc/gb.h<gh_stars>0
// gb.h
#ifndef _LCC_GB_H
#define _LCC_GB_H
#define SUFX_NOMATCH -1
#define EXT_C ".c"
#define EXT_I ".i"
#define EXT_ASM ".asm"
#define EXT_S ".s"
#define EXT_O ".o"
#define EXT_OBJ ".obj"
#define EXT_IHX ".ihx"
#define EXT_GB ".gb"
#endif // _LCC_GB_H
... |
uberyoji/gbdk-2020 | gbdk-lib/include/gb/isr.h | <filename>gbdk-lib/include/gb/isr.h
/** @file gb/isr.h
Allows constructing of raw ISR vectors.
*/
#ifndef _ISR_H_INCLUDE_
#define _ISR_H_INCLUDE_
#include <stdint.h>
// #define VECTOR_VBL 0x40 // you can not define raw vector for VBlank interrupt
#define VECTOR_STAT 0x48
#define VECTOR_TIMER 0x50
... |
uberyoji/gbdk-2020 | gbdk-lib/include/gb/bgb_emu.h | /** @file gb/bgb_emu.h
Debug window logging and profiling support for the BGB emulator.
Also see the `bgb_debug` example project included with gbdk.
See the BGB Manual for more information
("expressions, breakpoint conditions, and debug messages")
http://bgb.bircd.org/manual.html#expressions
*/
... |
uberyoji/gbdk-2020 | gbdk-lib/include/gb/gb.h | <filename>gbdk-lib/include/gb/gb.h<gh_stars>0
/** @file gb/gb.h
Gameboy specific functions.
*/
#ifndef _GB_H
#define _GB_H
#define __GBDK_VERSION 404
#include <types.h>
#include <stdint.h>
#include <gb/hardware.h>
/** Joypad bits.
A logical OR of these is used in the wait_pad and joypad
functions. For e... |
RegenHo/XHNewsFrameworkExample | Project/XHNewsFrameworkExample/Views/HUAJIEBannerView.h | <filename>Project/XHNewsFrameworkExample/Views/HUAJIEBannerView.h
//
// HUAJIEBannerView.h
// HUAJIENewsiPhoneSDK
//
// Created by <NAME> on 14-3-16.
// Copyright (c) 2014年 曾宪华 QQ群: (142557668) QQ:543413507 Gmail:<EMAIL>. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface HUAJIEBannerView : UIView
@prop... |
44henry/matlab | matrix_computations/lchol_grad_sparse.c | <reponame>44henry/matlab
#include "mex.h"
#include "string.h"
#include "math.h"
/* TODO: THIS IMPLEMENTATION IS QUICK AND DIRTY, NOT OPTIMIZED NOR MADE EASY TO USE. */
int compare
(
const void * a,
const void * b
)
{
return (int)*(double*)a - (int)*(double*)b;
}
/*
* Cholesky decomposition and its derivative ... |
ZJNixiang/HookZz | src/memory_manager.c | #include "memory_manager.h"
#include "core.h"
#include "std_kit/std_list.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* shared instance */
memory_manager_t *g_memory_manager = NULL;
memory_manager_t *memory_manager_cclass(shared_instance)() {
if (g_memory_manager == NULL) {
... |
ZJNixiang/HookZz | srcxx/Platforms/arch-arm64/ARM64Writer.h | <reponame>ZJNixiang/HookZz
//
// Created by jmpews on 2018/6/14.
//
#ifndef HOOKZZ_ARM64WRITER_H
#define HOOKZZ_ARM64WRITER_H
#include "ARM64Register.h"
#include "Instruction.h"
#include <vector>
class ARM64Relocator;
class ARM64AssemblerWriter {
public:
void *start_pc;
void *start_address;
std::vecto... |
ZJNixiang/HookZz | src/logging.h | #ifndef logging_h
#define logging_h
#define COMMON_LOG(fmt, ...) \
do { \
fprintf(stdout, fmt "\n", __VA_AR... |
ZJNixiang/HookZz | src/platforms/backend-posix/memory-helper-posix.h | #ifndef platforms_backend_darwin_memory_helper_linux_h
#define platforms_backend_darwin_memory_helper_linux_h
#include "core.h"
#include <sys/mman.h>
#include <unistd.h>
#define posix_memory_helper_cclass(member) cclass(posix_memory_helper, member)
int posix_memory_helper_cclass(get_page_size)();
void *posix_memory... |
ZJNixiang/HookZz | src/std_kit/std_map.h | /**
* Copyright (c) 2014 rxi
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the MIT license. See LICENSE for details.
*/
#ifndef MAP_H
#define MAP_H
#include <string.h>
#define MAP_VERSION "0.1.0"
typedef union {
int _int;
float _float;
double _dou... |
ZJNixiang/HookZz | srcxx/Platforms/arch-arm64/Instruction.h | //
// Created by jmpews on 2018/6/14.
//
#ifndef HOOKZZ_INSTRUCTION_H
#define HOOKZZ_INSTRUCTION_H
#include "hookzz.h"
typedef struct _ARM64InstructionCTX {
zz_addr_t pc;
zz_addr_t address;
uint8_t size;
uint32_t bytes;
} ARM64InstructionCTX;
#endif //HOOKZZ_INSTRUCTION_H
|
ZJNixiang/HookZz | src/std_kit/std_kit.c | #include "std_kit.h"
void *safe_malloc(size_t size) {
if (size <= 0) {
ERROR_LOG("[!] malloc with size %ld", size);
return NULL;
}
void *data = (void *)malloc(size);
if (!data) {
ERROR_LOG_STR("[!] malloc return NULL !!!");
return data;
}
memset(data, 0, size);
... |
ZJNixiang/HookZz | src/platforms/backend-arm/closure-bridge-arm.h | <gh_stars>1-10
/**
* Copyright 2017 jmpews
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by... |
ZJNixiang/HookZz | src/interceptor.c | <reponame>ZJNixiang/HookZz
#include <stdlib.h>
#include <string.h>
#include "core.h"
#include "interceptor.h"
#include "memory_manager.h"
#include "std_kit/std_list.h"
interceptor_t *g_interceptor = NULL;
interceptor_t *interceptor_cclass(shared_instance)(void) {
if (g_interceptor == NULL) {
g_interceptor... |
ZJNixiang/HookZz | srcxx/Platforms/arch-arm64/custom-bridge-handler-arm64.h | <gh_stars>1-10
//
// Created by z on 2018/4/7.
//
#ifndef CUSTOM_BRIDGE_HANDLER_H
#define CUSTOM_BRIDGE_HANDLER_H
#include "ClosureBridge.h"
#include "hookzz.h"
#ifdef __cplusplus
extern "C" {
#endif //__cplusplus
void dynamic_common_bridge_handler(RegState *rs, DynamicClosureBridgeInfo *dcbInfo);
void common_brid... |
ZJNixiang/HookZz | src/platforms/backend-x86/closure-bridge-x86.c | #include "closure-bridge-x86.h"
#include "backend-x86-helper.h"
#include <string.h>
#include <CommonKit/log/log_kit.h>
#include <sys/mman.h>
#include <unistd.h>
#define closure_bridge_trampoline_template_length (7 * 4)
static ClosureBridgeTrampolineTable *gClosureBridageTrampolineTable = NULL;
void common_bridge_h... |
ZJNixiang/HookZz | src/platforms/backend-darwin/memory-manager-darwin.c | <reponame>ZJNixiang/HookZz<gh_stars>1-10
#include <errno.h>
#include <mach-o/dyld.h>
#include <mach/mach.h>
#include <mach/vm_map.h>
#include <sys/mman.h>
#include "core.h"
#include "mach_vm.h"
#include "memory-helper-darwin.h"
#include "memory_manager.h"
extern void __clear_cache(void *beg, void *end);
PLATFORM_API... |
ZJNixiang/HookZz | src/interceptor_routing.h | <filename>src/interceptor_routing.h
#ifndef interceptor_routing_h
#define interceptor_routing_h
#include "closure_bridge.h"
#include "core.h"
#include "hookzz.h"
#include "interceptor.h"
ARCH_API void *get_ret_addr_PTR(RegState *rs);
ARCH_API void *get_next_hop_addr_PTR(RegState *rs);
ARCH_API void *get_current_fp_... |
ZJNixiang/HookZz | src/interceptor.h | <reponame>ZJNixiang/HookZz
#ifndef interceptor_h
#define interceptor_h
#include "core.h"
#include "hookzz.h"
#include "memory_manager.h"
typedef struct _FunctionBackup {
void *address;
int size;
char data[32];
} FunctionBackup;
struct _interceptor_t;
struct _hook_entry_backend_t;
typedef struct _hook_ent... |
ZJNixiang/HookZz | src/platforms/backend-arm/interceptor-arm.h | #ifndef platforms_backend_arm_intercetor_arm
#define platforms_backend_arm_intercetor_arm
#include "hookzz.h"
#include "zkit.h"
#include "interceptor.h"
#include "memory.h"
#include "platforms/arch-arm/relocator-arm.h"
#include "platforms/arch-arm/relocator-thumb.h"
#include "platforms/arch-arm/writer-arm.h"
#includ... |
ZJNixiang/HookZz | srcxx/Trampoline.h | //
// Created by z on 2018/6/14.
//
#ifndef HOOKZZ_TRAMPOLINE_H
#define HOOKZZ_TRAMPOLINE_H
class Trampoline {};
#endif //HOOKZZ_TRAMPOLINE_H
|
ZJNixiang/HookZz | src/memory_manager.h | #ifndef memory_allocator_h
#define memory_allocator_h
#include "core.h"
#include "hookzz.h"
#include "std_kit/std_list.h"
#include <stdint.h>
// memory permission prot
#define PROT_RW_ (1 | 2)
#define PROT_R_X (1 | 4)
typedef struct _CodeSlice {
void *data;
int size;
} CodeSlice;
typedef struct _CodeCave {
... |
ZJNixiang/HookZz | srcxx/Platforms/arch-arm64/ARM64Reader.h | //
// Created by jmpews on 2018/6/14.
//
#ifndef HOOKZZ_READERARM64_H
#define HOOKZZ_READERARM64_H
#include "ARM64AssemblyCore.h"
#include "Instruction.h"
#include "hookzz.h"
#include <istream>
#include <streambuf>
#include <vector>
class ARM64AssemblyReader {
public:
void *start_pc;
void *start_address;... |
ZJNixiang/HookZz | src/platforms/arch-arm64/relocator-arm64.c | #include "relocator-arm64.h"
#include "ARM64AssemblyCore.h"
#include "std_kit/std_kit.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
ARM64Relocator *arm64_assembly_relocator_cclass(new)(ARM64AssemblyReader *input, ARM64AssemblyWriter *output) {
ARM64Relocator *relocator = SAFE_MALLOC_TYPE(ARM64Re... |
ZJNixiang/HookZz | srcxx/ThreadManager.h | //
// Created by jmpews on 2018/6/14.
//
#ifndef HOOKZZ_THREADMANAGER_H
#define HOOKZZ_THREADMANAGER_H
#include "CommonClass/DesignPattern/Singleton.h"
#include <iostream>
#include <vector>
typedef struct _ThreadLocalKey {
pthread_key_t key;
} ThreadLocalKey;
class ThreadManager : public Singleton<ThreadManage... |
ZJNixiang/HookZz | srcxx/InterceptorRoutingTrampoline.h | //
// Created by jmpews on 2018/6/15.
//
#ifndef HOOKZZ_INTERCEPTORBACKEND_H
#define HOOKZZ_INTERCEPTORBACKEND_H
#include "Interceptor.h"
class InterceptorRoutingTrampoline {
public:
virtual void Prepare(HookEntry *entry){};
virtual void BuildForEnterTransfer(HookEntry *entry){};
virtual void BuildFo... |
ZJNixiang/HookZz | srcxx/CommonClass/DesignPattern/Singleton.h | <gh_stars>1-10
//
// Created by jmpews on 2018/6/14.
//
#ifndef HOOKZZ_SINGLETON_H
#define HOOKZZ_SINGLETON_H
#include <pthread.h>
template <typename T> class Singleton {
private:
static T *_instance;
public:
static T *GetInstance();
};
template <typename T> T *Singleton<T>::_instance = NULL;
template... |
ZJNixiang/HookZz | src/platforms/backend-posix/memory-helper-posix.c | <gh_stars>1-10
#include "memory-helper-posix.h"
#include "core.h"
#include "hookzz.h"
#include "memory_manager.h"
#include <sys/mman.h>
extern void __clear_cache(void *beg, void *end);
void posix_memory_helper_cclass(set_page_permission)(void *page_address, int prot, int n) {
int page_size = posix_memory_helper_... |
ZJNixiang/HookZz | src/platforms/arch-arm64/register-arm64.c | <reponame>ZJNixiang/HookZz<filename>src/platforms/arch-arm64/register-arm64.c
#include "register-arm64.h"
#include "std_kit/std_kit.h"
#include <string.h>
void arm64_register_describe(ARM64Reg reg, ARM64RegInfo *ri) {
if (reg >= ARM64_REG_X0 && reg <= ARM64_REG_X28) {
ri->is_integer = true;
ri->wid... |
ZJNixiang/HookZz | srcxx/Macros.h | <gh_stars>1-10
//
// Created by jmpews on 2018/6/15.
//
#ifndef HOOKZZ_MACROS_H
#define HOOKZZ_MACROS_H
#include <stdint.h>
#define INT5_MASK 0x0000001f
#define INT8_MASK 0x000000ff
#define INT10_MASK 0x000003ff
#define INT11_MASK 0x000007ff
#define INT12_MASK 0x00000fff
#define INT14_MASK 0x00003fff
#define INT16_M... |
ZJNixiang/HookZz | src/platforms/arch-arm64/writer-arm64.c | <filename>src/platforms/arch-arm64/writer-arm64.c
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "memory_manager.h"
#include "writer-arm64.h"
inline void ReadBytes(void *data, void *address, int length) { memcpy(data, address, length); }
ARM64AssemblyWriter *arm64_assembly_writer_cclass(new)(vo... |
ZJNixiang/HookZz | src/platforms/arch-arm64/reader-arm64.c | <gh_stars>1-10
#include "reader-arm64.h"
#include "std_kit/std_kit.h"
#include <string.h>
inline void ReadBytes(void *data, void *address, int length);
void ReadBytes(void *data, void *address, int length) { memcpy(data, address, length); }
ARM64AssemblyReader *arm64_assembly_reader_cclass(new)(void *address, void *... |
ZJNixiang/HookZz | src/platforms/arch-arm64/closure-bridge-arm64.c | #include "closure_bridge.h"
#include "core.h"
#include "memory_manager.h"
#define closure_bridge_trampoline_template_length (7 * 4)
void ClosureBridgeCClass(InitializeTablePage)(ClosureBridgeTrampolineTable *table, void *page_address) {
memory_manager_t *memory_manager = memory_manager_cclass(shared_instance)();
... |
ZJNixiang/HookZz | srcxx/Platforms/backend-darwin/DarwinDynamicClosureBridge.h | <reponame>ZJNixiang/HookZz<filename>srcxx/Platforms/backend-darwin/DarwinDynamicClosureBridge.h
//
// Created by jmpews on 2018/6/15.
//
#ifndef HOOKZZ_DARWINDYNAMICCLOSUREBRIDGE_H
#define HOOKZZ_DARWINDYNAMICCLOSUREBRIDGE_H
#endif //HOOKZZ_DARWINDYNAMICCLOSUREBRIDGE_H
|
ZJNixiang/HookZz | src/platforms/arch-arm64/arch-arm64.c | #include "hookzz.h"
#include "arch-arm64.h"
void *get_next_hop_addr_PTR(RegState *rs) {
void *next_hop_addr_PTR = (void *)&rs->general.regs.x15;
return next_hop_addr_PTR;
}
void *get_ret_addr_PTR(RegState *rs) {
void *ret_addr_PTR = (void *)&rs->lr;
return ret_addr_PTR;
}
void *get_current_fp_reg() {... |
ZJNixiang/HookZz | srcxx/Platforms/backend-darwin/DarwinMemoryManager.h | //
// Created by jmpews on 2018/6/14.
//
#ifndef HOOKZZ_DARWINMEMORYMANAGER_H
#define HOOKZZ_DARWINMEMORYMANAGER_H
#include "MemoryManager.h"
#endif //HOOKZZ_DARWINMEMORYMANAGER_H
|
ZJNixiang/HookZz | srcxx/Platforms/arch-arm64/ARM64Relocator.h | //
// Created by jmpews on 2018/6/14.
//
#ifndef HOOKZZ_ARM64RELOCATOR_H
#define HOOKZZ_ARM64RELOCATOR_H
#include "ARM64Reader.h"
#include "ARM64Writer.h"
#include "Instruction.h"
#include <iostream>
#include <map>
#include <vector>
class ARM64Relocator {
public:
int limitRelocateInstSize;
int relocatedI... |
ZJNixiang/HookZz | src/platforms/arch-arm64/instruction.c | <reponame>ZJNixiang/HookZz
#include "instruction.h"
#include <stdint.h>
#include <string.h>
uint32_t get_insn_sub(uint32_t insn, int start, int length) { return (insn >> start) & ((1 << length) - 1); } |
ZJNixiang/HookZz | src/platforms/backend-posix/thread-local-storage-posix.c | <reponame>ZJNixiang/HookZz<gh_stars>1-10
#include "thread_local_storage.h"
#ifndef thread_local
#include <pthread.h>
static pthread_key_t _thread_variable_key = 0;
void *get_thread_variable_value() {
if (!_thread_variable_key)
return NULL;
void *value = pthread_getspecific(_thread_variable_key);
r... |
ZJNixiang/HookZz | srcxx/Platforms/backend-posix/PosixClosureBridge.h | <filename>srcxx/Platforms/backend-posix/PosixClosureBridge.h
//
// Created by jmpews on 2018/6/14.
//
#ifndef HOOKZZ_POSIXCLOSUREBRIDGE_H
#define HOOKZZ_POSIXCLOSUREBRIDGE_H
#include "ClosureBridge.h"
#include "PosixClosureBridge.h"
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <unistd.h>
#... |
ZJNixiang/HookZz | srcxx/MemoryManager.h | //
// Created by z on 2018/6/14.
//
#ifndef HOOKZZ_MEMORYMANAGER_H
#define HOOKZZ_MEMORYMANAGER_H
#include <iostream>
#include <stdint.h>
#include <vector>
#include "CommonClass/DesignPattern/Singleton.h"
#include "hookzz.h"
typedef enum _MemoryAttribute { MEM_RX } MemoryAttribute;
typedef struct _CodeSlice {
... |
ZJNixiang/HookZz | srcxx/Platforms/arch-arm64/ARM64InterceptorRoutingTrampoline.h | <filename>srcxx/Platforms/arch-arm64/ARM64InterceptorRoutingTrampoline.h
//
// Created by jmpews on 2018/6/14.
//
#ifndef HOOKZZ_ARM64INTERCEPTOR_H
#define HOOKZZ_ARM64INTERCEPTOR_H
#include "ARM64Reader.h"
#include "ARM64Relocator.h"
#include "ARM64Writer.h"
#include "Interceptor.h"
#include "InterceptorRoutingTramp... |
ZJNixiang/HookZz | src/logging.c | <reponame>ZJNixiang/HookZz<gh_stars>1-10
#include "logging.h" |
ZJNixiang/HookZz | src/platforms/arch-arm64/arch-arm64.h | <reponame>ZJNixiang/HookZz
#define xASM(x) __asm(x)
#if 0
#undef get_current_fp_reg
#define get_current_fp_reg(fp_reg) xASM("mov %[fp_reg], fp" : [fp_reg] "=r"(fp_reg) :);
#endif |
ZJNixiang/HookZz | srcxx/StackManager.h | //
// Created by jmpews on 2018/6/14.
//
#ifndef HOOKZZ_STACKMANAGER_H
#define HOOKZZ_STACKMANAGER_H
#include <map>
#include "hookzz.h"
#include "ThreadManager.h"
typedef struct _CallStackEntry {
char *key;
void *value;
} CallStackEntry;
class ThreadStackManager;
class CallStackManager {
public:
in... |
ZJNixiang/HookZz | src/std_kit/std_map.c | <filename>src/std_kit/std_map.c
/**
* Copyright (c) 2014 rxi
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the MIT license. See LICENSE for details.
*/
#include "std_map.h"
#include <stdlib.h>
#include <string.h>
static unsigned map_hash(const char *str) {
... |
ZJNixiang/HookZz | src/platforms/backend-posix/memory-manager-posix.c | <reponame>ZJNixiang/HookZz
#include "memory-helper-posix.h"
#include "memory_manager.h"
#if !defined(__APPLE__) || USE_POSIX_IN_DARWIN
PLATFORM_API int memory_manager_cclass(get_page_size)() {
int page_size;
page_size = posix_memory_helper_cclass(get_page_size)();
return page_size;
}
PLATFORM_API void me... |
ZJNixiang/HookZz | srcxx/ClosureBridge.h | <reponame>ZJNixiang/HookZz<gh_stars>1-10
//
// Created by jmpews on 2018/6/14.
//
#ifndef HOOKZZ_CLOSUREBRIDGE_H
#define HOOKZZ_CLOSUREBRIDGE_H
#include <stdint.h>
#include <vector>
#define PRIAVE
#include "CommonClass/DesignPattern/Singleton.h"
#include "Core.h"
#include "hookzz.h"
typedef struct _ClosureBridgeIn... |
ZJNixiang/HookZz | src/platforms/arch-arm64/register-arm64.h | #ifndef platforms_arch_arm64_register_arm64_h
#define platforms_arch_arm64_register_arm64_h
#include "instruction.h"
typedef enum _ARM64Reg {
ARM64_REG_X0 = 0,
ARM64_REG_X1,
ARM64_REG_X2,
ARM64_REG_X3,
ARM64_REG_X4,
ARM64_REG_X5,
ARM64_REG_X6,
ARM64_REG_X7,
ARM64_REG_X8,
ARM64_... |
ZJNixiang/HookZz | src/platforms/arch-arm64/reader-arm64.h | #ifndef platforms_arch_arm64_reader_arm64_h
#define platforms_arch_arm64_reader_arm64_h
#include "ARM64AssemblyCore.h"
#include "core.h"
#include "instruction.h"
#include "std_kit/std_buffer_array.h"
#include "std_kit/std_kit.h"
#include "std_kit/std_list.h"
typedef struct _ARM64AssemblyReader {
void *start_pc;
... |
ZJNixiang/HookZz | src/platforms/backend-linux/memory-manager-linux.c | <filename>src/platforms/backend-linux/memory-manager-linux.c
#include "core.h"
#include "memory-helper-posix.h"
#include "memory_manager.h"
PLATFORM_API bool memory_manager_cclass(is_support_allocate_rx_memory)(memory_manager_t *self) { return true; }
PLATFORM_API void memory_manager_cclass(get_process_memory_layout)... |
ZJNixiang/HookZz | src/thread_support/thread_stack.h | <gh_stars>1-10
#ifndef thread_support_thread_stack_h
#define thread_support_thread_stack_h
#include "core.h"
#include "hookzz.h"
#include "std_kit/std_list.h"
#include "std_kit/std_map.h"
typedef struct _thread_stack_manager_t {
uintptr_t thread_id;
list_t *call_stacks;
} thread_stack_manager_t;
typedef stru... |
ZJNixiang/HookZz | srcxx/InterceptorRouting.h | #ifndef interceptor_routing_h
#define interceptor_routing_h
#include "ClosureBridge.h"
#include "hookzz.h"
#include "interceptor.h"
ARCH_API void *get_ret_addr_PTR(RegState *rs);
ARCH_API void *get_next_hop_addr_PTR(RegState *rs);
void interceptor_routing_begin(RegState *rs, hook_entry_t *entry, void *next_hop_addr_... |
ZJNixiang/HookZz | srcxx/CommonClass/Manager.h | //
// Created by z on 2018/6/14.
//
#ifndef HOOKZZ_MANAGER_H
#define HOOKZZ_MANAGER_H
#include <iostream>
#include <vector>
#endif //HOOKZZ_MANAGER_H
|
ZJNixiang/HookZz | src/platforms/arch-arm64/instruction.h | <filename>src/platforms/arch-arm64/instruction.h
#ifndef platforms_arch_arm64_instruction_h
#define platforms_arch_arm64_instruction_h
#include "hookzz.h"
typedef struct _ARM64InstructionCTX {
zz_addr_t pc;
zz_addr_t address;
uint8_t size;
uint32_t bytes;
} ARM64InstructionCTX;
// get hex insn sub
ui... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.