joyce8/EMBER2024-capa huggingface dataset:
Function at 0x557560
Capabilities:
Check http status code

Disassembly:
mov ecx, dword [esp + 8]
push ebx
push esi
mov esi, dword [esp + 0xc]
push edi
lea eax, [ecx - 0xc8]
xor edi, edi
mov ebx, dword [esi + 0xc]
cmp eax, 0x64
jb 0x557590
push str.Couldnt_set_desired_mode
push esi
call fcn.00536db0
add esp, 8
lea eax, [edi + 0x11]
pop edi
pop esi
pop ebx
ret
cmp ecx, 0xc8
je 0x5575a7
push ecx
push str.Got_a__03d_response_code_instead_of_the_assumed_200
push esi
call fcn.00536e80
add esp, 0xc
mov eax, dword [esp + 0x18]
push ebp
cmp eax, 0x13
jne 0x5575c2
push ebx
push esi
call fcn.00557460
add esp, 8
mov edi, eax
pop ebp
pop edi
pop esi
pop ebx
ret
cmp eax, 0x14
jne 0x5576d2
mov edi, dword [esi + 0xc]
xor ebx, ebx
cmp dword [esi + 0x4e8], 2
mov dword [esp + 0x18], edi
jne 0x557640
mov eax, dword [esi + 0x134]
mov eax, dword [eax]
test eax, eax
je 0x557640
push 3
push ebx
lea ecx, [esp + 0x1c]
mov dword [esp + 0x1c], ebx
push ecx
push ebx
push eax
call fcn.00563ce0
mov edi, eax
add esp, 0x14
test edi, edi
jne 0x5576ff
push 0x2f
push dword [esp + 0x18]
call fcn.00577c90
add esp, 8
test eax, eax
je 0x55762f
mov ebx, dword [esp + 0x14]
mov ecx, 1
sub eax, ebx
cmovne ecx, eax
mov byte [ecx + ebx], 0
jmp 0x55763c
push dword [esp + 0x14]
call dword [0x615e28]
add esp, 4
mov edi, dword [esp + 0x18]
mov ecx, dword [esi + 0x530]
test ecx, ecx
jne 0x55765e
cmp byte [esi + 0xd0c], 0
mov ecx, str.NLST
mov eax, str.LIST
cmove ecx, eax
mov edx, 0x60bf04
test ebx, ebx
mov eax, edx
cmovne eax, ebx
push eax
mov eax, 0x5a2994
cmove eax, edx
push eax
push ecx
push 0x5c1d1c
call fcn.005489b0
push ebx
mov ebp, eax
call dword [0x615e28]
add esp, 0x14
test ebp, ebp
jne 0x55769b
mov edi, 0x1b
pop ebp
mov eax, edi
pop edi
pop esi
pop ebx
ret
push ebp
push 0x5cb4f4
lea eax, [edi + 0x440]
push eax
push esi
call fcn.0056e760
push ebp
mov edi, eax
call dword [0x615e28]
add esp, 0x14
test edi, edi
jne 0x5576ff
mov eax, dword [esi + 0xc]
pop ebp
mov dword [eax + 0x4c4], 0x1f
mov eax, edi
pop edi
pop esi
pop ebx
ret
cmp eax, 0x15
jne 0x5576eb
push 0xd
push 1
push esi
call fcn.00556ff0
add esp, 0xc
mov edi, eax
pop ebp
pop edi
pop esi
pop ebx
ret
cmp eax, 0x16
jne 0x5576ff
push 0xe
push 1
push esi
call fcn.00556ff0
add esp, 0xc
mov edi, eax
pop ebp
mov eax, edi
pop edi
pop esi
pop ebx
ret
Function at 0x55d9c0
Capabilities:
Send data
Send data on socket

Disassembly:
mov ecx, dword [esp + 0xc]
push ebx
mov ebx, dword [esp + 0xc]
push esi
mov esi, dword [esp + 0xc]
push 0
mov byte [esp + 0x12], cl
lea ecx, [esp + 0x10]
push 3
mov eax, dword [esi + 0xc]
push ecx
mov byte [esp + 0x18], 0xff
mov byte [esp + 0x19], bl
push dword [eax + 0x150]
call dword [sym.imp.WS2_32.dll_send]
test eax, eax
jns 0x55da0c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.Sending_data_failed___d_
push esi
call fcn.00536db0
add esp, 0xc
push dword [esp + 0x14]
push ebx
push str.SENT
push esi
call fcn.0055d5e0
add esp, 0x10
pop esi
pop ebx
ret

Function at 0x55db60
Capabilities:
Send data
Send data on socket

Disassembly:
push ecx
cmp dword [esp + 0xc], 0x1f
push ebx
mov ebx, dword [esp + 0xc]
push ebp
mov eax, dword [ebx + 0xc]
mov ebp, dword [ebx + 0x134]
mov dword [esp + 8], eax
jne 0x55dcaf
push esi
push edi
lea eax, [ebp + 0x1cb4]
lea edi, [ebp + 0x1eb4]
mov dword [edi], eax
cmp eax, edi
jae 0x55dbad
mov byte [eax], 0xff
inc eax
mov dword [edi], eax
cmp eax, edi
jae 0x55dbad
mov byte [eax], 0xfa
inc dword [edi]
mov eax, dword [edi]
cmp eax, edi
jae 0x55dbad
mov byte [eax], 0x1f
inc dword [edi]
movzx eax, word [ebp + 0x1ca8]
mov esi, dword [sym.imp.WS2_32.dll_htons]
push eax
call esi
movzx eax, ax
mov dword [esp + 0x18], eax
movzx eax, word [ebp + 0x1caa]
push eax
call esi
mov edx, dword [esp + 0x18]
movzx ecx, ax
mov eax, dword [edi]
cmp eax, edi
jae 0x55dc17
mov byte [eax], dl
inc dword [edi]
mov eax, dword [edi]
cmp eax, edi
jae 0x55dc17
mov byte [eax], dh
inc dword [edi]
mov eax, dword [edi]
cmp eax, edi
jae 0x55dc17
mov byte [eax], cl
inc dword [edi]
mov eax, dword [edi]
cmp eax, edi
jae 0x55dc17
shr ecx, 8
mov byte [eax], cl
inc dword [edi]
mov eax, dword [edi]
cmp eax, edi
jae 0x55dc17
mov byte [eax], 0xff
inc dword [edi]
mov eax, dword [edi]
cmp eax, edi
jae 0x55dc17
mov byte [eax], 0xf0
mov eax, dword [edi]
inc eax
mov dword [ebp + 0x1eb8], eax
lea esi, [ebp + 0x1cb4]
sub eax, esi
mov dword [edi], esi
sub eax, 2
push eax
lea eax, [ebp + 0x1cb6]
push eax
push 0x3e
push ebx
call fcn.0055d6e0
mov eax, dword [esp + 0x20]
add esp, 0x10
mov edi, dword [sym.imp.WS2_32.dll_send]
push 0
push 3
push esi
push dword [eax + 0x150]
call edi
mov esi, dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
jns 0x55dc6f
call esi
push eax
push str.Sending_data_failed___d_
push ebx
call fcn.00536db0
add esp, 0xc
push 4
lea eax, [ebp + 0x1cb7]
push eax
push ebx
call fcn.0055da30
add esp, 0xc
lea eax, [ebp + 0x1cbb]
push 0
push 2
push eax
mov eax, dword [esp + 0x1c]
push dword [eax + 0x150]
call edi
test eax, eax
jns 0x55dcad
call esi
push eax
push str.Sending_data_failed___d_
push ebx
call fcn.00536db0
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret
Function at 0x55f0f0
Capabilities:
Receive data
Receive data on socket

Disassembly:
sub esp, 0x88
mov eax, dword [0x615e80]
xor eax, esp
mov dword [esp + 0x84], eax
push ebx
mov ebx, dword [esp + 0x90]
push ebp
push esi
push edi
mov eax, dword [ebx + 0xc]
mov edi, dword [eax + 0x440]
lea eax, [esp + 0x10]
push eax
mov dword [esp + 0x14], 0x80
lea eax, [esp + 0x18]
push eax
mov eax, dword [edi + 0x13c]
push 0
add eax, 4
push eax
push dword [edi + 0x148]
push dword [edi + 0x14]
call dword [sym.imp.WS2_32.dll_recvfrom]
cmp dword [edi + 0x130], 0
mov dword [edi + 0x134], eax
jne 0x55f176
push dword [esp + 0x10]
lea eax, [esp + 0x18]
push eax
lea eax, [edi + 0xb0]
push eax
call fcn.005772a0
mov eax, dword [esp + 0x1c]
add esp, 0xc
mov dword [edi + 0x130], eax
mov esi, dword [edi + 0x134]
cmp esi, 4
jge 0x55f1b1
push str.Received_too_short_packet
push ebx
call fcn.00536db0
add esp, 8
mov dword [edi + 0xc], 7
xor eax, eax
mov ecx, dword [esp + 0x94]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00573140
add esp, 0x88
ret
mov edx, dword [edi + 0x148]
movzx eax, byte [edx]
movzx ecx, byte [edx + 1]
shl eax, 8
or ecx, eax
mov dword [edi + 0xc], ecx
dec ecx
cmp ecx, 5
ja case.0x55f1d0.1
jmp dword [ecx*4 + 0x55f2dc]
cmp esi, 4
jle case.0x55f1d0.4
movzx ecx, byte [edx + 2]
movzx eax, byte [edx + 3]
shl ecx, 8
or ecx, eax
movzx eax, word [edi + 0x144]
inc eax
movzx eax, ax
cmp eax, ecx
jne case.0x55f1d0.4
lea eax, [esi - 4]
push eax
lea eax, [edx + 4]
push eax
push 1
push ebx
call fcn.00536d00
mov esi, eax
add esp, 0x10
test esi, esi
je 0x55f22b
push 5
push edi
call fcn.0055fc00
add esp, 8
mov eax, esi
jmp 0x55f198
mov eax, dword [edi + 0x134]
sub eax, 4
cdq
add dword [ebx + 0x90], eax
adc dword [ebx + 0x94], edx
push dword [ebx + 0x94]
push dword [ebx + 0x90]
push ebx
call fcn.00545d40
jmp 0x55f2b1
movzx ecx, byte [edx + 2]
lea ebp, [edx + 4]
movzx eax, byte [edx + 3]
add esi, 0xfffffffc
shl ecx, 8
or ecx, eax
push esi
push ebp
mov dword [edi + 8], ecx
call fcn.0055fc70
add esp, 8
cmp eax, esi
jae case.0x55f1d0.4
push ebp
push str.TFTP_error:__s
push ebx
call fcn.00536e80
jmp 0x55f2b1
lea eax, [esi - 2]
push eax
lea eax, [edx + 2]
push eax
push edi
call fcn.0055eea0
add esp, 0xc
test eax, eax
je case.0x55f1d0.4
jmp 0x55f198
push str.Internal_error:_Unexpected_packet
push 0x5cb4f4
push ebx
call fcn.00536db0
add esp, 0xc
push ebx
call fcn.00546140
add esp, 4
test eax, eax
je 0x55f196
push 5
push edi
call fcn.0055fc00
add esp, 8
mov eax, 0x2a
jmp 0x55f198
Function at 0x56a9a0
Capabilities:
Get file size
Read file on windows

Disassembly:
sub esp, 0x120
mov eax, dword [0x615e80]
xor eax, esp
mov dword [esp + 0x11c], eax
mov eax, dword [esp + 0x124]
push ebx
push ebp
mov ebp, dword [esp + 0x134]
xor ebx, ebx
push esi
push edi
mov edi, dword [esp + 0x138]
xor esi, esi
push edi
mov dword [esp + 0x20], eax
mov dword [esp + 0x18], edi
call fcn.005832f4
add esp, 4
mov dword [esp + 0x20], eax
test eax, eax
jne 0x56aa1f
push 0x100
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0054a560
push eax
push edi
push str.schannel:_invalid_path_name_for_CA_file__s:__s
push ebp
call fcn.00536db0
push esi
call dword [0x615e28]
add esp, 0x20
lea eax, [ebx + 0x4d]
jmp 0x56ab7f
push 0
push 0x80
push 3
push 0
push 1
push connect
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [esp + 0x18], eax
cmp eax, 0xffffffff
jne 0x56aa79
push 0x100
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0054a560
push eax
push edi
push str.schannel:_failed_to_open_CA_file__s:__s
push ebp
call fcn.00536db0
push 0
mov esi, 0x4d
call dword [0x615e28]
add esp, 0x20
jmp 0x56ab71
lea ecx, [esp + 0x24]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x56aab9
push 0x100
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0054a560
push eax
push edi
push str.schannel:_failed_to_determine_size_of_CA_file__s:__s
push ebp
call fcn.00536db0
add esp, 0x1c
mov esi, 0x4d
jmp 0x56ab5d
mov edi, dword [esp + 0x24]
cmp dword [esp + 0x28], ebx
jl 0x56aae7
jg 0x56aacd
cmp edi, 0x100000
jbe 0x56aae7
push 0x100000
push str.schannel:_CA_file_exceeds_max_size_of__u_bytes
push ebp
call fcn.00536db0
add esp, 0xc
mov esi, 0x4d
jmp 0x56ab5d
lea eax, [edi + 1]
push eax
call dword [0x615e24]
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x56aaff
lea esi, [eax + 0x1b]
jmp 0x56ab5d
test edi, edi
je 0x56ab44
nop dword [eax]
nop word [eax + eax]
push 0
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 0
push eax
mov eax, edi
sub eax, esi
push eax
lea eax, [esi + ebx]
push eax
push dword [esp + 0x28]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x56ab9c
mov eax, dword [esp + 0x10]
test eax, eax
je 0x56ab98
add esi, eax
cmp esi, edi
jb 0x56ab10
push ebp
push dword [esp + 0x18]
mov byte [edi + ebx], 0
push edi
push ebx
push dword [esp + 0x2c]
call fcn.0056a7a0
add esp, 0x14
mov esi, eax
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call dword [0x615e28]
add esp, 4
push dword [esp + 0x20]
call fcn.0057e377
add esp, 4
mov eax, esi
mov ecx, dword [esp + 0x12c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00573140
add esp, 0x120
ret
mov edi, esi
jmp 0x56ab44
push 0x100
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0054a560
push eax
push dword [esp + 0x24]
push str.schannel:_failed_to_read_from_CA_file__s:__s
push ebp
call fcn.00536db0
add esp, 0x1c
mov esi, 0x4d
jmp 0x56ab5d
Function at 0x571600
Capabilities:
Authenticate hmac
Encode data using xor

Disassembly:
push ecx
push esi
mov esi, dword [esp + 0xc]
push edi
mov ecx, dword [esi + 0xc]
mov eax, dword [esi + 0x14]
lea eax, [eax + ecx*2]
add eax, 0xc
push eax
call dword [0x615e24]
mov edi, eax
add esp, 4
test edi, edi
jne 0x571627
pop edi
pop esi
pop ecx
ret
lea ecx, [edi + 0xc]
mov dword [edi], esi
mov dword [edi + 4], ecx
mov eax, dword [esi + 0xc]
add eax, ecx
push ebx
mov ebx, dword [esp + 0x1c]
mov dword [edi + 8], eax
push ebp
cmp ebx, dword [esi + 0x10]
jbe 0x571672
mov eax, dword [esi]
push ecx
call eax
mov eax, dword [esi + 4]
push ebx
push dword [esp + 0x24]
push dword [edi + 4]
call eax
mov ebp, dword [edi + 8]
push dword [edi + 4]
add ebp, dword [esi + 0xc]
mov eax, dword [esi + 8]
push ebp
call eax
mov ebx, dword [esi + 0x14]
add esp, 0x18
mov ecx, dword [edi + 4]
mov dword [esp + 0x20], ebx
jmp 0x571676
mov ebp, dword [esp + 0x1c]
mov eax, dword [esi]
push ecx
call eax
push dword [edi + 8]
mov eax, dword [esi]
call eax
mov eax, dword [esp + 0x28]
add esp, 8
xor ebx, ebx
test eax, eax
je 0x5716d6
mov dword [esp + 0x10], eax
mov ebx, eax
movzx eax, byte [ebp]
xor al, 0x36
mov byte [esp + 0x18], al
lea eax, [esp + 0x18]
push 1
push eax
push dword [edi + 4]
mov eax, dword [esi + 4]
call eax
movzx eax, byte [ebp]
lea ebp, [ebp + 1]
xor al, 0x5c
mov byte [esp + 0x24], al
lea eax, [esp + 0x24]
push 1
push eax
push dword [edi + 8]
mov eax, dword [esi + 4]
call eax
add esp, 0x18
sub ebx, 1
jne 0x571695
mov ebx, dword [esp + 0x10]
cmp ebx, dword [esi + 0x10]
jae 0x571707
nop dword [eax + eax]
mov eax, dword [esi + 4]
push 1
push 0x603030
push dword [edi + 4]
call eax
mov eax, dword [esi + 4]
push 1
push 0x603031
push dword [edi + 8]
call eax
inc ebx
add esp, 0x18
cmp ebx, dword [esi + 0x10]
jb 0x5716e0
pop ebp
pop ebx
mov eax, edi
pop edi
pop esi
pop ecx
ret
Function at 0x571710
Capabilities:
Authenticate hmac
Encode data using xor

Disassembly:
push ecx
push ebx
push ebp
push esi
push edi
push dword [esp + 0x20]
call fcn.00539740
mov esi, dword [esp + 0x1c]
mov ebx, eax
mov ebp, dword [esp + 0x20]
mov dword [esp + 0x14], ebx
mov edx, dword [esi + 0xc]
mov ecx, dword [esi + 0x14]
lea ecx, [ecx + edx*2]
add ecx, 0xc
push ecx
call dword [0x615e24]
mov edi, eax
add esp, 8
test edi, edi
je 0x571878
lea ecx, [edi + 0xc]
mov dword [edi], esi
mov dword [edi + 4], ecx
mov eax, dword [esi + 0xc]
add eax, ecx
mov dword [edi + 8], eax
cmp ebx, dword [esi + 0x10]
jbe 0x57178c
mov eax, dword [esi]
push ecx
call eax
mov eax, dword [esi + 4]
push ebx
push ebp
push dword [edi + 4]
call eax
mov ebp, dword [edi + 8]
push dword [edi + 4]
add ebp, dword [esi + 0xc]
mov eax, dword [esi + 8]
push ebp
call eax
mov eax, dword [esi + 0x14]
add esp, 0x18
mov ecx, dword [edi + 4]
mov dword [esp + 0x10], eax
mov eax, dword [esi]
push ecx
call eax
push dword [edi + 8]
mov eax, dword [esi]
call eax
mov eax, dword [esp + 0x18]
add esp, 8
xor ebx, ebx
test eax, eax
je 0x5717f1
mov dword [esp + 0x18], eax
mov ebx, eax
nop dword [eax + eax]
movzx eax, byte [ebp]
xor al, 0x36
mov byte [esp + 0x1c], al
lea eax, [esp + 0x1c]
push 1
push eax
push dword [edi + 4]
mov eax, dword [esi + 4]
call eax
movzx eax, byte [ebp]
lea ebp, [ebp + 1]
xor al, 0x5c
mov byte [esp + 0x28], al
lea eax, [esp + 0x28]
push 1
push eax
push dword [edi + 8]
mov eax, dword [esi + 4]
call eax
add esp, 0x18
sub ebx, 1
jne 0x5717b0
mov ebx, dword [esp + 0x18]
cmp ebx, dword [esi + 0x10]
jae 0x57181d
mov eax, dword [esi + 4]
push 1
push 0x603030
push dword [edi + 4]
call eax
mov eax, dword [esi + 4]
push 1
push 0x603031
push dword [edi + 8]
call eax
inc ebx
add esp, 0x18
cmp ebx, dword [esi + 0x10]
jb 0x5717f6
push dword [esp + 0x28]
call fcn.00539740
mov ecx, dword [edi]
push eax
push dword [esp + 0x2c]
push dword [edi + 4]
mov eax, dword [ecx + 4]
call eax
mov esi, dword [esp + 0x3c]
add esp, 0x10
mov ebx, dword [edi]
test esi, esi
jne 0x571848
mov esi, dword [ebx + 0xc]
add esi, dword [edi + 8]
push dword [edi + 4]
mov eax, dword [ebx + 8]
push esi
call eax
push dword [ebx + 0x14]
mov eax, dword [ebx + 4]
push esi
push dword [edi + 8]
call eax
push dword [edi + 8]
mov eax, dword [ebx + 8]
push esi
call eax
push edi
call dword [0x615e28]
add esp, 0x20
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret
pop edi
pop esi
pop ebp
mov eax, 0x1b
pop ebx
pop ecx
ret
Function at 0x5745b9
Capabilities:
Parse pe header

Disassembly:
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test eax, eax
je 0x5745f8
mov ecx, 0x5a4d
cmp word [eax], cx
jne 0x5745f8
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x5745f8
mov eax, 0x10b
cmp word [ecx + 0x18], ax
jne 0x5745f8
cmp dword [ecx + 0x74], 0xe
jbe 0x5745f8
cmp dword [ecx + 0xe8], 0
setne al
ret
xor al, al
ret

Function at 0x5936e3
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
pop ebp
jmp fcn.00593559

Function at 0x597756
Capabilities:
Set environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
pop ebp
jmp fcn.005972a9

Function at 0x59e470
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 8]
mov ecx, 0x5a4d
cmp word [eax], cx
jne 0x59e49d
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x59e49d
mov edx, 0x10b
xor eax, eax
cmp word [ecx + 0x18], dx
sete al
pop ebp
ret
xor eax, eax
pop ebp
ret

Function at 0x8f5d92
Capabilities:
Encode data using base64

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
xor eax, 0x13244565
clc
sal dl, 0xd
push ebx
sar edx, 0xb2
push esi
btr dx, 0x3f
sal dl, cl
rcl cx, cl
push edi
bswap cx
not di
sar edx, cl
mov edi, dword [ebp + 8]
add dx, 0x784a
lahf
mov ecx, dword [edi + 0x38]
xor edx, esp
mov eax, dword [edi + 0x10]
mov edx, dword [edi + 0x3c]
mov dword [ebp - 0x20], eax
mov eax, dword [edi + 0x40]
mov ebx, dword [edi + 0x34]
mov dword [ebp - 0x18], ecx
sub cl, bh
bts si, si
mov ecx, dword [edi + 0x44]
movzx esi, si
mov esi, dword [edi + 0x20]
test al, 0x4c
test dx, dx
mov dword [ebp - 0x30], eax
btc ax, 0x5b
add ah, 0xa4
xor eax, 0x52cf0599
mov dword [ebp - 0x38], ecx
sub cx, si
shr al, cl
dec ah
mov ecx, dword [edi + 8]
cmp di, 0x6030
shr eax, 0x33
mov dword [ebp - 0x2c], edx
and ah, 0x27
xor eax, edi
ror dh, 0xaf
mov edx, 1
xor eax, ebp
adc eax, 0x6c804a69
shl edx, cl
sal ecx, cl
mov ecx, dword [edi + 4]
bsf eax, ebx
mov eax, 1
cmp ecx, esi
shl eax, cl
cmovno cx, sp
not cl
mov cx, bx
mov ecx, dword [edi + 0x14]
dec edx
mov dword [ebp - 0x34], ecx
mov ecx, dword [edi + 0x24]
dec eax
mov dword [ebp - 0x48], eax
not eax
movzx eax, dx
mov eax, dword [edi]
cmp edi, 0x2ebc4eed
clc
test sp, 0x7523
mov dword [ebp - 0x40], eax
mov eax, dword [edi + 0x28]
stc
mov dword [ebp - 0x24], eax
neg eax
mov eax, dword [edi + 0x2c]
test sp, 0x410f
mov dword [ebp - 0x10], eax
rcl al, 0x66
mov eax, dword [edi + 0x18]
mov dword [ebp - 0xc], ecx
ror cl, 0x5e
sar cx, cl
mov ecx, dword [edi + 0x30]
clc
mov dword [ebp - 4], eax
mov eax, dword [edi + 0x1c]
test dh, 0x2c
mov dword [ebp - 0x14], ebx
cmp edx, ecx
mov dword [ebp - 0x50], edx
cmp cl, 0x56
test dh, 0xf2
mov dword [ebp - 0x3c], ecx
setno cl
sar cl, cl
shld ecx, esi, 0xc5
mov dword [ebp - 0x28], 0
setb ch
Function at 0x401870
Capabilities:
Write file on windows

Disassembly:
push ebx
sub esp, 0x18
mov dword [esp], 2
lea ebx, [esp + 0x24]
call sym.___acrt_iob_func
mov dword [esp + 8], 0x1b
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], str.Mingw_w64_runtime_failure:_n
call sym._fwrite
mov dword [esp], 2
call sym.___acrt_iob_func
mov edx, dword [esp + 0x20]
mov dword [esp + 8], ebx
mov dword [esp], eax
mov dword [esp + 4], edx
call sym._vfprintf
call sym._abort
lea esi, [esi]

Function at 0x4018d0
Capabilities:
Allocate or change rwx memory

Disassembly:
push edi
push esi
push ebx
mov ebx, eax
sub esp, 0x30
mov esi, dword [0x405058]
test esi, esi
jle 0x4019f0
mov eax, dword [0x40505c]
xor ecx, ecx
add eax, 0xc
mov edx, dword [eax]
cmp ebx, edx
jb 0x401904
mov edi, dword [eax + 4]
add edx, dword [edi + 8]
cmp ebx, edx
jb 0x401987
add ecx, 1
add eax, 0x14
cmp ecx, esi
jne 0x4018f0
mov dword [esp], ebx
call sym.___mingw_GetSectionForAddress
mov edi, eax
test eax, eax
je 0x401a17
mov eax, dword [0x40505c]
lea ebx, [esi + esi*4]
shl ebx, 2
add eax, ebx
mov dword [eax + 0x10], edi
mov dword [eax], 0
call sym.__GetPEImageBase
mov edx, dword [0x40505c]
add eax, dword [edi + 0xc]
mov dword [edx + ebx + 0xc], eax
lea edx, [esp + 0x14]
mov dword [esp + 8], 0x1c
mov dword [esp + 4], edx
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
sub esp, 0xc
test eax, eax
je 0x4019f7
mov eax, dword [esp + 0x28]
lea edx, [eax - 4]
and edx, 0xfffffffb
je 0x401980
lea edx, [eax - 0x40]
and edx, 0xffffffbf
jne 0x401990
add dword [0x405058], 1
add esp, 0x30
pop ebx
pop esi
pop edi
ret
cmp eax, 2
mov edx, 4
mov eax, 0x40
mov ecx, dword [esp + 0x20]
cmove eax, edx
add ebx, dword [0x40505c]
mov edx, dword [esp + 0x14]
mov dword [ebx + 8], ecx
mov dword [ebx + 4], edx
mov dword [esp + 0xc], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], ecx
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
sub esp, 0x10
test eax, eax
jne 0x401980
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], str.__VirtualProtect_failed_with_code_0x_x
mov dword [esp + 4], eax
call sym.___report_error
lea esi, [esi]
lea esi, [esi]
xor esi, esi
jmp 0x40190e
mov eax, dword [0x40505c]
mov eax, dword [eax + ebx + 0xc]
mov dword [esp + 8], eax
mov eax, dword [edi + 8]
mov dword [esp], str.__VirtualQuery_failed_for__d_bytes_at_address__p
mov dword [esp + 4], eax
call sym.___report_error
mov dword [esp + 4], ebx
mov dword [esp], str.Address__p_has_no_image_section
call sym.___report_error
lea esi, [esi]
nop
Function at 0x401f30
Capabilities:
Get thread local storage value

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x1c
mov dword [esp], 0x405074
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ebx, dword [0x40506c]
sub esp, 4
test ebx, ebx
je 0x401f85
mov ebp, dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
lea esi, [esi]
mov eax, dword [ebx]
mov dword [esp], eax
call ebp
mov esi, eax
sub esp, 4
call edi
test esi, esi
je 0x401f7e
test eax, eax
jne 0x401f7e
mov eax, dword [ebx + 4]
mov dword [esp], esi
call eax
mov ebx, dword [ebx + 8]
test ebx, ebx
jne 0x401f60
mov dword [esp], 0x405074
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
add esp, 0x1c
pop ebx
pop esi
pop edi
pop ebp
ret

Function at 0x4022c0
Capabilities:
Parse pe header

Disassembly:
xor eax, eax
cmp word [0x400000], 0x5a4d
jne 0x4022e5
mov ecx, dword [0x40003c]
cmp dword [ecx + 0x400000], 0x4550
lea edx, [ecx + 0x400000]
je 0x4022f0
ret
cmp word [ecx + 0x400018], 0x10b
jne 0x4022e5
push esi
movzx eax, word [ecx + 0x400014]
push ebx
movzx esi, word [ecx + 0x400006]
mov ebx, dword [esp + 0xc]
lea eax, [edx + eax + 0x18]
sub ebx, 0x400000
test si, si
je 0x402338
xor ecx, ecx
mov edx, dword [eax + 0xc]
cmp ebx, edx
jb 0x40232e
add edx, dword [eax + 8]
cmp ebx, edx
jb 0x40233a
add ecx, 1
add eax, 0x28
cmp esi, ecx
jne 0x402320
xor eax, eax
pop ebx
pop esi
ret