joyce8/EMBER2024-capa huggingface dataset:
Function at 0x486d70
Capabilities:
Get file size
Read file on windows

Disassembly:
sub esp, 0x120
mov eax, dword [0x4fe040]
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 sub.api_ms_win_crt_string_l1_1_0.dll__strdup
add esp, 4
mov dword [esp + 0x20], eax
test eax, eax
jne 0x486def
push pe_nt_image_headers32
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00440160
push eax
push edi
push str.schannel:_invalid_path_name_for_CA_file__s:__s
push ebp
call fcn.00453b20
push esi
call dword [0x4fe09c]
add esp, 0x20
lea eax, [ebx + 0x4d]
jmp 0x486f4f
push 0
push 0x80
push 3
push 0
push 1
push accept
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [esp + 0x18], eax
cmp eax, 0xffffffff
jne 0x486e49
push pe_nt_image_headers32
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00440160
push eax
push edi
push str.schannel:_failed_to_open_CA_file__s:__s
push ebp
call fcn.00453b20
push 0
mov esi, 0x4d
call dword [0x4fe09c]
add esp, 0x20
jmp 0x486f41
lea ecx, [esp + 0x24]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x486e89
push pe_nt_image_headers32
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00440160
push eax
push edi
push str.schannel:_failed_to_determine_size_of_CA_file__s:__s
push ebp
call fcn.00453b20
add esp, 0x1c
mov esi, 0x4d
jmp 0x486f2d
mov edi, dword [esp + 0x24]
cmp dword [esp + 0x28], ebx
jl 0x486eb7
jg 0x486e9d
cmp edi, 0x100000
jbe 0x486eb7
push 0x100000
push str.schannel:_CA_file_exceeds_max_size_of__u_bytes
push ebp
call fcn.00453b20
add esp, 0xc
mov esi, 0x4d
jmp 0x486f2d
lea eax, [edi + 1]
push eax
call dword [0x4fe098]
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x486ecf
lea esi, [eax + 0x1b]
jmp 0x486f2d
test edi, edi
je 0x486f14
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 0x486f6c
mov eax, dword [esp + 0x10]
test eax, eax
je 0x486f68
add esi, eax
cmp esi, edi
jb 0x486ee0
push ebp
push dword [esp + 0x18]
mov byte [edi + ebx], 0
push edi
push ebx
push dword [esp + 0x2c]
call fcn.00486b70
add esp, 0x14
mov esi, eax
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call dword [0x4fe09c]
add esp, 4
push dword [esp + 0x20]
call fcn.0048f5ae
add esp, 4
mov eax, esi
mov ecx, dword [esp + 0x12c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0043e7f2
add esp, 0x120
ret
mov edi, esi
jmp 0x486f14
push pe_nt_image_headers32
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00440160
push eax
push dword [esp + 0x24]
push str.schannel:_failed_to_read_from_CA_file__s:__s
push ebp
call fcn.00453b20
add esp, 0x1c
mov esi, 0x4d
jmp 0x486f2d
Function at 0x48d9f0
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 [0x4fe098]
mov edi, eax
add esp, 4
test edi, edi
jne 0x48da17
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 0x48da62
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 0x48da66
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 0x48dac6
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 0x48da85
mov ebx, dword [esp + 0x10]
cmp ebx, dword [esi + 0x10]
jae 0x48daf7
nop dword [eax + eax]
mov eax, dword [esi + 4]
push 1
push 0x49dde4
push dword [edi + 4]
call eax
mov eax, dword [esi + 4]
push 1
push 0x49dde5
push dword [edi + 8]
call eax
inc ebx
add esp, 0x18
cmp ebx, dword [esi + 0x10]
jb 0x48dad0
pop ebp
pop ebx
mov eax, edi
pop edi
pop esi
pop ecx
ret
Function at 0x48db00
Capabilities:
Authenticate hmac
Encode data using xor

Disassembly:
push ecx
push ebx
push ebp
push esi
push edi
push dword [esp + 0x20]
call fcn.00456500
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 [0x4fe098]
mov edi, eax
add esp, 8
test edi, edi
je 0x48dc68
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 0x48db7c
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 0x48dbe1
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 0x48dba0
mov ebx, dword [esp + 0x18]
cmp ebx, dword [esi + 0x10]
jae 0x48dc0d
mov eax, dword [esi + 4]
push 1
push 0x49dde4
push dword [edi + 4]
call eax
mov eax, dword [esi + 4]
push 1
push 0x49dde5
push dword [edi + 8]
call eax
inc ebx
add esp, 0x18
cmp ebx, dword [esi + 0x10]
jb 0x48dbe6
push dword [esp + 0x28]
call fcn.00456500
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 0x48dc38
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 [0x4fe09c]
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 0x402d18
Capabilities:
Generate random numbers using the delphi lcg

Disassembly:
push ebx
xor ebx, ebx
imul edx, dword [ebx + 0x431008], 0x8088405
inc edx
mov dword [ebx + 0x431008], edx
mul edx
mov eax, edx
pop ebx
ret

Function at 0x41c300
Capabilities:
Decompress data using aplib

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffff4
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push ebp
mov esi, dword [ebp - 4]
mov edi, dword [ebp - 8]
cld
mov dl, 0x80
mov al, byte [esi]
add esi, 1
mov byte [edi], al
add edi, 1
mov ebx, 2
add dl, dl
jne 0x41c331
mov dl, byte [esi]
inc esi
adc dl, dl
jae 0x41c319
add dl, dl
jne 0x41c33c
mov dl, byte [esi]
inc esi
adc dl, dl
jae 0x41c38d
xor eax, eax
add dl, dl
jne 0x41c349
mov dl, byte [esi]
inc esi
adc dl, dl
jae 0x41c42a
add dl, dl
jne 0x41c358
mov dl, byte [esi]
inc esi
adc dl, dl
adc eax, eax
add dl, dl
jne 0x41c363
mov dl, byte [esi]
inc esi
adc dl, dl
adc eax, eax
add dl, dl
jne 0x41c36e
mov dl, byte [esi]
inc esi
adc dl, dl
adc eax, eax
add dl, dl
jne 0x41c379
mov dl, byte [esi]
inc esi
adc dl, dl
adc eax, eax
je 0x41c383
mov ebx, edi
sub ebx, eax
mov al, byte [ebx]
mov byte [edi], al
inc edi
mov ebx, 2
jmp 0x41c328
mov eax, 1
add dl, dl
jne 0x41c39b
mov dl, byte [esi]
inc esi
adc dl, dl
adc eax, eax
add dl, dl
jne 0x41c3a6
mov dl, byte [esi]
inc esi
adc dl, dl
jb 0x41c392
sub eax, ebx
mov ebx, 1
jne 0x41c3d9
mov ecx, 1
add dl, dl
jne 0x41c3bf
mov dl, byte [esi]
inc esi
adc dl, dl
adc ecx, ecx
add dl, dl
jne 0x41c3ca
mov dl, byte [esi]
inc esi
adc dl, dl
jb 0x41c3b6
push esi
mov esi, edi
sub esi, ebp
rep movsb byte es:[edi], byte [esi]
pop esi
jmp 0x41c328
dec eax
shl eax, 8
mov al, byte [esi]
inc esi
mov ebp, eax
mov ecx, 1
add dl, dl
jne 0x41c3f0
mov dl, byte [esi]
inc esi
adc dl, dl
adc ecx, ecx
add dl, dl
jne 0x41c3fb
mov dl, byte [esi]
inc esi
adc dl, dl
jb 0x41c3e7
cmp eax, 0x7d00
sbb ecx, 0xffffffff
cmp eax, 0x500
sbb ecx, 0xffffffff
cmp eax, 0x80
adc ecx, 0
cmp eax, 0x80
adc ecx, 0
push esi
mov esi, edi
sub esi, eax
rep movsb byte es:[edi], byte [esi]
pop esi
jmp 0x41c328
mov al, byte [esi]
inc esi
xor ecx, ecx
shr al, 1
je 0x41c44b
adc ecx, 2
mov ebp, eax
push esi
mov esi, edi
sub esi, eax
rep movsb byte es:[edi], byte [esi]
pop esi
mov ebx, 1
jmp 0x41c328
pop ebp
sub edi, dword [ebp - 8]
mov dword [ebp - 0xc], edi
pop edi
pop esi
pop ebx
mov eax, dword [ebp - 0xc]
mov esp, ebp
pop ebp
ret
Function at 0x41d390
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffff4
push ebx
push esi
push edi
mov ebx, dword [ebp + 8]
xor eax, eax
mov dword [ebp - 4], eax
mov ecx, ebx
mov eax, ebx
xor edx, edx
push edx
push eax
mov eax, dword [ecx + 0x3c]
cdq
add eax, dword [esp]
adc edx, dword [esp + 4]
add esp, 8
mov eax, dword [eax + 0x78]
add eax, ebx
mov esi, dword [eax + 0x18]
mov edx, dword [eax + 0x1c]
add edx, ebx
mov dword [ebp - 0xc], edx
mov edi, dword [eax + 0x20]
add edi, ebx
mov edx, dword [eax + 0x24]
add edx, ebx
mov dword [ebp - 8], edx
mov edx, dword [ebp + 0xc]
cmp edx, 0xffff
jbe 0x41d414
test esi, esi
jbe 0x41d42b
mov eax, dword [edi]
add eax, ebx
mov edx, dword [ebp + 0xc]
call fcn.004080c8
test eax, eax
jne 0x41d406
mov eax, dword [ebp - 8]
movzx eax, word [eax]
shl eax, 2
add eax, dword [ebp - 0xc]
mov eax, dword [eax]
mov dword [ebp - 4], eax
jmp 0x41d42b
add dword [ebp - 8], 2
add edi, 4
dec esi
test esi, esi
ja 0x41d3e3
jmp 0x41d42b
mov ecx, edx
sub ecx, dword [eax + 0x10]
cmp ecx, dword [eax + 0x14]
jae 0x41d42b
mov eax, ecx
shl eax, 2
add eax, dword [ebp - 0xc]
mov eax, dword [eax]
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
Function at 0x41dc5c
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffff4
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0xc], ebx
mov word [ebp - 4], cx
mov byte [ebp - 1], dl
xor eax, eax
push ebp
push 0x41de6d
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp + 8]
call fcn.00404460
xor ebx, ebx
mov eax, ebx
and eax, 0x80000001
jns 0x41dc97
dec eax
or eax, 0xfffffffe
inc eax
test eax, eax
jne 0x41dcb0
lea eax, [ebp - 0xc]
mov edx, dword [0x43319c]
mov edx, dword [edx]
mov edx, dword [edx + 0x10]
call fcn.004044c0
jmp 0x41dcc3
lea eax, [ebp - 0xc]
mov edx, dword [0x43319c]
mov edx, dword [edx]
mov edx, dword [edx + 0x14]
call fcn.004044c0
lea eax, [ebp - 0xc]
mov edx, ebx
sar edx, 1
jns 0x41dccf
adc edx, 0
mov edx, dword [edx*4 + 0x431cbc]
call fcn.004046b0
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
mov eax, dword [ebp - 0xc]
call fcn.00404694
push eax
call fcn.004062cc
mov esi, eax
cmp esi, 0xffffffff
je 0x41de3f
mov eax, 0x40
call fcn.004029bc
mov edi, eax
push 0
lea eax, [ebp - 8]
push eax
push 0x40
push edi
push esi
call fcn.00406504
test eax, eax
je 0x41de32
mov eax, edi
cmp word [eax], 0x5a4d
jne 0x41de32
push 0
push 0
mov eax, dword [eax + 0x3c]
push eax
push esi
call fcn.0040654c
mov eax, edi
call fcn.004029ec
mov eax, 0x18
call fcn.004029bc
mov edi, eax
push 0
lea eax, [ebp - 8]
push eax
push 0x18
push edi
push esi
call fcn.00406504
test eax, eax
je 0x41de32
mov eax, edi
cmp dword [eax], 0x4550
jne 0x41de32
add eax, 4
cmp byte [ebp - 1], 0
je 0x41ddd6
cmp word [eax], 0x8664
jne 0x41ddd6
mov eax, edi
call fcn.004029ec
mov eax, 0xf0
call fcn.004029bc
mov edi, eax
push 0
lea eax, [ebp - 8]
push eax
push 0xf0
push edi
push esi
call fcn.00406504
test eax, eax
je 0x41de32
mov eax, edi
mov dx, word [eax + 0x44]
cmp dx, word [ebp - 4]
jne 0x41de32
mov eax, dword [eax + 0x10]
mov edx, dword [ebp + 0xc]
mov dword [edx], eax
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0xc]
call fcn.0040449c
jmp 0x41de32
cmp byte [ebp - 1], 0
jne 0x41de32
cmp word [eax], 0x14c
jb 0x41de32
cmp word [eax], 0x150
ja 0x41de32
mov eax, edi
call fcn.004029ec
mov eax, 0xe0
call fcn.004029bc
mov edi, eax
push 0
lea eax, [ebp - 8]
push eax
push 0xe0
push edi
push esi
call fcn.00406504
test eax, eax
je 0x41de32
mov eax, edi
mov dx, word [eax + 0x44]
cmp dx, word [ebp - 4]
jne 0x41de32
mov eax, dword [eax + 0x10]
mov edx, dword [ebp + 0xc]
mov dword [edx], eax
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0xc]
call fcn.0040449c
mov eax, edi
call fcn.004029ec
push esi
call fcn.00406284
mov eax, dword [ebp + 8]
mov eax, dword [eax]
xor edx, edx
call fcn.004047c0
jne 0x41de57
inc ebx
cmp ebx, 0x19
jne 0x41dc89
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x41de74
lea eax, [ebp - 0xc]
call fcn.00404460
ret
Function at 0x41e138
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffe4
push ebx
push esi
push edi
mov esi, ecx
mov edi, edx
xor ebx, ebx
push 0
push 0
push 0
push edi
call fcn.0040654c
push 0
lea eax, [ebp - 4]
push eax
push 0x40
push esi
push edi
call fcn.00406504
test eax, eax
je 0x41e1d5
cmp word [esi], 0x5a4d
jne 0x41e1d5
push 0
push 0
mov eax, dword [esi + 0x3c]
push eax
push edi
call fcn.0040654c
push 0
lea eax, [ebp - 4]
push eax
push 0x18
lea eax, [ebp - 0x1c]
push eax
push edi
call fcn.00406504
test eax, eax
je 0x41e1d5
cmp dword [ebp - 0x1c], 0x4550
jne 0x41e1d5
lea edx, [ebp - 0x18]
mov ecx, 0x14
mov eax, dword [ebp + 0xc]
call fcn.00406630
mov ax, word [ebp - 0x18]
cmp ax, 0x14c
jb 0x41e1d5
cmp ax, 0x150
ja 0x41e1d5
push 0
lea eax, [ebp - 4]
push eax
push 0xe0
mov eax, dword [ebp + 8]
push eax
push edi
call fcn.00406504
test eax, eax
je 0x41e1d5
mov bl, 1
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8

Function at 0x424360
Capabilities:
Parse pe header

Disassembly:
push ebx
xor ecx, ecx
test edx, edx
je 0x424388
mov ebx, edx
mov eax, ebx
cmp word [eax], 0x5a4d
jne 0x424388
add ebx, dword [eax + 0x3c]
mov eax, ebx
cmp dword [eax], 0x4550
jne 0x424388
cmp word [eax + 0x18], 0x20b
sete cl
mov eax, ecx
pop ebx
ret

Function at 0x42438c
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
push ebx
push esi
push edi
mov esi, edx
xor ebx, ebx
test esi, esi
je 0x4243e8
mov edi, esi
push 0x40
push edi
call fcn.004064b4
test eax, eax
jne 0x4243e8
cmp word [edi], 0x5a4d
jne 0x4243e8
mov eax, dword [edi + 0x3c]
test eax, eax
jle 0x4243e8
cmp eax, 0x10000
jge 0x4243e8
add esi, eax
push 0x120
push esi
call fcn.004064b4
test eax, eax
jne 0x4243e8
cmp dword [esi], 0x4550
jne 0x4243e8
mov ax, word [esi + 0x18]
cmp ax, 0x10b
je 0x4243e6
cmp ax, 0x20b
jne 0x4243e8
mov bl, 1
mov eax, ebx
pop edi
pop esi
pop ebx
pop ebp
ret
Function at 0x404ae0
Capabilities:
Get file version info

Disassembly:
sub esp, 8
push ebx
mov ebx, dword [esp + 0x10]
push esi
push edi
mov eax, dword [ebx + 4]
mov dword [esp + 0xc], 0
test eax, eax
jne 0x404afe
mov eax, 0x414160
lea ecx, [esp + 0xc]
push ecx
push eax
call sub.VERSION.dll_GetFileVersionInfoSizeW
mov esi, eax
test esi, esi
jne 0x404b1e
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
pop ebx
add esp, 8
ret 8
push esi
call fcn.004079eb
mov edi, eax
mov eax, dword [ebx + 4]
add esp, 4
test eax, eax
jne 0x404b35
mov eax, 0x414160
push edi
push esi
push 0
push eax
call sub.VERSION.dll_GetFileVersionInfoW
test eax, eax
jne 0x404b52
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
pop ebx
add esp, 8
ret 8
lea edx, [esp + 0x10]
lea eax, [esp + 0x18]
push edx
push eax
push 0x417964
push edi
call sub.VERSION.dll_VerQueryValueW
test eax, eax
je 0x404b82
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
xor esi, esi
mov edx, dword [eax + 8]
mov dword [ecx], edx
mov eax, dword [eax + 0xc]
mov dword [ecx + 4], eax
jmp 0x404b8a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test edi, edi
je 0x404b97
push edi
call fcn.0040621e
add esp, 4
mov eax, esi
pop edi
pop esi
pop ebx
add esp, 8
ret 8

Function at 0x40d359
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1a4
mov edx, dword [ebp + 8]
xor ecx, ecx
mov eax, 0x4186e0
cmp edx, dword [eax]
je 0x40d37b
add eax, 8
inc ecx
cmp eax, 0x418770
jl 0x40d36c
push esi
mov esi, ecx
shl esi, 3
cmp edx, dword [esi + 0x4186e0]
jne 0x40d4a9
mov eax, dword [0x419904]
cmp eax, 1
je 0x40d483
test eax, eax
jne 0x40d3ac
cmp dword [0x417df4], 1
je 0x40d483
cmp edx, 0xfc
je 0x40d4a9
lea eax, [ebp - 0x1a4]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x40d3e3
lea eax, [ebp - 0x1a4]
push str._program_name_unknown_
push eax
call fcn.0040b8a0
pop ecx
pop ecx
lea eax, [ebp - 0x1a4]
push edi
push eax
lea edi, [ebp - 0x1a4]
call fcn.004095a0
inc eax
pop ecx
cmp eax, 0x3c
jbe 0x40d426
lea eax, [ebp - 0x1a4]
push eax
call fcn.004095a0
mov edi, eax
lea eax, [ebp - 0x1a4]
sub eax, 0x3b
push 3
add edi, eax
push 0x414a3c
push edi
call fcn.0040f800
add esp, 0x10
lea eax, [ebp - 0xa0]
push str.Runtime_Error__n_nProgram:
push eax
call fcn.0040b8a0
lea eax, [ebp - 0xa0]
push edi
push eax
call fcn.0040b8b0
lea eax, [ebp - 0xa0]
push 0x414a1c
push eax
call fcn.0040b8b0
push dword [esi + 0x4186e4]
lea eax, [ebp - 0xa0]
push eax
call fcn.0040b8b0
push 0x12010
lea eax, [ebp - 0xa0]
push str.Microsoft_Visual_C_Runtime_Library
push eax
call fcn.00411727
add esp, 0x2c
pop edi
jmp 0x40d4a9
lea eax, [ebp + 8]
lea esi, [esi + 0x4186e4]
push 0
push eax
push dword [esi]
call fcn.004095a0
pop ecx
push eax
push dword [esi]
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
pop esi
leave
ret
Function at 0x1003220
Capabilities:
Enumerate pe sections

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x3c]
add ecx, eax
movzx eax, word [ecx + 0x14]
push ebx
push esi
movzx esi, word [ecx + 6]
xor edx, edx
test esi, esi
push edi
lea eax, [eax + ecx + 0x18]
jbe 0x100325f
mov edi, dword [ebp + 0xc]
mov ecx, dword [eax + 0xc]
cmp edi, ecx
jb 0x1003255
mov ebx, dword [eax + 8]
add ebx, ecx
cmp edi, ebx
jb 0x1003261
add edx, 1
add eax, 0x28
cmp edx, esi
jb 0x1003245
xor eax, eax
pop edi
pop esi
pop ebx
pop ebp
ret

Function at 0x401037
Capabilities:
Delete file
Extract resource via kernel32 functions
Get common file path

Disassembly:
call 0x401037
push 0
call sub.kernel32.dll_ExitProcess
push ebp
mov ebp, esp
add esp, 0xfffffbf4
push esi
push edi
push ebx
push 0
call sub.kernel32.dll_GetModuleHandleA
mov dword [0x403030], eax
mov dword [ebp - 8], 0
push 0xa
push section..data
push 0
call sub.kernel32.dll_FindResourceA
or eax, eax
je 0x401089
mov dword [ebp - 4], eax
push dword [ebp - 4]
push 0
call sub.kernel32.dll_SizeofResource
mov dword [ebp - 0xc], eax
push dword [ebp - 4]
push 0
call sub.kernel32.dll_LoadResource
or eax, eax
je 0x401089
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x4010c1
push 4
push 0x1000
push dword [ebp - 0xc]
push 0
call sub.kernel32.dll_VirtualAlloc
mov edi, eax
push dword [ebp - 0xc]
push dword [ebp - 8]
push edi
call sub.kernel32.dll_RtlMoveMemory
mov dword [ebp - 8], edi
push 0xdeadbeef
push dword [ebp - 0xc]
push dword [ebp - 8]
call section..text
cmp dword [ebp - 8], 0
je 0x4010fb
lea eax, [ebp - 0x40c]
push eax
push 0x400
call sub.kernel32.dll_GetTempPathA
push str.dup2patcher.dll
lea eax, [ebp - 0x40c]
push eax
call sub.kernel32.dll_lstrcatA
push dword [ebp - 0xc]
push dword [ebp - 8]
lea eax, [ebp - 0x40c]
push eax
call fcn.00401184
lea eax, [ebp - 0x40c]
push eax
call sub.kernel32.dll_LoadLibraryA
or eax, eax
je 0x401130
mov ebx, eax
push str.load_patcher
push ebx
call sub.kernel32.dll_GetProcAddress
or eax, eax
je 0x40111e
call eax
push ebx
call sub.kernel32.dll_FreeLibrary
lea eax, [ebp - 0x40c]
push eax
call sub.kernel32.dll_DeleteFileA
pop ebx
pop edi
pop esi
leave
ret

Function at 0x401184
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffff8
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push dword [ebp + 8]
call sub.kernel32.dll_CreateFileA
cmp eax, 0xffffffff
jne 0x4011af
xor eax, eax
leave
ret 0xc
mov dword [ebp - 4], eax
push 0
lea eax, [ebp - 8]
push eax
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp - 4]
call sub.kernel32.dll_WriteFile
push dword [ebp - 4]
call sub.kernel32.dll_FlushFileBuffers
push dword [ebp - 4]
call sub.kernel32.dll_CloseHandle
mov eax, dword [ebp - 8]
leave
ret 0xc