joyce8/EMBER2024-capa huggingface dataset:
Function at 0x405250
Capabilities:
Get file version info

Disassembly:
sub esp, 0xc
push ebp
mov ebp, dword [esp + 0x14]
push esi
mov esi, eax
test esi, esi
je 0x4053a4
cmp byte [esi], 0
je 0x4053a4
test ebp, ebp
je 0x4053a4
mov ecx, dword [esp + 0x1c]
mov edx, ecx
push edi
shr ecx, 2
xor eax, eax
mov edi, ebp
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
lea eax, [esp + 0x14]
push eax
push esi
call sub.VERSION.dll_GetFileVersionInfoSizeA
test eax, eax
mov dword [esp + 0xc], eax
ja 0x4052aa
pop edi
pop esi
mov eax, 1
pop ebp
add esp, 0xc
ret
push ebx
push eax
call fcn.0040c2e2
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x4052c7
pop ebx
pop edi
pop esi
mov eax, 2
pop ebp
add esp, 0xc
ret
mov ecx, dword [esp + 0x10]
mov edx, ecx
shr ecx, 2
xor eax, eax
mov edi, ebx
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
push ebx
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x14]
push eax
push 0
push esi
call sub.VERSION.dll_GetFileVersionInfoA
test eax, eax
jne 0x405305
push ebx
call fcn.0040bf42
add esp, 4
pop ebx
pop edi
pop esi
mov eax, 3
pop ebp
add esp, 0xc
ret
lea ecx, [esp + 0x10]
push ecx
lea edx, [esp + 0x18]
push edx
push str.VarFileInfoTranslation
push ebx
call sub.VERSION.dll_VerQueryValueA
mov ecx, dword [esp + 0x10]
test ecx, ecx
jbe 0x40538e
test eax, eax
je 0x40538e
mov eax, dword [esp + 0x24]
push eax
mov eax, dword [esp + 0x18]
xor ecx, ecx
mov cx, word [eax + 2]
mov ax, word [eax]
push 0x4185b4
mov esi, ebp
push ecx
push ebx
call fcn.00405030
mov edi, eax
add esp, 0x10
test edi, edi
jne 0x405372
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x24]
xor ecx, ecx
mov cx, word [eax + 2]
mov ax, word [eax]
push edx
push 0x4185a8
push ecx
push ebx
call fcn.00405030
add esp, 0x10
mov edi, eax
push ebx
call fcn.0040bf42
add esp, 4
xor eax, eax
test edi, edi
setne al
pop ebx
pop edi
pop esi
pop ebp
dec eax
and eax, 0xfffffffe
add esp, 0xc
ret
push ebx
call fcn.0040bf42
add esp, 4
pop ebx
pop edi
pop esi
mov eax, 4
pop ebp
add esp, 0xc
ret
pop esi
or eax, 0xffffffff
pop ebp
add esp, 0xc
ret
Function at 0x4053b0
Capabilities:
Shutdown system

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xb0
push esi
push edi
xor eax, eax
mov ecx, 0x25
lea edi, [esp + 0x20]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x20]
push eax
mov dword [esp + 0x24], 0x94
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
test eax, eax
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
je 0x405449
mov eax, dword [esp + 0x30]
mov edi, 2
cmp eax, edi
jne 0x405449
lea ecx, [esp + 0xc]
push ecx
push 0x28
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x40545f
lea edx, [esp + 0x14]
push edx
push str.SeShutdownPrivilege
push 0
mov dword [esp + 0x1c], 1
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueA]
mov ecx, dword [esp + 0xc]
push 0
push 0
push 0
lea eax, [esp + 0x1c]
push eax
push 0
push ecx
mov dword [esp + 0x34], edi
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
call esi
test eax, eax
jne 0x40546d
push 0
push 6
call dword [sym.imp.USER32.dll_ExitWindowsEx]
test eax, eax
je 0x40546b
call esi
pop edi
pop esi
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
mov esp, ebp
pop ebp
ret
xor eax, eax
pop edi
pop esi
mov esp, ebp
pop ebp
ret
Function at 0x4059a0
Capabilities:
Create process on windows

Disassembly:
sub esp, 0x74
push ebx
push ebp
push edi
xor eax, eax
mov ebp, dword [esp + 0x90]
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
xor ebx, ebx
mov ecx, 0x11
lea edi, [esp + 0x3c]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x2c]
push ecx
mov dword [esp + 0x3c], eax
lea edx, [esp + 0x40]
push edx
mov edx, dword [esp + 0x90]
push ebx
push ebx
mov eax, 0xfffff830
mov dword [esp + 0x5c], eax
mov dword [esp + 0x60], eax
push ebx
mov eax, 0xc
push ebx
mov dword [esp + 0x38], eax
mov dword [esp + 0x2c], eax
lea eax, [esp + 0x2c]
push eax
mov eax, dword [esp + 0xa0]
lea ecx, [esp + 0x3c]
push ecx
push edx
push eax
mov dword [esp + 0x54], ebx
mov dword [esp + 0x64], 0x44
mov dword [esp + 0x90], 5
mov word [esp + 0x94], 7
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x50], 1
mov dword [esp + 0x40], ebx
mov dword [esp + 0x44], ebx
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
jne 0x405a53
pop edi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x74
ret
mov ecx, dword [esp + 0x30]
push esi
xor esi, esi
push ecx
mov dword [esp + 0x18], esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [esp + 0x90], ebx
je 0x405ac0
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
mov dword [esp + 0x10], 0x103
lea esp, [esp]
mov eax, dword [esp + 0x30]
lea edx, [esp + 0x10]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
test eax, eax
je 0x405ad5
cmp dword [esp + 0x10], 0x103
jne 0x405abc
push 0x1f4
call edi
inc esi
cmp ebp, ebx
jle 0x405ab2
lea ecx, [ebp + ebp]
cmp ecx, esi
jl 0x405aef
cmp dword [esp + 0x10], 0x103
je 0x405a80
mov esi, dword [esp + 0x14]
mov edx, dword [esp + 0x30]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x74
ret
mov edx, dword [esp + 0x30]
push edx
mov esi, 1
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x74
ret
mov edx, dword [esp + 0x30]
push edx
mov esi, 2
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
pop esi
pop edi
pop ebp
pop ebx
add esp, 0x74
ret
Function at 0x4089b0
Capabilities:
Link many functions at runtime

Disassembly:
sub esp, 0x24
push esi
xor esi, esi
push edi
push str.advapi32.dll
mov dword [esp + 0x1c], esi
mov byte [esp + 0x28], 0
mov byte [esp + 0x29], 0
mov byte [esp + 0x2a], 0
mov byte [esp + 0x2b], 0
mov byte [esp + 0x2c], 0
mov byte [esp + 0x2d], 5
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], esi
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov edi, eax
cmp edi, esi
je 0x408b35
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push ebx
push ebp
push str.AllocateAndInitializeSid
push edi
call esi
push 0x41a2ec
push edi
mov ebp, eax
call esi
push str.GetTokenInformation
push edi
mov dword [esp + 0x2c], eax
call esi
push str.EqualSid
push edi
mov ebx, eax
call esi
push str.FreeSid
push edi
mov dword [esp + 0x24], eax
call esi
test ebp, ebp
mov dword [esp + 0x28], eax
je 0x408b22
mov esi, dword [esp + 0x24]
test esi, esi
je 0x408b22
test ebx, ebx
je 0x408b22
mov ecx, dword [esp + 0x1c]
test ecx, ecx
je 0x408b22
test eax, eax
je 0x408b22
lea eax, [esp + 0x18]
push eax
push 0
push 0
push 0
push 0
push 0
push 0
push 0x220
push 0x20
push 2
lea ecx, [esp + 0x54]
push ecx
call ebp
lea edx, [esp + 0x14]
push edx
push 8
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call esi
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x10]
push eax
push 0
push 0
push 2
push ecx
call ebx
mov edx, dword [esp + 0x10]
push edx
call fcn.0040c2e2
mov esi, eax
add esp, 4
test esi, esi
je 0x408b0e
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
lea eax, [esp + 0x10]
push eax
push ecx
push esi
push 2
push edx
call ebx
mov eax, dword [esi]
xor ebx, ebx
test eax, eax
jbe 0x408b05
lea ebp, [esi + 4]
nop
mov eax, dword [ebp]
mov ecx, dword [esp + 0x18]
push eax
push ecx
call dword [esp + 0x24]
test eax, eax
jne 0x408afd
mov eax, dword [esi]
inc ebx
add ebp, 8
cmp ebx, eax
jb 0x408ae0
jmp 0x408b05
mov dword [esp + 0x20], 1
push esi
call fcn.0040bf42
add esp, 4
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x18]
push eax
call dword [esp + 0x2c]
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, dword [esp + 0x20]
pop ebp
pop ebx
pop edi
pop esi
add esp, 0x24
ret
pop edi
mov eax, esi
pop esi
add esp, 0x24
ret

Function at 0x408c60
Capabilities:
Set registry value

Disassembly:
sub esp, 8
mov edx, dword [esp + 0x10]
lea eax, [esp + 4]
push eax
mov eax, dword [esp + 0x10]
lea ecx, [esp + 4]
push ecx
push 0
push 0xf003f
push 0
push 0
push 0
push edx
push eax
mov dword [esp + 0x28], 0
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
test eax, eax
jne 0x408cd3
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
push esi
push ecx
mov ecx, dword [esp + 0x1c]
push edx
mov edx, dword [esp + 0xc]
push eax
push 0
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov esi, eax
mov eax, dword [esp + 4]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, esi
neg eax
sbb eax, eax
and eax, 0xfffffffe
pop esi
add esp, 8
ret
or eax, 0xffffffff
add esp, 8
ret
Function at 0x409260
Capabilities:
Enumerate network shares

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x190c
call fcn.0040d080
push ebx
push esi
push edi
xor ebx, ebx
xor eax, eax
mov dword [esp + 0x18], ebx
mov ecx, 0x63f
lea edi, [esp + 0x1c]
rep stosd dword es:[edi], eax
mov ecx, dword [ebp + 8]
lea eax, [esp + 0x10]
push eax
push ecx
push 2
push ebx
push 2
mov dword [esp + 0x24], ebx
call sub.MPR.dll_WNetOpenEnumA
test eax, eax
je 0x4092ae
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea edx, [esp + 0x14]
push edx
mov edx, dword [esp + 0x14]
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x14]
push ecx
push edx
mov dword [esp + 0x1c], 0xffffffff
mov dword [esp + 0x24], 0x1900
call sub.MPR.dll_WNetEnumResourceA
mov esi, eax
cmp esi, ebx
jne 0x4093a4
mov ebx, dword [ebp + 0x10]
mov eax, dword [esp + 0xc]
xor edi, edi
test eax, eax
jbe 0x409371
lea esi, [esp + 0x24]
mov ecx, dword [esi - 4]
test ecx, ecx
je 0x40930e
cmp ecx, 1
jbe 0x409307
cmp ecx, 3
jbe 0x40930e
mov edx, 1
jmp 0x409310
xor edx, edx
mov eax, dword [esi]
and eax, 2
je 0x409334
test edx, edx
je 0x409334
mov eax, dword [ebp + 0xc]
push ebx
push eax
lea ecx, [esi - 0xc]
push ecx
call fcn.00409260
mov al, byte [ebx]
add esp, 0xc
test al, al
jne 0x409371
jmp 0x409351
test eax, eax
je 0x409351
cmp ecx, 2
jne 0x409351
mov edx, dword [ebp + 0xc]
mov eax, dword [esi + 8]
push edx
push eax
call fcn.0040c75e
add esp, 8
test eax, eax
je 0x40935f
mov eax, dword [esp + 0xc]
inc edi
add esi, 0x20
cmp edi, eax
jb 0x4092f6
jmp 0x409371
mov ecx, dword [ebp + 8]
mov ecx, dword [ecx + 0x14]
mov edx, ebx
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
test al, al
jne 0x409367
lea edx, [esp + 0x14]
push edx
mov edx, dword [esp + 0x14]
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x14]
push ecx
push edx
mov dword [esp + 0x1c], 0xffffffff
mov dword [esp + 0x24], 0x1900
call sub.MPR.dll_WNetEnumResourceA
mov esi, eax
test esi, esi
je 0x4092e4
cmp esi, 0x103
jne 0x4093ae
xor esi, esi
mov eax, dword [esp + 0x10]
test eax, eax
je 0x4093bc
push eax
call sub.MPR.dll_WNetCloseEnum
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
Function at 0x40b7c0
Capabilities:
Query environment variable

Disassembly:
sub esp, 0x40
push ebx
mov ebx, dword [esp + 0x48]
push edi
xor eax, eax
test ebx, ebx
mov byte [esp + 8], 0
mov ecx, 0xf
lea edi, [esp + 9]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
je 0x40b915
mov eax, dword [esp + 0x50]
test eax, eax
jne 0x40b91b
push esi
lea esi, [ebx + 0x135]
mov ecx, 0x41
mov edi, esi
rep stosd dword es:[edi], eax
push 0x104
push esi
stosb byte es:[edi], al
mov edi, dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
push str.TEMP
call edi
test eax, eax
jle 0x40b853
cmp eax, 0x104
jae 0x40b853
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40b826
sub eax, edx
cmp byte [eax + ebx + 0x134], 0x5c
je 0x40b8a0
mov edi, esi
dec edi
lea esp, [esp]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40b840
mov ax, word [0x4177a4]
mov word [edi], ax
jmp 0x40b8a0
push 0x104
push esi
push 0x419abc
call edi
test eax, eax
jle 0x40b89a
cmp eax, 0x104
jae 0x40b89a
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40b870
sub eax, edx
cmp byte [eax + ebx + 0x134], 0x5c
je 0x40b8a0
mov edi, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40b886
mov cx, word [0x4177a4]
mov word [edi], cx
jmp 0x40b8a0
mov dword [esi], 0x5c3a43
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40b8a5
sub eax, edx
mov edx, 0x104
sub edx, eax
push edx
push str.KASetup.log
push esi
call fcn.0040ce50
push 0x41b1bc
push esi
call fcn.0040c668
mov esi, eax
add esp, 0x14
test esi, esi
je 0x40b914
lea eax, [esp + 0x50]
push eax
call fcn.0040dcdb
lea ecx, [esp + 0x54]
push ecx
call fcn.0040db5b
push eax
push str._Y__m__d__H:_M:_S
lea edx, [esp + 0x1c]
push 0x40
push edx
call fcn.0040db40
lea eax, [esp + 0x24]
push eax
push str.Installation_start_time:__s_n
push esi
call fcn.0040d262
push esi
call fcn.0040c340
add esp, 0x28
pop esi
pop edi
pop ebx
add esp, 0x40
ret
push 0x105
push eax
add ebx, 0x135
push ebx
call fcn.0040c810
add esp, 0xc
pop edi
pop ebx
add esp, 0x40
ret

Function at 0x40cab8
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
mov edi, dword [ebp + 0x10]
xor ebx, ebx
test edi, edi
jne 0x40cad5
call fcn.0040c96d
mov dword [eax], 0x16
xor eax, eax
jmp 0x40cb3f
push esi
push 0x8c
push 1
call fcn.0040d1a7
mov esi, eax
test esi, esi
pop ecx
pop ecx
je 0x40cb2a
push esi
call fcn.00410c80
mov eax, dword [ebp + 0x14]
or dword [esi + 4], 0xffffffff
mov dword [esi + 0x50], eax
mov eax, dword [ebp + 0x1c]
test eax, eax
pop ecx
mov dword [esi + 0x4c], edi
jne 0x40cb08
lea eax, [ebp + 0x10]
push eax
push dword [ebp + 0x18]
push esi
push 0x40ca23
push dword [ebp + 0xc]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateThread]
test eax, eax
jne 0x40cb3e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
push esi
call fcn.0040bf42
test ebx, ebx
pop ecx
je 0x40cb3c
push ebx
call fcn.0040c97f
pop ecx
xor eax, eax
pop esi
pop edi
pop ebx
pop ebp
ret
Function at 0x40dd5d
Capabilities:
Accept command line arguments
Parse pe header
Terminate process

Disassembly:
push 0x60
push 0x41bb30
call fcn.0040ec44
mov edi, 0x94
mov eax, edi
call fcn.0040d080
mov dword [ebp - 0x18], esp
mov esi, esp
mov dword [esi], edi
push esi
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
mov ecx, dword [esi + 0x10]
mov dword [0x420624], ecx
mov eax, dword [esi + 4]
mov dword [0x420630], eax
mov edx, dword [esi + 8]
mov dword [0x420634], edx
mov esi, dword [esi + 0xc]
and esi, 0x7fff
mov dword [0x420628], esi
cmp ecx, 2
je 0x40ddbd
or esi, 0x8000
mov dword [0x420628], esi
shl eax, 8
add eax, edx
mov dword [0x42062c], eax
xor esi, esi
push esi
mov edi, dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
call edi
cmp word [eax], 0x5a4d
jne 0x40ddf8
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x40ddf8
movzx eax, word [ecx + 0x18]
cmp eax, 0x10b
je 0x40de10
cmp eax, 0x20b
je 0x40ddfd
mov dword [ebp - 0x1c], esi
jmp 0x40de24
cmp dword [ecx + 0x84], 0xe
jbe 0x40ddf8
xor eax, eax
cmp dword [ecx + 0xf8], esi
jmp 0x40de1e
cmp dword [ecx + 0x74], 0xe
jbe 0x40ddf8
xor eax, eax
cmp dword [ecx + 0xe8], esi
setne al
mov dword [ebp - 0x1c], eax
push 1
call fcn.0040df4c
pop ecx
test eax, eax
jne 0x40de38
push 0x1c
call fcn.0040dd39
pop ecx
call fcn.00410e7a
test eax, eax
jne 0x40de49
push 0x10
call fcn.0040dd39
pop ecx
call fcn.004135dc
mov dword [ebp - 4], esi
call fcn.0040fc09
test eax, eax
jge 0x40de62
push 0x1b
call fcn.0040dd14
pop ecx
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov dword [0x421d28], eax
call fcn.004134ba
mov dword [0x42049c], eax
call fcn.00413418
test eax, eax
jge 0x40de88
push 8
call fcn.0040dd14
pop ecx
call fcn.004131e5
test eax, eax
jge 0x40de99
push 9
call fcn.0040dd14
pop ecx
push 1
call fcn.00410fc3
pop ecx
mov dword [ebp - 0x28], eax
cmp eax, esi
je 0x40deaf
push eax
call fcn.0040dd14
pop ecx
mov dword [ebp - 0x44], esi
lea eax, [ebp - 0x70]
push eax
call dword [sym.imp.KERNEL32.dll_GetStartupInfoA]
call fcn.00413188
mov dword [ebp - 0x20], eax
test byte [ebp - 0x44], 1
je 0x40ded0
movzx eax, word [ebp - 0x40]
jmp 0x40ded3
push 0xa
pop eax
push eax
push dword [ebp - 0x20]
push esi
push esi
call edi
push eax
call fcn.00405fe0
mov edi, eax
mov dword [ebp - 0x2c], edi
cmp dword [ebp - 0x1c], esi
jne 0x40def1
push edi
call fcn.004110f0
call fcn.00411112
jmp 0x40df23
or dword [ebp - 4], 0xffffffff
mov eax, edi
lea esp, [ebp - 0x7c]
call fcn.0040ec7f
ret
Function at 0x40eeb2
Capabilities:
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x3a0]
sub esp, 0x420
mov eax, dword [0x41f200]
push edi
xor edi, edi
cmp dword [ebp + 0x3b0], edi
mov dword [ebp + 0x39c], eax
mov dword [ebp - 0x78], edi
mov dword [ebp - 0x7c], edi
jne 0x40eee3
xor eax, eax
jmp 0x40f06c
mov eax, dword [ebp + 0x3a8]
push ebx
mov ebx, dword [ebp + 0x3a8]
and eax, 0x1f
sar ebx, 5
push esi
lea esi, [eax + eax*8]
lea ebx, [ebx*4 + 0x420be0]
mov eax, dword [ebx]
shl esi, 2
test byte [eax + esi + 4], 0x20
je 0x40ef1f
push 2
push edi
push edi
push dword [ebp + 0x3a8]
call fcn.00413dc4
add esp, 0x10
mov eax, dword [ebx]
add eax, esi
test byte [eax + 4], 0x80
je 0x40effa
cmp dword [ebp + 0x3b0], edi
mov eax, dword [ebp + 0x3ac]
mov dword [ebp - 0x74], eax
mov dword [ebp - 0x6c], edi
jbe 0x40f038
mov ecx, dword [ebp - 0x74]
sub ecx, dword [ebp + 0x3ac]
lea eax, [ebp - 0x68]
mov dword [ebp - 0x70], edi
cmp ecx, dword [ebp + 0x3b0]
jae 0x40ef83
mov edx, dword [ebp - 0x74]
inc dword [ebp - 0x74]
mov dl, byte [edx]
inc ecx
cmp dl, 0xa
jne 0x40ef74
inc dword [ebp - 0x7c]
mov byte [eax], 0xd
inc eax
inc dword [ebp - 0x70]
mov byte [eax], dl
inc eax
inc dword [ebp - 0x70]
cmp dword [ebp - 0x70], 0x400
jl 0x40ef54
mov edi, eax
lea eax, [ebp - 0x68]
sub edi, eax
push 0
lea eax, [ebp - 0x80]
push eax
push edi
lea eax, [ebp - 0x68]
push eax
mov eax, dword [ebx]
push dword [eax + esi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40efc3
mov eax, dword [ebp - 0x80]
add dword [ebp - 0x78], eax
cmp eax, edi
jl 0x40efcc
mov eax, dword [ebp - 0x74]
sub eax, dword [ebp + 0x3ac]
xor edi, edi
cmp eax, dword [ebp + 0x3b0]
jb 0x40ef45
jmp 0x40efce
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x6c], eax
xor edi, edi
mov eax, dword [ebp - 0x78]
cmp eax, edi
jne 0x40f067
cmp dword [ebp - 0x6c], edi
je 0x40f038
push 5
pop esi
cmp dword [ebp - 0x6c], esi
jne 0x40f02d
call fcn.0040c96d
mov dword [eax], 9
call fcn.0040c976
mov dword [eax], esi
jmp 0x40f062
push edi
lea ecx, [ebp - 0x80]
push ecx
push dword [ebp + 0x3b0]
push dword [ebp + 0x3ac]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40f022
mov eax, dword [ebp - 0x80]
mov dword [ebp - 0x6c], edi
mov dword [ebp - 0x78], eax
jmp 0x40efce
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x6c], eax
jmp 0x40efce
push dword [ebp - 0x6c]
call fcn.0040c97f
pop ecx
jmp 0x40f062
mov eax, dword [ebx]
test byte [eax + esi + 4], 0x40
je 0x40f050
mov eax, dword [ebp + 0x3ac]
cmp byte [eax], 0x1a
jne 0x40f050
xor eax, eax
jmp 0x40f06a
call fcn.0040c96d
mov dword [eax], 0x1c
call fcn.0040c976
mov dword [eax], edi
or eax, 0xffffffff
jmp 0x40f06a
sub eax, dword [ebp - 0x7c]
pop esi
pop ebx
mov ecx, dword [ebp + 0x39c]
pop edi
call fcn.00413e78
add ebp, 0x3a0
leave
ret
Function at 0x40f81f
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
and dword [ebp - 8], 0
cmp dword [ebp + 0x10], 0
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
mov edx, ebx
je 0x40f9f3
mov eax, dword [ebp + 8]
mov ecx, eax
and eax, 0x1f
sar ecx, 5
lea esi, [eax + eax*8]
lea edi, [ecx*4 + 0x420be0]
mov eax, dword [edi]
shl esi, 2
add eax, esi
mov cl, byte [eax + 4]
test cl, 2
jne 0x40f9f3
test cl, 0x48
je 0x40f88a
cmp byte [eax + 5], 0xa
je 0x40f88a
mov eax, dword [edi]
mov al, byte [eax + esi + 5]
dec dword [ebp + 0x10]
mov byte [ebx], al
mov eax, dword [edi]
lea edx, [ebx + 1]
mov dword [ebp - 8], 1
mov byte [eax + esi + 5], 0xa
push 0
lea eax, [ebp - 0xc]
push eax
push dword [ebp + 0x10]
mov eax, dword [edi]
push edx
push dword [eax + esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40f8dc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 5
pop esi
cmp eax, esi
jne 0x40f8c4
call fcn.0040c96d
mov dword [eax], 9
call fcn.0040c976
mov dword [eax], esi
jmp 0x40f8d4
cmp eax, 0x6d
je 0x40f9f3
push eax
call fcn.0040c97f
pop ecx
or eax, 0xffffffff
jmp 0x40f9f5
mov eax, dword [ebp - 0xc]
mov ecx, dword [edi]
add dword [ebp - 8], eax
test byte [ecx + esi + 4], 0x80
je 0x40f9ee
test eax, eax
je 0x40f903
cmp byte [ebx], 0xa
jne 0x40f903
mov eax, ecx
lea eax, [eax + esi + 4]
or byte [eax], 4
jmp 0x40f90c
mov eax, dword [edi]
lea eax, [eax + esi + 4]
and byte [eax], 0xfb
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 8]
add ecx, eax
cmp eax, ecx
mov dword [ebp + 0x10], eax
mov dword [ebp - 8], ecx
jae 0x40f9e8
mov eax, dword [ebp + 0x10]
mov al, byte [eax]
cmp al, 0x1a
je 0x40f9d8
cmp al, 0xd
je 0x40f93e
mov byte [ebx], al
inc ebx
inc dword [ebp + 0x10]
jmp 0x40f9ca
dec ecx
cmp dword [ebp + 0x10], ecx
jae 0x40f958
mov eax, dword [ebp + 0x10]
inc eax
cmp byte [eax], 0xa
jne 0x40f953
add dword [ebp + 0x10], 2
jmp 0x40f9ac
mov dword [ebp + 0x10], eax
jmp 0x40f9c6
inc dword [ebp + 0x10]
push 0
lea eax, [ebp - 0xc]
push eax
push 1
lea eax, [ebp - 1]
push eax
mov eax, dword [edi]
push dword [eax + esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40f980
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x40f9c6
cmp dword [ebp - 0xc], 0
je 0x40f9c6
mov eax, dword [edi]
test byte [eax + esi + 4], 0x48
je 0x40f9a1
mov al, byte [ebp - 1]
cmp al, 0xa
je 0x40f9ac
mov byte [ebx], 0xd
mov ecx, dword [edi]
mov byte [ecx + esi + 5], al
jmp 0x40f9c9
cmp ebx, dword [ebp + 0xc]
jne 0x40f9b1
cmp byte [ebp - 1], 0xa
jne 0x40f9b1
mov byte [ebx], 0xa
jmp 0x40f9c9
push 1
push 0xffffffffffffffff
push dword [ebp + 8]
call fcn.0040fe07
add esp, 0xc
cmp byte [ebp - 1], 0xa
je 0x40f9ca
mov byte [ebx], 0xd
inc ebx
mov ecx, dword [ebp - 8]
cmp dword [ebp + 0x10], ecx
jb 0x40f922
jmp 0x40f9e8
mov eax, dword [edi]
test byte [eax + esi + 4], 0x40
jne 0x40f9e8
lea esi, [eax + esi + 4]
or byte [esi], 2
sub ebx, dword [ebp + 0xc]
mov dword [ebp - 8], ebx
mov eax, dword [ebp - 8]
jmp 0x40f9f5
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret