Skip to content

Instantly share code, notes, and snippets.

@dbwodlf3
Created December 28, 2020 00:41
Show Gist options
  • Select an option

  • Save dbwodlf3/94a80e0dab7995dbc638d823649861d4 to your computer and use it in GitHub Desktop.

Select an option

Save dbwodlf3/94a80e0dab7995dbc638d823649861d4 to your computer and use it in GitHub Desktop.
x86_pattern in smc LLVM IR
================================================================================
Write Executable Memory. 전부 NO-PIE 패턴
==========
Pattern 1.
x86_smc1.out.ll
(바로 쓰기)
store i8 1, i8* @data_804807b
==========
Pattern 2.
x86_smc3.out.ll
(바로 쓰는데, bitcast 사용)
%0 = load i32, i32* bitcast (i8* @data_804811d to i32*)
store i32 %0, i32* bitcast (i8* @data_8048135 to i32*)
store i16 0, i16* bitcast (i8* @data_8048136 to i16*)
store i16 0, i16* bitcast (i8* @data_8048138 to i16*)
(특정 레지스터 경유하여 쓰기.)
store i8* @data_804813a, i8** @EDI_2296_55ccbaa41840
%14 = load i8*, i8** @EDI_2296_55ccbaa41840
%16 = bitcast i8* %14 to i16*
store i16 %13, i16* %16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment