joyce8/EMBER2024-capa huggingface dataset:
Function at 0x402e90
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 0x402fe4
cmp byte [esi], 0
je 0x402fe4
test ebp, ebp
je 0x402fe4
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 0x402eea
pop edi
pop esi
mov eax, 1
pop ebp
add esp, 0xc
ret
push ebx
push eax
call fcn.00409552
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x402f07
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 0x402f45
push ebx
call fcn.004091b2
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 0x402fce
test eax, eax
je 0x402fce
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 0x414cdc
mov esi, ebp
push ecx
push ebx
call fcn.00402c70
mov edi, eax
add esp, 0x10
test edi, edi
jne 0x402fb2
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 0x414cd0
push ecx
push ebx
call fcn.00402c70
add esp, 0x10
mov edi, eax
push ebx
call fcn.004091b2
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.004091b2
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 0x402ff0
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 0x403089
mov eax, dword [esp + 0x30]
mov edi, 2
cmp eax, edi
jne 0x403089
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 0x40309f
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 0x4030ad
push 0
push 6
call dword [sym.imp.USER32.dll_ExitWindowsEx]
test eax, eax
je 0x4030ab
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 0x4035e0
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 0x403693
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 0x403700
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 0x403715
cmp dword [esp + 0x10], 0x103
jne 0x4036fc
push 0x1f4
call edi
inc esi
cmp ebp, ebx
jle 0x4036f2
lea ecx, [ebp + ebp]
cmp ecx, esi
jl 0x40372f
cmp dword [esp + 0x10], 0x103
je 0x4036c0
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 0x405f40
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 0x4060c5
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push ebx
push ebp
push str.AllocateAndInitializeSid
push edi
call esi
push 0x416c24
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 0x4060b2
mov esi, dword [esp + 0x24]
test esi, esi
je 0x4060b2
test ebx, ebx
je 0x4060b2
mov ecx, dword [esp + 0x1c]
test ecx, ecx
je 0x4060b2
test eax, eax
je 0x4060b2
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.00409552
mov esi, eax
add esp, 4
test esi, esi
je 0x40609e
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 0x406095
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 0x40608d
mov eax, dword [esi]
inc ebx
add ebp, 8
cmp ebx, eax
jb 0x406070
jmp 0x406095
mov dword [esp + 0x20], 1
push esi
call fcn.004091b2
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 0x4061f0
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 0x406263
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 0x4067b0
Capabilities:
Enumerate network shares

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x190c
call fcn.00409ef0
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 0x4067fe
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 0x4068f4
mov ebx, dword [ebp + 0x10]
mov eax, dword [esp + 0xc]
xor edi, edi
test eax, eax
jbe 0x4068c1
lea esi, [esp + 0x24]
mov ecx, dword [esi - 4]
test ecx, ecx
je 0x40685e
cmp ecx, 1
jbe 0x406857
cmp ecx, 3
jbe 0x40685e
mov edx, 1
jmp 0x406860
xor edx, edx
mov eax, dword [esi]
and eax, 2
je 0x406884
test edx, edx
je 0x406884
mov eax, dword [ebp + 0xc]
push ebx
push eax
lea ecx, [esi - 0xc]
push ecx
call fcn.004067b0
mov al, byte [ebx]
add esp, 0xc
test al, al
jne 0x4068c1
jmp 0x4068a1
test eax, eax
je 0x4068a1
cmp ecx, 2
jne 0x4068a1
mov edx, dword [ebp + 0xc]
mov eax, dword [esi + 8]
push edx
push eax
call fcn.0041309b
add esp, 8
test eax, eax
je 0x4068af
mov eax, dword [esp + 0xc]
inc edi
add esi, 0x20
cmp edi, eax
jb 0x406846
jmp 0x4068c1
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 0x4068b7
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 0x406834
cmp esi, 0x103
jne 0x4068fe
xor esi, esi
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40690c
push eax
call sub.MPR.dll_WNetCloseEnum
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
Function at 0x408a40
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 0x408b95
mov eax, dword [esp + 0x50]
test eax, eax
jne 0x408b9b
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 0x408ad3
cmp eax, 0x104
jae 0x408ad3
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408aa6
sub eax, edx
cmp byte [eax + ebx + 0x134], 0x5c
je 0x408b20
mov edi, esi
dec edi
lea esp, [esp]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x408ac0
mov ax, word [0x4162ac]
mov word [edi], ax
jmp 0x408b20
push 0x104
push esi
push 0x4162a8
call edi
test eax, eax
jle 0x408b1a
cmp eax, 0x104
jae 0x408b1a
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408af0
sub eax, edx
cmp byte [eax + ebx + 0x134], 0x5c
je 0x408b20
mov edi, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x408b06
mov cx, word [0x4162ac]
mov word [edi], cx
jmp 0x408b20
mov dword [esi], 0x5c3a43
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408b25
sub eax, edx
mov edx, 0x104
sub edx, eax
push edx
push str.KASetup.log
push esi
call fcn.00409c00
push 0x4179c8
push esi
call fcn.004098d8
mov esi, eax
add esp, 0x14
test esi, esi
je 0x408b94
lea eax, [esp + 0x50]
push eax
call fcn.0040af0c
lea ecx, [esp + 0x54]
push ecx
call fcn.0040ad8c
push eax
push str._H:_M:_S__b__d__Y
lea edx, [esp + 0x1c]
push 0x40
push edx
call fcn.0040ad71
lea eax, [esp + 0x24]
push eax
push str.Installation_start_time:__s_n
push esi
call fcn.0040a495
push esi
call fcn.004095b0
add esp, 0x28
pop esi
pop edi
pop ebx
add esp, 0x40
ret
push 0x105
push eax
add ebx, 0x135
push ebx
call fcn.004098f0
add esp, 0xc
pop edi
pop ebx
add esp, 0x40
ret

Function at 0x409b32
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 0x409b4f
call fcn.00409e5d
mov dword [eax], 0x16
xor eax, eax
jmp 0x409bb9
push esi
push 0x8c
push 1
call fcn.0040a252
mov esi, eax
test esi, esi
pop ecx
pop ecx
je 0x409ba4
push esi
call fcn.0040dc42
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 0x409b82
lea eax, [ebp + 0x10]
push eax
push dword [ebp + 0x18]
push esi
push 0x409a9d
push dword [ebp + 0xc]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateThread]
test eax, eax
jne 0x409bb8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
push esi
call fcn.004091b2
test ebx, ebx
pop ecx
je 0x409bb6
push ebx
call fcn.00409e6f
pop ecx
xor eax, eax
pop esi
pop edi
pop ebx
pop ebp
ret
Function at 0x40af8e
Capabilities:
Accept command line arguments
Parse pe header
Terminate process

Disassembly:
push 0x60
push 0x418418
call fcn.0040be78
mov edi, 0x94
mov eax, edi
call fcn.00409ef0
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 [0x41d0d0], ecx
mov eax, dword [esi + 4]
mov dword [0x41d0dc], eax
mov edx, dword [esi + 8]
mov dword [0x41d0e0], edx
mov esi, dword [esi + 0xc]
and esi, 0x7fff
mov dword [0x41d0d4], esi
cmp ecx, 2
je 0x40afee
or esi, 0x8000
mov dword [0x41d0d4], esi
shl eax, 8
add eax, edx
mov dword [0x41d0d8], eax
xor esi, esi
push esi
mov edi, dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
call edi
cmp word [eax], 0x5a4d
jne 0x40b029
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x40b029
movzx eax, word [ecx + 0x18]
cmp eax, 0x10b
je 0x40b041
cmp eax, 0x20b
je 0x40b02e
mov dword [ebp - 0x1c], esi
jmp 0x40b055
cmp dword [ecx + 0x84], 0xe
jbe 0x40b029
xor eax, eax
cmp dword [ecx + 0xf8], esi
jmp 0x40b04f
cmp dword [ecx + 0x74], 0xe
jbe 0x40b029
xor eax, eax
cmp dword [ecx + 0xe8], esi
setne al
mov dword [ebp - 0x1c], eax
push 1
call fcn.0040b17d
pop ecx
test eax, eax
jne 0x40b069
push 0x1c
call fcn.0040af6a
pop ecx
call fcn.0040de3c
test eax, eax
jne 0x40b07a
push 0x10
call fcn.0040af6a
pop ecx
call fcn.0041088d
mov dword [ebp - 4], esi
call fcn.0040ce2b
test eax, eax
jge 0x40b093
push 0x1b
call fcn.0040af45
pop ecx
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov dword [0x41e7c8], eax
call fcn.0041076b
mov dword [0x41cf54], eax
call fcn.004106c9
test eax, eax
jge 0x40b0b9
push 8
call fcn.0040af45
pop ecx
call fcn.00410496
test eax, eax
jge 0x40b0ca
push 9
call fcn.0040af45
pop ecx
push 1
call fcn.0040df85
pop ecx
mov dword [ebp - 0x28], eax
cmp eax, esi
je 0x40b0e0
push eax
call fcn.0040af45
pop ecx
mov dword [ebp - 0x44], esi
lea eax, [ebp - 0x70]
push eax
call dword [sym.imp.KERNEL32.dll_GetStartupInfoA]
call fcn.00410439
mov dword [ebp - 0x20], eax
test byte [ebp - 0x44], 1
je 0x40b101
movzx eax, word [ebp - 0x40]
jmp 0x40b104
push 0xa
pop eax
push eax
push dword [ebp - 0x20]
push esi
push esi
call edi
push eax
call fcn.00403750
mov edi, eax
mov dword [ebp - 0x2c], edi
cmp dword [ebp - 0x1c], esi
jne 0x40b122
push edi
call fcn.0040e0b2
call fcn.0040e0d4
jmp 0x40b154
or dword [ebp - 4], 0xffffffff
mov eax, edi
lea esp, [ebp - 0x7c]
call fcn.0040beb3
ret
Function at 0x40c0e6
Capabilities:
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x3a4]
sub esp, 0x424
mov eax, dword [0x41bec0]
xor ecx, ecx
xor eax, ebp
cmp dword [ebp + 0x3b4], ecx
push edi
mov edi, dword [ebp + 0x3b0]
mov dword [ebp + 0x3a0], eax
mov dword [ebp - 0x7c], edi
mov dword [ebp - 0x74], ecx
mov dword [ebp - 0x78], ecx
jne 0x40c122
xor eax, eax
jmp 0x40c28c
mov eax, dword [ebp + 0x3ac]
push ebx
mov ebx, dword [ebp + 0x3ac]
and eax, 0x1f
sar ebx, 5
push esi
lea esi, [eax + eax*8]
lea ebx, [ebx*4 + 0x41d680]
mov eax, dword [ebx]
shl esi, 2
test byte [eax + esi + 4], 0x20
je 0x40c160
push 2
push ecx
push ecx
push dword [ebp + 0x3ac]
call fcn.00411074
add esp, 0x10
xor ecx, ecx
mov eax, dword [ebx]
add eax, esi
test byte [eax + 4], 0x80
je 0x40c1fa
cmp dword [ebp + 0x3b4], ecx
mov dword [ebp - 0x70], edi
mov dword [ebp - 0x68], ecx
jbe 0x40c25d
jmp 0x40c184
xor ecx, ecx
mov dword [ebp - 0x6c], ecx
mov ecx, dword [ebp - 0x70]
sub ecx, dword [ebp - 0x7c]
lea eax, [ebp - 0x64]
cmp ecx, dword [ebp + 0x3b4]
jae 0x40c1bf
mov edx, dword [ebp - 0x70]
inc dword [ebp - 0x70]
mov dl, byte [edx]
inc ecx
cmp dl, 0xa
jne 0x40c1b0
inc dword [ebp - 0x78]
mov byte [eax], 0xd
inc eax
inc dword [ebp - 0x6c]
mov byte [eax], dl
inc eax
inc dword [ebp - 0x6c]
cmp dword [ebp - 0x6c], 0x400
jl 0x40c190
mov edi, eax
lea eax, [ebp - 0x64]
sub edi, eax
push 0
lea eax, [ebp - 0x80]
push eax
push edi
lea eax, [ebp - 0x64]
push eax
mov eax, dword [ebx]
push dword [eax + esi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40c21e
mov eax, dword [ebp - 0x80]
add dword [ebp - 0x74], eax
cmp eax, edi
jl 0x40c227
mov eax, dword [ebp - 0x70]
sub eax, dword [ebp - 0x7c]
cmp eax, dword [ebp + 0x3b4]
jb 0x40c182
jmp 0x40c227
push ecx
lea ecx, [ebp - 0x80]
push ecx
push dword [ebp + 0x3b4]
push edi
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40c21e
mov eax, dword [ebp - 0x80]
and dword [ebp - 0x68], 0
mov dword [ebp - 0x74], eax
jmp 0x40c227
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x68], eax
mov eax, dword [ebp - 0x74]
test eax, eax
jne 0x40c287
cmp dword [ebp - 0x68], eax
je 0x40c25a
push 5
pop esi
cmp dword [ebp - 0x68], esi
jne 0x40c24f
call fcn.00409e5d
mov dword [eax], 9
call fcn.00409e66
mov dword [eax], esi
jmp 0x40c282
push dword [ebp - 0x68]
call fcn.00409e6f
pop ecx
jmp 0x40c282
mov edi, dword [ebp - 0x7c]
mov eax, dword [ebx]
test byte [eax + esi + 4], 0x40
je 0x40c26f
cmp byte [edi], 0x1a
jne 0x40c26f
xor eax, eax
jmp 0x40c28a
call fcn.00409e5d
mov dword [eax], 0x1c
call fcn.00409e66
and dword [eax], 0
or eax, 0xffffffff
jmp 0x40c28a
sub eax, dword [ebp - 0x78]
pop esi
pop ebx
mov ecx, dword [ebp + 0x3a0]
xor ecx, ebp
pop edi
call fcn.00411128
add ebp, 0x3a4
leave
ret
Function at 0x40ca3f
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 0x40cc15
mov eax, dword [ebp + 8]
mov ecx, eax
and eax, 0x1f
sar ecx, 5
lea esi, [eax + eax*8]
lea edi, [ecx*4 + 0x41d680]
mov eax, dword [edi]
shl esi, 2
add eax, esi
mov cl, byte [eax + 4]
test cl, 2
jne 0x40cc15
test cl, 0x48
je 0x40caaa
cmp byte [eax + 5], 0xa
je 0x40caaa
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 0x40cafc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 5
pop esi
cmp eax, esi
jne 0x40cae4
call fcn.00409e5d
mov dword [eax], 9
call fcn.00409e66
mov dword [eax], esi
jmp 0x40caf4
cmp eax, 0x6d
je 0x40cc15
push eax
call fcn.00409e6f
pop ecx
or eax, 0xffffffff
jmp 0x40cc17
mov eax, dword [ebp - 0xc]
mov ecx, dword [edi]
add dword [ebp - 8], eax
test byte [ecx + esi + 4], 0x80
je 0x40cc10
test eax, eax
je 0x40cb23
cmp byte [ebx], 0xa
jne 0x40cb23
mov eax, ecx
lea eax, [eax + esi + 4]
or byte [eax], 4
jmp 0x40cb2c
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 0x40cc0a
mov eax, dword [ebp + 0x10]
mov al, byte [eax]
cmp al, 0x1a
je 0x40cbfa
cmp al, 0xd
je 0x40cb5e
mov byte [ebx], al
inc ebx
inc dword [ebp + 0x10]
jmp 0x40cbec
dec ecx
cmp dword [ebp + 0x10], ecx
jae 0x40cb78
mov eax, dword [ebp + 0x10]
inc eax
cmp byte [eax], 0xa
jne 0x40cb73
add dword [ebp + 0x10], 2
jmp 0x40cbcc
mov dword [ebp + 0x10], eax
jmp 0x40cbe8
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 0x40cba0
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x40cbe8
cmp dword [ebp - 0xc], 0
je 0x40cbe8
mov eax, dword [edi]
test byte [eax + esi + 4], 0x48
je 0x40cbc1
mov al, byte [ebp - 1]
cmp al, 0xa
je 0x40cbcc
mov byte [ebx], 0xd
mov ecx, dword [edi]
mov byte [ecx + esi + 5], al
jmp 0x40cbeb
cmp ebx, dword [ebp + 0xc]
jne 0x40cbd1
cmp byte [ebp - 1], 0xa
jne 0x40cbd1
mov byte [ebx], 0xa
jmp 0x40cbeb
push 1
push 0xffffffffffffffff
push 0xffffffffffffffff
push dword [ebp + 8]
call fcn.00411074
add esp, 0x10
cmp byte [ebp - 1], 0xa
je 0x40cbec
mov byte [ebx], 0xd
inc ebx
mov ecx, dword [ebp - 8]
cmp dword [ebp + 0x10], ecx
jb 0x40cb42
jmp 0x40cc0a
mov eax, dword [edi]
test byte [eax + esi + 4], 0x40
jne 0x40cc0a
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 0x40cc17
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret