-
Notifications
You must be signed in to change notification settings - Fork 55
/
payload2-2.c
37 lines (31 loc) · 7.67 KB
/
payload2-2.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <stdio.h>
#include <string.h>
__asm__(".section " ".rodata" "\n" ".global " "g" "in0Data" "\n" ".type " "g" "in0Data" ", @object\n" ".balign " "16" "\n" "" "g" "in0" "Data" ":\n" ".incbin" " \"" "./data/dynamic" "0" ".in" "\"\n" ".byte " "0\n" ".global " "g" "in0End" "\n" ".type " "g" "in0End" ", @object\n" ".balign 1\n" "" "g" "in0" "End" ":\n" ".byte " "1\n" ".global " "g" "in0Size" "\n" ".type " "g" "in0Size" ", @object\n" ".balign " "16" "\n" "" "g" "in0" "Size" ":\n" ".int " "" "g" "in0" "End" " - " "" "g" "in0" "Data" "\n" ".balign " "16" "\n" ".text\n" ); extern const __attribute__((aligned(16))) char gin0Data[]; extern const __attribute__((aligned(16))) char *const gin0End; extern const unsigned int gin0Size;
__asm__(".section " ".rodata" "\n" ".global " "g" "in1Data" "\n" ".type " "g" "in1Data" ", @object\n" ".balign " "16" "\n" "" "g" "in1" "Data" ":\n" ".incbin" " \"" "./data/dynamic" "1" ".in" "\"\n" ".byte " "0\n" ".global " "g" "in1End" "\n" ".type " "g" "in1End" ", @object\n" ".balign 1\n" "" "g" "in1" "End" ":\n" ".byte " "1\n" ".global " "g" "in1Size" "\n" ".type " "g" "in1Size" ", @object\n" ".balign " "16" "\n" "" "g" "in1" "Size" ":\n" ".int " "" "g" "in1" "End" " - " "" "g" "in1" "Data" "\n" ".balign " "16" "\n" ".text\n" ); extern const __attribute__((aligned(16))) char gin1Data[]; extern const __attribute__((aligned(16))) char *const gin1End; extern const unsigned int gin1Size;
__asm__(".section " ".rodata" "\n" ".global " "g" "in2Data" "\n" ".type " "g" "in2Data" ", @object\n" ".balign " "16" "\n" "" "g" "in2" "Data" ":\n" ".incbin" " \"" "./data/dynamic" "2" ".in" "\"\n" ".byte " "0\n" ".global " "g" "in2End" "\n" ".type " "g" "in2End" ", @object\n" ".balign 1\n" "" "g" "in2" "End" ":\n" ".byte " "1\n" ".global " "g" "in2Size" "\n" ".type " "g" "in2Size" ", @object\n" ".balign " "16" "\n" "" "g" "in2" "Size" ":\n" ".int " "" "g" "in2" "End" " - " "" "g" "in2" "Data" "\n" ".balign " "16" "\n" ".text\n" ); extern const __attribute__((aligned(16))) char gin2Data[]; extern const __attribute__((aligned(16))) char *const gin2End; extern const unsigned int gin2Size;
__asm__(".section " ".rodata" "\n" ".global " "g" "in3Data" "\n" ".type " "g" "in3Data" ", @object\n" ".balign " "16" "\n" "" "g" "in3" "Data" ":\n" ".incbin" " \"" "./data/dynamic" "3" ".in" "\"\n" ".byte " "0\n" ".global " "g" "in3End" "\n" ".type " "g" "in3End" ", @object\n" ".balign 1\n" "" "g" "in3" "End" ":\n" ".byte " "1\n" ".global " "g" "in3Size" "\n" ".type " "g" "in3Size" ", @object\n" ".balign " "16" "\n" "" "g" "in3" "Size" ":\n" ".int " "" "g" "in3" "End" " - " "" "g" "in3" "Data" "\n" ".balign " "16" "\n" ".text\n" ); extern const __attribute__((aligned(16))) char gin3Data[]; extern const __attribute__((aligned(16))) char *const gin3End; extern const unsigned int gin3Size;
__asm__(".section " ".rodata" "\n" ".global " "g" "in4Data" "\n" ".type " "g" "in4Data" ", @object\n" ".balign " "16" "\n" "" "g" "in4" "Data" ":\n" ".incbin" " \"" "./data/dynamic" "4" ".in" "\"\n" ".byte " "0\n" ".global " "g" "in4End" "\n" ".type " "g" "in4End" ", @object\n" ".balign 1\n" "" "g" "in4" "End" ":\n" ".byte " "1\n" ".global " "g" "in4Size" "\n" ".type " "g" "in4Size" ", @object\n" ".balign " "16" "\n" "" "g" "in4" "Size" ":\n" ".int " "" "g" "in4" "End" " - " "" "g" "in4" "Data" "\n" ".balign " "16" "\n" ".text\n" ); extern const __attribute__((aligned(16))) char gin4Data[]; extern const __attribute__((aligned(16))) char *const gin4End; extern const unsigned int gin4Size;
__asm__(".section " ".rodata" "\n" ".global " "g" "out0Data" "\n" ".type " "g" "out0Data" ", @object\n" ".balign " "16" "\n" "" "g" "out0" "Data" ":\n" ".incbin" " \"" "./data/dynamic" "0" ".out" "\"\n" ".byte " "0\n" ".global " "g" "out0End" "\n" ".type " "g" "out0End" ", @object\n" ".balign 1\n" "" "g" "out0" "End" ":\n" ".byte " "1\n" ".global " "g" "out0Size" "\n" ".type " "g" "out0Size" ", @object\n" ".balign " "16" "\n" "" "g" "out0" "Size" ":\n" ".int " "" "g" "out0" "End" " - " "" "g" "out0" "Data" "\n" ".balign " "16" "\n" ".text\n" ); extern const __attribute__((aligned(16))) char gout0Data[]; extern const __attribute__((aligned(16))) char *const gout0End; extern const unsigned int gout0Size;
__asm__(".section " ".rodata" "\n" ".global " "g" "out1Data" "\n" ".type " "g" "out1Data" ", @object\n" ".balign " "16" "\n" "" "g" "out1" "Data" ":\n" ".incbin" " \"" "./data/dynamic" "1" ".out" "\"\n" ".byte " "0\n" ".global " "g" "out1End" "\n" ".type " "g" "out1End" ", @object\n" ".balign 1\n" "" "g" "out1" "End" ":\n" ".byte " "1\n" ".global " "g" "out1Size" "\n" ".type " "g" "out1Size" ", @object\n" ".balign " "16" "\n" "" "g" "out1" "Size" ":\n" ".int " "" "g" "out1" "End" " - " "" "g" "out1" "Data" "\n" ".balign " "16" "\n" ".text\n" ); extern const __attribute__((aligned(16))) char gout1Data[]; extern const __attribute__((aligned(16))) char *const gout1End; extern const unsigned int gout1Size;
__asm__(".section " ".rodata" "\n" ".global " "g" "out2Data" "\n" ".type " "g" "out2Data" ", @object\n" ".balign " "16" "\n" "" "g" "out2" "Data" ":\n" ".incbin" " \"" "./data/dynamic" "2" ".out" "\"\n" ".byte " "0\n" ".global " "g" "out2End" "\n" ".type " "g" "out2End" ", @object\n" ".balign 1\n" "" "g" "out2" "End" ":\n" ".byte " "1\n" ".global " "g" "out2Size" "\n" ".type " "g" "out2Size" ", @object\n" ".balign " "16" "\n" "" "g" "out2" "Size" ":\n" ".int " "" "g" "out2" "End" " - " "" "g" "out2" "Data" "\n" ".balign " "16" "\n" ".text\n" ); extern const __attribute__((aligned(16))) char gout2Data[]; extern const __attribute__((aligned(16))) char *const gout2End; extern const unsigned int gout2Size;
__asm__(".section " ".rodata" "\n" ".global " "g" "out3Data" "\n" ".type " "g" "out3Data" ", @object\n" ".balign " "16" "\n" "" "g" "out3" "Data" ":\n" ".incbin" " \"" "./data/dynamic" "3" ".out" "\"\n" ".byte " "0\n" ".global " "g" "out3End" "\n" ".type " "g" "out3End" ", @object\n" ".balign 1\n" "" "g" "out3" "End" ":\n" ".byte " "1\n" ".global " "g" "out3Size" "\n" ".type " "g" "out3Size" ", @object\n" ".balign " "16" "\n" "" "g" "out3" "Size" ":\n" ".int " "" "g" "out3" "End" " - " "" "g" "out3" "Data" "\n" ".balign " "16" "\n" ".text\n" ); extern const __attribute__((aligned(16))) char gout3Data[]; extern const __attribute__((aligned(16))) char *const gout3End; extern const unsigned int gout3Size;
__asm__(".section " ".rodata" "\n" ".global " "g" "out4Data" "\n" ".type " "g" "out4Data" ", @object\n" ".balign " "16" "\n" "" "g" "out4" "Data" ":\n" ".incbin" " \"" "./data/dynamic" "4" ".out" "\"\n" ".byte " "0\n" ".global " "g" "out4End" "\n" ".type " "g" "out4End" ", @object\n" ".balign 1\n" "" "g" "out4" "End" ":\n" ".byte " "1\n" ".global " "g" "out4Size" "\n" ".type " "g" "out4Size" ", @object\n" ".balign " "16" "\n" "" "g" "out4" "Size" ":\n" ".int " "" "g" "out4" "End" " - " "" "g" "out4" "Data" "\n" ".balign " "16" "\n" ".text\n" ); extern const __attribute__((aligned(16))) char gout4Data[]; extern const __attribute__((aligned(16))) char *const gout4End; extern const unsigned int gout4Size;
const char *in[5] = {gin0Data, gin1Data, gin2Data, gin3Data, gin4Data};
const char *out[5] = {gout0Data, gout1Data, gout2Data, gout3Data, gout4Data};
const char* p="9760010330994056474520934906037798583967354072331648925679551350152225627627480095828056866209615240305792136810717998501360021210258189625550663046239919";
const char* q="10684702576155937335553595920566407462823007338655463309766538118799757703957743543601066745298528907374149501878689338178500355437330403123549617205342471";
char s[1024];
int main() {
scanf("%s", s);
int i;
for(i=0; i<5; i++) {
if(strncmp(in[i], s, 10) == 0) {
printf("%s", out[i]);
break;
}
}
if(i == 5) {
printf("%s\n%s\n", p, q);
}
return 0;
}