joyce8/EMBER2024-capa huggingface dataset:
Function at 0x43aef3
Capabilities:
Get thread local storage value

Disassembly:
push ebx
push esi
mov esi, ecx
push edi
lea ebx, [esi + 0x1c]
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edi, dword [esp + 0x10]
test edi, edi
jle 0x43af28
cmp edi, dword [esi + 0xc]
jge 0x43af28
push dword [esi]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
je 0x43af28
cmp edi, dword [eax + 8]
jge 0x43af28
mov eax, dword [eax + 0xc]
mov edi, dword [eax + edi*4]
jmp 0x43af2a
xor edi, edi
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, edi
pop edi
pop esi
pop ebx
ret 4

Function at 0x43b02e
Capabilities:
Allocate thread local storage

Disassembly:
xor eax, eax
push esi
mov esi, ecx
mov dword [esi + 0x14], eax
mov dword [esi + 0x18], eax
mov dword [esi + 0x18], 4
mov dword [esi + 4], eax
mov dword [esi + 8], 1
mov dword [esi + 0xc], eax
mov dword [esi + 0x10], eax
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
cmp eax, 0xffffffff
mov dword [esi], eax
jne 0x43b062
jmp fcn.0042f650
lea eax, [esi + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov eax, esi
pop esi
ret

Function at 0x43b0d3
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
push ecx
push ebx
push esi
push edi
mov edi, ecx
lea esi, [edi + 0x1c]
push esi
mov dword [ebp - 4], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp + 8]
xor ebx, ebx
cmp eax, ebx
jle 0x43b1cc
cmp eax, dword [edi + 0xc]
jge 0x43b1cc
push dword [edi]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
cmp esi, ebx
je 0x43b124
mov ecx, dword [ebp + 8]
cmp ecx, dword [esi + 8]
jl 0x43b1b5
cmp dword [ebp + 0xc], ebx
je 0x43b1b5
jmp 0x43b14e
push 0x10
call fcn.0043adbf
cmp eax, ebx
je 0x43b13a
mov ecx, eax
call fcn.0043b025
mov esi, eax
jmp 0x43b13c
xor esi, esi
mov dword [esi + 8], ebx
mov dword [esi + 0xc], ebx
mov ecx, dword [edi + 0x14]
mov eax, dword [edi + 0x18]
mov dword [esi + eax], ecx
mov dword [edi + 0x14], esi
mov eax, dword [esi + 0xc]
cmp eax, ebx
jne 0x43b165
mov eax, dword [edi + 0xc]
shl eax, 2
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
jmp 0x43b175
mov ecx, dword [edi + 0xc]
push 2
shl ecx, 2
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_LocalReAlloc]
cmp eax, ebx
jne 0x43b187
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call fcn.0042f650
mov ecx, dword [esi + 8]
mov dword [esi + 0xc], eax
mov edx, dword [edi + 0xc]
sub edx, ecx
shl edx, 2
push edx
lea eax, [eax + ecx*4]
push ebx
push eax
call fcn.0041aac0
mov eax, dword [edi + 0xc]
add esp, 0xc
push esi
mov dword [esi + 8], eax
push dword [edi]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov ecx, dword [ebp + 8]
mov eax, dword [esi + 0xc]
cmp eax, ebx
je 0x43b1c7
cmp ecx, dword [esi + 8]
jge 0x43b1c7
mov edx, dword [ebp + 0xc]
mov dword [eax + ecx*4], edx
push dword [ebp - 4]
jmp 0x43b1cd
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop edi
pop esi
pop ebx
leave
ret 8
Function at 0x43b28c
Capabilities:
Get thread local storage value

Disassembly:
push ebx
push esi
mov esi, ecx
lea ebx, [esi + 0x1c]
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esp + 0x10], 0
jne 0x43b2ba
push dword [esi]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
je 0x43b2d8
push dword [esp + 0xc]
mov ecx, esi
push eax
call fcn.0043b1f6
jmp 0x43b2d8
mov eax, dword [esi + 0x14]
test eax, eax
je 0x43b2d8
push edi
push dword [esp + 0x10]
mov edi, dword [eax + 4]
push eax
mov ecx, esi
call fcn.0043b1f6
test edi, edi
mov eax, edi
jne 0x43b2c2
pop edi
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop esi
pop ebx
ret 8
mov ecx, dword [0x4552ec]
test ecx, ecx
je 0x43b38b
jmp 0x43b28b
ret 8
Function at 0x4019d0
Capabilities:
Create thread

Disassembly:
push ecx
push ebx
push ebp
push esi
push edi
call fcn.00401000
mov eax, dword [0x40ebdc]
mov esi, dword [sym.imp.USER32.dll_GetDlgItem]
push 0
push 0x3e9
push eax
call esi
mov edi, dword [sym.imp.USER32.dll_EnableWindow]
push eax
call edi
mov ecx, dword [0x40ebdc]
push 0
push 0x3ea
push ecx
call esi
push eax
call edi
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
push 0x64
call ebx
lea edx, [esp + 0x10]
mov dword [0x40ea64], 0
push edx
push 0
push 0
push 0x4018d0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
push 1
mov ebp, eax
call fcn.00401ed0
add esp, 4
mov dword [0x40ea64], 1
push 0xa
call ebx
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x40ebdc]
push 1
push 0x3e9
push eax
call esi
push eax
call edi
mov ecx, dword [0x40ebdc]
push 1
push 0x3ea
push ecx
call esi
push eax
call edi
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
pop ecx
ret 4
Function at 0x402dd0
Capabilities:
Get common file path

Disassembly:
sub esp, 0x1d8
mov dl, byte [0x412e64]
push ebx
push ebp
push edi
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0xe1]
mov byte [esp + 0xe0], dl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x31
xor eax, eax
lea edi, [esp + 0x19]
mov byte [esp + 0x18], dl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0xe0]
mov ebx, 1
push eax
push 0x104
mov byte [esp + 0x17], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
mov ecx, dword [esp + 0x1e8]
push 0
push 2
push 0
push ecx
call dword [sym.imp.SETUPAPI.dll_SetupOpenInfFileA]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x402e51
pop edi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1d8
ret
mov al, byte [0x4113f4]
push esi
test al, al
je 0x402f71
mov dword [esp + 0x18], 0x4113f4
mov edi, dword [esp + 0x18]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x1c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0
mov eax, ecx
mov esi, edi
mov edi, edx
push 0
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push 0xc8
and ecx, 3
lea edx, [esp + 0x28]
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x28]
push ecx
push edx
push ebp
call dword [sym.imp.SETUPAPI.dll_SetupDiGetActualSectionToInstallA]
call dword [sym.imp.SETUPAPI.dll_SetupOpenFileQueue]
mov esi, eax
test esi, esi
je 0x402f66
cmp esi, 0xffffffff
je 0x402f66
mov eax, dword [0x40ebdc]
push 0
push 0
push 0
push 0
push eax
call dword [sym.imp.SETUPAPI.dll_SetupInitDefaultQueueCallbackEx]
mov edi, eax
test edi, edi
mov dword [esp + 0x14], edi
je 0x402f50
lea ecx, [esp + 0xe4]
push 4
lea edx, [esp + 0x20]
push ecx
push edx
push esi
push 0
push ebp
call dword [sym.imp.SETUPAPI.dll_SetupInstallFilesFromInfSectionA]
test eax, eax
je 0x402f18
mov eax, dword [0x40ebdc]
push edi
push 0x402fa0
push esi
push eax
call dword [sym.imp.SETUPAPI.dll_SetupCommitFileQueueA]
test eax, eax
je 0x402f62
mov ebx, 1
jmp 0x402f1a
xor ebx, ebx
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov edx, eax
mov al, byte [esp + 0x13]
inc dl
add al, dl
mov byte [esp + 0x13], al
movsx eax, al
mov cl, byte [eax + 0x4113f4]
lea eax, [eax + 0x4113f4]
test cl, cl
mov dword [esp + 0x18], eax
jne 0x402e67
jmp 0x402f75
push esi
xor ebx, ebx
call dword [sym.imp.SETUPAPI.dll_SetupCloseFileQueue]
push ebp
call dword [sym.imp.SETUPAPI.dll_SetupCloseInfFile]
jmp 0x402f79
xor ebx, ebx
jmp 0x402f79
push ebp
xor ebx, ebx
call dword [sym.imp.SETUPAPI.dll_SetupCloseInfFile]
jmp 0x402f75
mov esi, dword [esp + 0x14]
mov edi, dword [esp + 0x14]
push edi
call dword [sym.imp.SETUPAPI.dll_SetupTermDefaultQueueCallback]
push esi
call dword [sym.imp.SETUPAPI.dll_SetupCloseFileQueue]
push ebp
call dword [sym.imp.SETUPAPI.dll_SetupCloseInfFile]
pop esi
pop edi
mov eax, ebx
pop ebp
pop ebx
add esp, 0x1d8
ret
Function at 0x403280
Capabilities:
Delete file

Disassembly:
sub esp, 0x720
mov dl, byte [0x412e64]
push ebx
push ebp
push edi
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x309]
mov byte [esp + 0x308], dl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x205]
mov byte [esp + 0x204], dl
rep stosd dword es:[edi], eax
mov ebx, dword [esp + 0x734]
mov ebp, dword [esp + 0x730]
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x19
xor eax, eax
lea edi, [esp + 0x10]
push 2
push ebx
push ebp
rep stosd dword es:[edi], eax
mov dword [esp + 0x1c], 0x31c
call dword [sym.imp.SETUPAPI.dll_SetupDiBuildDriverInfoList]
test eax, eax
je 0x403457
push esi
mov ecx, 0x19
xor eax, eax
lea edi, [esp + 0x14]
xor esi, esi
push eax
rep stosd dword es:[edi], eax
mov dword [esp + 0x14], esi
mov dword [esp + 0x18], 0x31c
mov dword [esp + 0x1c], 2
call dword [sym.imp.KERNEL32.dll_SetLastError]
call fcn.00403470
cmp al, 1
jne 0x40333b
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 0x30c
push eax
jmp 0x403348
lea ecx, [esp + 0x14]
mov dword [esp + 0x14], 0x31c
push ecx
push esi
push 2
push ebx
push ebp
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDriverInfoA]
test eax, eax
je 0x403456
push 0
lea edx, [esp + 0x414]
push 0x31d
lea eax, [esp + 0x1c]
push edx
push eax
push ebx
push ebp
mov dword [esp + 0x428], 0x31d
call dword [sym.imp.SETUPAPI.dll_SetupDiGetDriverInfoDetailA]
lea edi, [esp + 0x528]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x208]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x208]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ecx, eax
lea esi, [esp + 0x208]
sub ecx, 3
lea edi, [esp + 0x30c]
mov edx, ecx
xor eax, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0x30c]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x40c038
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x30c]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
mov esi, dword [sym.imp.KERNEL32.dll_DeleteFileA]
call esi
lea ecx, [esp + 0x208]
push ecx
call esi
mov eax, dword [esp + 0x10]
mov ecx, 0x19
inc eax
lea edi, [esp + 0x14]
mov dword [esp + 0x10], eax
xor eax, eax
mov esi, dword [esp + 0x10]
rep stosd dword es:[edi], eax
mov dword [esp + 0x14], 0x31c
mov dword [esp + 0x18], 2
jmp 0x403323
pop esi
push 2
push ebx
push ebp
call dword [sym.imp.SETUPAPI.dll_SetupDiDestroyDriverInfoList]
pop edi
pop ebp
pop ebx
add esp, 0x720
ret
Function at 0x403470
Capabilities:
Get common file path

Disassembly:
call dword [sym.imp.KERNEL32.dll_GetVersion]
push 0x104
push str.C:WINDOWS
mov dword [0x412c68], eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
mov ecx, dword [0x412c68]
mov edx, ecx
and edx, 0xff
cmp edx, 4
jb 0x4034b2
test eax, eax
je 0x4034b2
and ecx, 0x80000000
neg ecx
sbb cl, cl
add ecx, 2
mov al, cl
ret
mov eax, dword [0x40ebdc]
push 0x10
push str.Initialize
push str.Windows_version_or_directory_error
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
mov ecx, dword [0x40ebdc]
push 0x81
push ecx
call dword [sym.imp.USER32.dll_EndDialog]
or al, 0xff
ret
Function at 0x4042d0
Capabilities:
Accept command line arguments

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40a1a8
push 0x406208
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
add esp, 0xffffffa8
push ebx
push esi
push edi
mov dword [ebp - 0x18], esp
call dword [sym.imp.KERNEL32.dll_GetVersion]
xor edx, edx
mov dl, ah
mov dword [0x4130b0], edx
mov ecx, eax
and ecx, 0xff
mov dword [0x4130ac], ecx
shl ecx, 8
add ecx, edx
mov dword [0x4130a8], ecx
shr eax, 0x10
mov dword [0x4130a4], eax
call fcn.004060d0
test eax, eax
jne 0x40433a
push 0x1c
call fcn.004044a0
add esp, 4
mov dword [ebp - 4], 0
call fcn.00405ed0
call fcn.004049b0
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov dword [0x414454], eax
call fcn.00405d70
mov dword [0x412e68], eax
test eax, eax
je 0x40436d
mov eax, dword [0x414454]
test eax, eax
jne 0x404377
push 0xffffffffffffffff
call fcn.004049f0
add esp, 4
call fcn.00405ac0
call fcn.004059d0
call fcn.004049c0
mov esi, dword [0x414454]
mov dword [ebp - 0x64], esi
cmp byte [esi], 0x22
jne 0x404456
inc esi
mov dword [ebp - 0x64], esi
mov al, byte [esi]
cmp al, 0x22
je 0x4043be
test al, al
je 0x4043be
and eax, 0xff
push eax
call fcn.00405970
add esp, 4
test eax, eax
je 0x404398
inc esi
mov dword [ebp - 0x64], esi
jmp 0x404398
cmp byte [esi], 0x22
jne 0x4043c7
inc esi
mov dword [ebp - 0x64], esi
mov al, byte [esi]
test al, al
je 0x4043d7
cmp al, 0x20
ja 0x4043d7
inc esi
mov dword [ebp - 0x64], esi
jmp 0x4043c7
mov dword [ebp - 0x30], 0
lea eax, [ebp - 0x5c]
push eax
call dword [sym.imp.KERNEL32.dll_GetStartupInfoA]
test byte [ebp - 0x30], 1
je 0x4043f8
mov eax, dword [ebp - 0x2c]
and eax, 0xffff
jmp 0x4043fd
mov eax, 0xa
push eax
push esi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call main
mov dword [ebp - 0x60], eax
push eax
call fcn.004049f0
jmp 0x40443b
add esp, 4
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp byte [esi], 0x20
jbe 0x4043c7
inc esi
mov dword [ebp - 0x64], esi
jmp 0x404456

Function at 0x4044a0
Capabilities:
Terminate process

Disassembly:
cmp dword [0x412e70], 1
jne 0x4044ae
call fcn.004062e0
mov eax, dword [esp + 4]
push eax
call fcn.00406320
add esp, 4
push 0xff
call dword [sym.imp.KERNEL32.dll_ExitProcess]
Function at 0x404a30
Capabilities:
Terminate process

Disassembly:
mov eax, dword [0x4130e0]
push ebx
push ebp
mov ebp, dword [esp + 0xc]
cmp eax, 1
push esi
jne 0x404a4f
push ebp
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
mov eax, dword [esp + 0x14]
mov ebx, dword [esp + 0x18]
test eax, eax
mov dword [0x4130dc], 1
mov byte [0x4130d8], bl
jne 0x404aa9
mov ecx, dword [0x414448]
test ecx, ecx
je 0x404a97
mov esi, dword [0x414444]
sub esi, 4
cmp esi, ecx
jb 0x404a97
mov eax, dword [esi]
test eax, eax
je 0x404a90
call eax
mov ecx, dword [0x414448]
sub esi, 4
cmp esi, ecx
jae 0x404a82
push 0x40b01c
push 0x40b014
call fcn.00404ae0
add esp, 8
push 0x40b024
push 0x40b020
call fcn.00404ae0
add esp, 8
test ebx, ebx
jne 0x404ad0
push ebp
mov dword [0x4130e0], 1
call dword [sym.imp.KERNEL32.dll_ExitProcess]
pop esi
pop ebp
pop ebx
ret

Function at 0x405d70
Capabilities:
Query environment variable

Disassembly:
mov eax, dword [0x4131f0]
push ebx
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_GetEnvironmentStrings]
push esi
xor esi, esi
xor ebx, ebx
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
test eax, eax
jne 0x405db2
call edi
mov esi, eax
test esi, esi
je 0x405d9c
mov eax, 1
jmp 0x405dad
call ebp
mov ebx, eax
test ebx, ebx
je 0x405ebf
mov eax, 2
mov dword [0x4131f0], eax
cmp eax, 1
jne 0x405e52
test esi, esi
jne 0x405dcb
call edi
mov esi, eax
test esi, esi
je 0x405ebf
cmp word [esi], 0
mov eax, esi
je 0x405de5
add eax, 2
cmp word [eax], 0
jne 0x405dd3
add eax, 2
cmp word [eax], 0
jne 0x405dd3
sub eax, esi
push 0
sar eax, 1
inc eax
push 0
mov ebp, eax
push 0
push 0
push ebp
push esi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov edi, eax
test edi, edi
je 0x405e44
push edi
call fcn.00407560
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x405e44
push 0
push 0
push edi
push ebx
push ebp
push esi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
jne 0x405e36
push ebx
call fcn.00407510
add esp, 4
xor ebx, ebx
push esi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
ret
push esi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
ret
cmp eax, 2
jne 0x405ebf
test ebx, ebx
jne 0x405e63
call ebp
mov ebx, eax
test ebx, ebx
je 0x405ebf
mov cl, byte [ebx]
mov eax, ebx
test cl, cl
je 0x405e7b
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x405e6b
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x405e6b
sub eax, ebx
inc eax
mov esi, eax
push esi
call fcn.00407560
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x405e9d
push ebx
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsA]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
ret
mov ecx, esi
mov esi, ebx
mov eax, ecx
mov edi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsA]
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
ret
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
ret
Function at 0x406320
Capabilities:
Write file on windows

Disassembly:
mov ecx, dword [esp + 4]
sub esp, 0x1a8
mov eax, 0x40c250
push ebx
push ebp
push esi
push edi
xor ebp, ebp
cmp ecx, dword [eax]
je 0x406344
add eax, 8
inc ebp
cmp eax, 0x40c2e0
jb 0x406335
cmp ecx, dword [ebp*8 + 0x40c250]
jne 0x4064eb
mov eax, dword [0x412e70]
cmp eax, 1
je 0x4064ad
test eax, eax
jne 0x406370
cmp dword [0x40c0a4], 1
je 0x4064ad
cmp ecx, 0xfc
je 0x4064eb
lea eax, [esp + 0xb4]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x4063ab
mov ecx, 5
mov esi, str._program_name_unknown_
lea edi, [esp + 0xb4]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
lea edi, [esp + 0xb4]
or ecx, 0xffffffff
xor eax, eax
lea ebx, [esp + 0xb4]
repne scasb al, byte es:[edi]
not ecx
cmp ecx, 0x3c
jbe 0x4063f4
lea edi, [esp + 0xb4]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
push 3
mov ebx, ecx
lea ecx, [esp + 0xb8]
sub ecx, 0x3b
push 0x40a500
add ebx, ecx
push ebx
call fcn.00407eb0
add esp, 0xc
mov ecx, 6
mov esi, str.Runtime_Error__n_nProgram:
lea edi, [esp + 0x14]
xor eax, eax
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
or ecx, 0xffffffff
mov edi, ebx
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x14]
mov ebx, ecx
mov esi, edi
or ecx, 0xffffffff
mov edi, edx
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0x14]
and ecx, 3
push 0x12010
rep movsb byte es:[edi], byte [esi]
mov edi, 0x40a4e0
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push str.Microsoft_Visual_C_Runtime_Library
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [esp + 0x1c]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [ebp*8 + 0x40c254]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea eax, [esp + 0x1c]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call fcn.00407e20
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1a8
ret
mov eax, dword [0x414340]
test eax, eax
je 0x4064be
mov esi, dword [eax + 0x10]
cmp esi, 0xffffffff
jne 0x4064c8
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov esi, eax
mov edx, dword [ebp*8 + 0x40c254]
lea ecx, [esp + 0x10]
push 0
push ecx
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push edx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1a8
ret
Function at 0x407010
Capabilities:
Write file on windows

Disassembly:
mov eax, dword [esp + 4]
mov ecx, dword [0x414440]
sub esp, 0x41c
cmp eax, ecx
push ebx
push ebp
push esi
push edi
jae 0x4071bd
mov ecx, eax
mov esi, eax
sar ecx, 5
and esi, 0x1f
mov edx, dword [ecx*4 + 0x414340]
lea edi, [ecx*4 + 0x414340]
shl esi, 3
mov dword [esp + 0x24], edi
mov dword [esp + 0x14], esi
mov cl, byte [esi + edx + 4]
test cl, 1
je 0x4071bd
mov ebx, dword [esp + 0x438]
xor ebp, ebp
cmp ebx, ebp
mov dword [esp + 0x10], ebp
mov dword [esp + 0x20], ebp
jne 0x40707e
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x41c
ret
test cl, 0x20
je 0x40708f
push 2
push ebp
push eax
call fcn.00406f50
add esp, 0xc
mov eax, dword [edi]
add eax, esi
test byte [eax + 4], 0x80
je 0x4071ee
mov ebp, dword [esp + 0x434]
mov dword [esp + 0x18], 0
test ebx, ebx
mov edi, ebp
jbe 0x407139
lea eax, [esp + 0x28]
mov ecx, edi
sub ecx, ebp
cmp ecx, ebx
jae 0x4070ea
mov cl, byte [edi]
inc edi
cmp cl, 0xa
jne 0x4070d7
mov esi, dword [esp + 0x20]
mov byte [eax], 0xd
inc esi
inc eax
mov dword [esp + 0x20], esi
mov byte [eax], cl
inc eax
mov edx, eax
lea ecx, [esp + 0x28]
sub edx, ecx
cmp edx, 0x400
jl 0x4070ba
mov esi, eax
lea edx, [esp + 0x28]
lea eax, [esp + 0x1c]
sub esi, edx
mov edx, dword [esp + 0x24]
push 0
push eax
lea ecx, [esp + 0x30]
mov eax, dword [edx]
push esi
push ecx
mov ecx, dword [esp + 0x24]
mov edx, dword [ecx + eax]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4071df
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x10]
add edx, eax
cmp eax, esi
mov dword [esp + 0x10], edx
jl 0x407135
mov eax, edi
sub eax, ebp
cmp eax, ebx
jb 0x4070b6
mov esi, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x4071ae
mov eax, dword [esp + 0x18]
test eax, eax
je 0x407182
cmp eax, 5
jne 0x40716b
mov dword [0x41309c], eax
mov dword [0x413098], 9
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x41c
ret
push eax
call fcn.004086f0
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x41c
ret
mov ecx, dword [esp + 0x24]
mov edx, dword [ecx]
test byte [esi + edx + 4], 0x40
je 0x4071a2
cmp byte [ebp], 0x1a
jne 0x4071a2
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x41c
ret
mov dword [0x413098], 0x1c
jmp 0x4071c7
sub eax, dword [esp + 0x20]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x41c
ret
mov dword [0x413098], 9
pop edi
pop esi
pop ebp
mov dword [0x41309c], 0
or eax, 0xffffffff
pop ebx
add esp, 0x41c
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x18], eax
jmp 0x407135
mov edx, dword [eax]
lea ecx, [esp + 0x1c]
push ebp
mov ebp, dword [esp + 0x438]
push ecx
push ebx
push ebp
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40721f
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x18], 0
mov dword [esp + 0x10], eax
jmp 0x407139
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x18], eax
jmp 0x407139