joyce8/EMBER2024-capa huggingface dataset:
Function at 0x4026b0
Capabilities:
Read file on windows
Write file on windows

Disassembly:
mov eax, 0x100c
call fcn.00408450
push ebp
push esi
push edi
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, dword [esp + 0x101c]
mov dword [esp + 0xc], eax
lea eax, [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x20]
push 0x1000
push ecx
push esi
call edi
test eax, eax
jne 0x402708
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xe8
je 0x4026dc
cmp eax, 0xea
jne 0x402729
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0xc]
lea edx, [esp + 0x14]
push 0
push edx
mov byte [esp + eax + 0x20], 0
push eax
lea eax, [esp + 0x24]
push eax
push ecx
call ebp
test eax, eax
jne 0x4026dc
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
pop ebp
add esp, 0x100c
ret 4

Function at 0x4027c0
Capabilities:
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x41f748
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
mov eax, dword [0x428654]
push esi
mov dword [esp + 4], eax
mov esi, dword [esp + 0x1c]
lea ecx, [esp + 4]
push esi
push 0x19
push ecx
mov dword [esp + 0x1c], 0
call fcn.00417445
mov edx, dword [esp + 0x10]
add esp, 0xc
push edx
call fcn.0040838b
mov eax, dword [esp + 0x1c]
add esp, 4
mov ecx, dword [eax]
push ecx
push 0x4282c0
push 0x428e10
call fcn.0040847f
add esp, 0xc
lea edx, [esp + 0x1c]
push 0
push 0
push edx
push 0x400
push esi
push 0
push 0x1100
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
test eax, eax
pop esi
je 0x40286a
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x14]
push 0
push ecx
push eax
push edx
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
lea ecx, [esp]
mov dword [esp + 0xc], 0xffffffff
call fcn.0041b68b
mov ecx, dword [esp + 4]
mov dword fs:[0], ecx
add esp, 0x10
ret
Function at 0x402950
Capabilities:
Manipulate console buffer

Disassembly:
sub esp, 0x1c
xor eax, eax
push ebx
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_GetConsoleScreenBufferInfo]
mov word [esp + 8], ax
mov word [esp + 0xa], ax
push edi
mov edi, dword [esp + 0x2c]
lea eax, [esp + 0x10]
push eax
push edi
call ebp
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x40299d
push 0x40b
push str.GetConsoleScreenBufferInfo
call ebx
push eax
push str.M:DWDNetworkDNTUCliDNTUCli.cpp
push 0x428330
call fcn.0040838b
add esp, 0x14
movsx ecx, word [esp + 0x10]
push esi
mov eax, dword [esp + 0x10]
movsx esi, word [esp + 0x16]
imul esi, ecx
lea edx, [esp + 0x30]
push edx
push eax
push esi
push 0x20
push edi
call dword [sym.imp.KERNEL32.dll_FillConsoleOutputCharacterA]
test eax, eax
jne 0x4029e2
push 0x412
push str.FillConsoleOutputCharacter
call ebx
push eax
push str.M:DWDNetworkDNTUCliDNTUCli.cpp
push 0x428330
call fcn.0040838b
add esp, 0x14
lea ecx, [esp + 0x14]
push ecx
push edi
call ebp
test eax, eax
jne 0x402a0d
push 0x417
push str.ConsoleScreenBufferInfo
call ebx
push eax
push str.M:DWDNetworkDNTUCliDNTUCli.cpp
push 0x428330
call fcn.0040838b
add esp, 0x14
mov ebp, dword [esp + 0x10]
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x30]
push edx
push ebp
push esi
push eax
push edi
call dword [sym.imp.KERNEL32.dll_FillConsoleOutputAttribute]
test eax, eax
pop esi
jne 0x402a48
push 0x41d
push str.FillConsoleOutputAttribute
call ebx
push eax
push str.M:DWDNetworkDNTUCliDNTUCli.cpp
push 0x428330
call fcn.0040838b
add esp, 0x14
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_SetConsoleCursorPosition]
test eax, eax
jne 0x402a73
push 0x422
push str.SetConsoleCursorPosition
call ebx
push eax
push str.M:DWDNetworkDNTUCliDNTUCli.cpp
push 0x428330
call fcn.0040838b
add esp, 0x14
pop edi
pop ebp
pop ebx
add esp, 0x1c
ret
Function at 0x406350
Capabilities:
Query service configuration
Query service status

Disassembly:
sub esp, 0x264
push ebx
push ebp
push esi
mov esi, ecx
push edi
xor ebx, ebx
mov eax, dword [esi + 0x20]
push 5
push ebx
push eax
mov dword [esi + 0x14], ebx
mov dword [esi + 0x10], 1
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov ebp, eax
cmp ebp, ebx
je 0x40648f
mov eax, dword [esi + 0x18]
lea ecx, [esp + 0x18]
lea edx, [esp + 0x1c]
push ecx
push edx
push eax
push ebp
mov dword [esp + 0x28], 0x258
call dword [sym.imp.ADVAPI32.dll_GetServiceDisplayNameA]
test eax, eax
je 0x4063ad
lea eax, [esp + 0x1c]
lea ecx, [esi + 0x1c]
push eax
call fcn.0041b7c8
mov eax, dword [esi + 0x18]
push 5
push eax
push ebp
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov edi, eax
cmp edi, ebx
je 0x40647e
lea ecx, [esi + 0x2c]
mov dword [esi + 0x14], 1
push ecx
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
mov eax, dword [esi + 0x48]
cmp eax, ebx
je 0x4063e9
push eax
call fcn.00408d73
add esp, 4
mov dword [esi + 0x48], ebx
mov eax, dword [esi + 0x48]
lea edx, [esp + 0x10]
push edx
push ebx
push eax
push edi
mov dword [esp + 0x20], ebx
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigA]
test eax, eax
jne 0x406447
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x406447
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x10], 0
lea ebx, [ecx + 1]
push ebx
call fcn.00408e5c
add esp, 4
lea edx, [esp + 0x10]
mov dword [esi + 0x48], eax
push edx
push ebx
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigA]
test eax, eax
jne 0x406447
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea eax, [esp + 0x14]
mov ecx, esi
push eax
call fcn.00406600
lea ecx, [esp + 0x14]
call fcn.0041b68b
lea ecx, [esp + 0x14]
push ecx
mov ecx, esi
call fcn.00406500
lea ecx, [esp + 0x14]
call fcn.0041b68b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebp
mov edi, eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x40649e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [esi + 0x14]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x264
ret
Function at 0x406a70
Capabilities:
Query service status
Start service

Disassembly:
sub esp, 0x1c
push ebx
push ebp
push esi
mov esi, ecx
push 0xf003f
push 0
mov eax, dword [esi + 0x20]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov ebx, eax
test ebx, ebx
jne 0x406a9e
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1c
ret
mov esi, dword [esi + 0x18]
push 0xf01ff
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov esi, eax
test esi, esi
jne 0x406aca
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1c
ret
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
test eax, eax
jne 0x406af4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push ebx
call esi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1c
ret
mov ebp, dword [sym.imp.KERNEL32.dll_Sleep]
push 0x3e8
call ebp
lea eax, [esp + 0xc]
push eax
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
jne 0x406b2c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push ebx
call esi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1c
ret
cmp dword [esp + 0x10], 4
je 0x406b77
mov eax, dword [esp + 0x20]
push edi
mov edi, eax
mov eax, dword [esp + 0x28]
cmp eax, 0xea60
jbe 0x406b4a
mov eax, 0x1388
push eax
call ebp
lea ecx, [esp + 0x10]
push ecx
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x406b76
cmp dword [esp + 0x1c], 0x42a
je 0x406b76
mov eax, dword [esp + 0x24]
cmp edi, eax
ja 0x406b76
cmp dword [esp + 0x14], 4
jne 0x406b38
pop edi
push 0x3e8
call ebp
cmp dword [esp + 0x18], 0x42a
jne 0x406b9d
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push ebx
call esi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1c
ret
cmp dword [esp + 0x10], 4
je 0x406bbf
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push ebx
call esi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1c
ret
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push ebx
call esi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x1c
ret

Function at 0x406d90
Capabilities:
Get hostname

Disassembly:
sub esp, 0x108
push esi
mov esi, dword [esp + 0x110]
test esi, esi
jne 0x406dac
xor eax, eax
pop esi
add esp, 0x108
ret
lea eax, [esp + 4]
lea ecx, [esp + 8]
push eax
push ecx
mov dword [esp + 0xc], 0x104
call dword [sym.imp.KERNEL32.dll_GetComputerNameA]
mov al, byte [esp + 8]
lea ecx, [esp + 8]
test al, al
je 0x406ddc
cmp al, 0x5c
jne 0x406ddc
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x406dd0
mov al, byte [esi]
test al, al
je 0x406dee
cmp al, 0x5c
jne 0x406dee
mov al, byte [esi + 1]
inc esi
test al, al
jne 0x406de2
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
neg eax
sbb eax, eax
pop esi
inc eax
add esp, 0x108
ret
Function at 0x40f280
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1a4
mov edx, dword [ebp + 8]
xor ecx, ecx
mov eax, 0x42b958
cmp edx, dword [eax]
je 0x40f2a2
add eax, 8
inc ecx
cmp eax, 0x42b9e8
jl 0x40f293
push esi
mov esi, ecx
shl esi, 3
cmp edx, dword [esi + 0x42b958]
jne 0x40f3d0
mov eax, dword [0x42eb48]
cmp eax, 1
je 0x40f3aa
test eax, eax
jne 0x40f2d3
cmp dword [0x4290d4], 1
je 0x40f3aa
cmp edx, 0xfc
je 0x40f3d0
lea eax, [ebp - 0x1a4]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x40f30a
lea eax, [ebp - 0x1a4]
push str._program_name_unknown_
push eax
call fcn.0040cff0
pop ecx
pop ecx
lea eax, [ebp - 0x1a4]
push edi
push eax
lea edi, [ebp - 0x1a4]
call fcn.00409be0
inc eax
pop ecx
cmp eax, 0x3c
jbe 0x40f34d
lea eax, [ebp - 0x1a4]
push eax
call fcn.00409be0
mov edi, eax
lea eax, [ebp - 0x1a4]
sub eax, 0x3b
push 3
add edi, eax
push 0x422ed0
push edi
call fcn.004102b0
add esp, 0x10
lea eax, [ebp - 0xa0]
push str.Runtime_Error__n_nProgram:
push eax
call fcn.0040cff0
lea eax, [ebp - 0xa0]
push edi
push eax
call fcn.0040d000
lea eax, [ebp - 0xa0]
push 0x422eb0
push eax
call fcn.0040d000
push dword [esi + 0x42b95c]
lea eax, [ebp - 0xa0]
push eax
call fcn.0040d000
push 0x12010
lea eax, [ebp - 0xa0]
push str.Microsoft_Visual_C_Runtime_Library
push eax
call fcn.00411e96
add esp, 0x2c
pop edi
jmp 0x40f3d0
lea eax, [ebp + 8]
lea esi, [esi + 0x42b95c]
push 0
push eax
push dword [esi]
call fcn.00409be0
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 0x41a64e
Capabilities:
Extract resource via kernel32 functions

Disassembly:
push ebx
push esi
push edi
xor edi, edi
cmp dword [esp + 0x10], edi
mov ebx, ecx
je 0x41a690
call fcn.0041e466
mov esi, dword [eax + 0xc]
push 0xf0
push dword [esp + 0x14]
push esi
call dword [sym.imp.KERNEL32.dll_FindResourceA]
cmp eax, edi
je 0x41a690
push eax
push esi
call dword [sym.imp.KERNEL32.dll_LoadResource]
cmp eax, edi
jne 0x41a687
xor eax, eax
jmp 0x41a698
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov edi, eax
push edi
mov ecx, ebx
call fcn.0041a69e
pop edi
pop esi
pop ebx
ret 4
Function at 0x401090
Capabilities:
Accept command line arguments

Disassembly:
mov eax, dword fs:[0]
push ebp
mov ebp, esp
push 0xffffffffffffffff
push section..rdata
push 0x402010
push eax
mov dword fs:[0], esp
sub esp, 0x60
push ebx
push esi
push edi
mov dword [ebp - 0x18], esp
call dword [sym.imp.KERNEL32.dll_GetVersion]
mov dword [0x404050], eax
xor eax, eax
mov al, byte [0x404051]
mov dword [0x40405c], eax
mov eax, dword [0x404050]
shr dword [0x404050], 0x10
and eax, 0xff
mov dword [0x404058], eax
shl eax, 8
add eax, dword [0x40405c]
mov dword [0x404054], eax
call fcn.00401ff0
mov dword [ebp - 4], 0
call fcn.00401e10
call fcn.00401e00
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov dword [0x405fec], eax
call fcn.004019a0
mov dword [0x404030], eax
test eax, eax
je 0x401129
cmp dword [0x405fec], 0
jne 0x401133
push 0xffffffffffffffff
call fcn.00401280
add esp, 4
call fcn.00401720
call fcn.00401640
call fcn.00401250
mov esi, dword [0x405fec]
mov al, byte [esi]
cmp al, 0x22
je 0x40115a
cmp al, 0x20
jbe 0x401187
inc esi
cmp byte [esi], 0x20
ja 0x401152
jmp 0x401187
inc esi
cmp byte [esi], 0x22
je 0x401186
mov bl, byte [ebp - 0x28]
mov bl, byte [esi]
test bl, bl
je 0x401181
xor eax, eax
mov al, bl
push eax
call fcn.004015e0
add esp, 4
test eax, eax
je 0x40117b
inc esi
inc esi
cmp byte [esi], 0x22
jne 0x401163
cmp byte [esi], 0x22
jne 0x401187
inc esi
cmp byte [esi], 0
je 0x401197
cmp byte [esi], 0x20
ja 0x401197
inc esi
cmp byte [esi], 0
jne 0x40118c
mov dword [ebp - 0x44], 0
lea eax, [ebp - 0x70]
push eax
call dword [sym.imp.KERNEL32.dll_GetStartupInfoA]
test byte [ebp - 0x44], 1
mov eax, 0xa
je 0x4011bb
mov eax, dword [ebp - 0x40]
and eax, 0xffff
push eax
push esi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call main
push eax
call fcn.00401280
jmp 0x4011fc
add esp, 4
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x10]
pop edi
mov dword fs:[0], eax
pop esi
pop ebx
mov esp, ebp
pop ebp
ret

Function at 0x4012c0
Capabilities:
Terminate process

Disassembly:
mov dword [0x404088], 1
cmp dword [esp + 8], 0
push ebx
push esi
mov ebx, dword [esp + 0x14]
mov byte [0x404084], bl
jne 0x40131c
cmp dword [0x405fe8], 0
je 0x40130a
mov esi, dword [0x405fe0]
sub esi, 4
cmp esi, dword [0x405fe8]
jb 0x40130a
mov eax, dword [esi]
test eax, eax
je 0x4012ff
call eax
sub esi, 4
cmp esi, dword [0x405fe8]
jae 0x4012f7
push 0x40401c
push 0x404014
call fcn.00401340
add esp, 8
push 0x404024
push 0x404020
call fcn.00401340
add esp, 8
test ebx, ebx
jne 0x40133d
mov eax, dword [esp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_ExitProcess]
pop esi
pop ebx
ret
Function at 0x4019a0
Capabilities:
Query environment variable

Disassembly:
sub esp, 4
cmp dword [0x404130], 0
push ebx
push esi
push edi
push ebp
jne 0x4019f0
mov esi, dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
call esi
mov edi, eax
test edi, edi
je 0x4019ce
mov dword [0x404130], 1
mov ebx, dword [esp + 0x10]
jmp 0x4019fe
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStrings]
mov ebx, eax
test ebx, ebx
je 0x4019e6
mov dword [0x404130], 2
jmp 0x4019fe
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
mov edi, dword [esp + 0x10]
mov ebx, dword [esp + 0x10]
mov esi, dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
cmp dword [0x404130], 1
jne 0x401aad
test edi, edi
jne 0x401a21
call esi
mov edi, eax
test edi, edi
jne 0x401a21
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
cmp word [edi], 0
mov esi, edi
je 0x401a3b
add esi, 2
cmp word [esi], 0
jne 0x401a29
add esi, 2
cmp word [esi], 0
jne 0x401a29
sub esi, edi
push 0
sar esi, 1
push 0
inc esi
push 0
push 0
push esi
push edi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov ebp, eax
test ebp, ebp
je 0x401a9c
push ebp
call fcn.00402340
add esp, 4
mov ebx, eax
test ebx, ebx
je 0x401a9c
push 0
push 0
push ebp
push ebx
push esi
push edi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
jne 0x401a8b
push ebx
call fcn.00402320
add esp, 4
xor ebx, ebx
push edi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
mov eax, ebx
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
push edi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
cmp dword [0x404130], 2
jne 0x401b31
test ebx, ebx
jne 0x401ad0
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStrings]
mov ebx, eax
test ebx, ebx
jne 0x401ad0
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
mov ebp, ebx
cmp byte [ebx], 0
je 0x401ae5
inc ebp
cmp byte [ebp], 0
jne 0x401ad7
inc ebp
cmp byte [ebp], 0
jne 0x401ad7
sub ebp, ebx
inc ebp
push ebp
call fcn.00402340
mov dword [esp + 0x14], eax
add esp, 4
test eax, eax
jne 0x401b0a
push ebx
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsA]
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
mov edi, dword [esp + 0x10]
mov esi, ebx
mov ecx, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
push ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsA]
mov eax, dword [esp + 0x10]
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
Function at 0x402130
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x1a8
xor eax, eax
mov ecx, 0x4045c0
push ebx
mov edx, dword [esp + 0x1b0]
push esi
push edi
push ebp
cmp dword [ecx], edx
je 0x402158
add ecx, 8
inc eax
cmp ecx, 0x404648
jb 0x402148
cmp dword [eax*8 + 0x4045c0], edx
lea ebx, [eax*8]
jne 0x402313
cmp dword [0x40403c], 1
je 0x4022d8
cmp dword [0x40403c], 0
jne 0x40218f
cmp dword [0x404040], 1
je 0x4022d8
cmp edx, 0xfc
je 0x402313
lea eax, [esp + 0xb4]
push 0x104
push eax
mov ebp, dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0
call ebp
test eax, eax
jne 0x4021cc
mov esi, str._program_name_unknown_
lea edi, [esp + 0xb4]
mov ecx, 5
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
lea ebp, [esp + 0xb4]
lea edi, [esp + 0xb4]
mov ecx, 0xffffffff
sub eax, eax
repne scasb al, byte es:[edi]
not ecx
cmp ecx, 0x3c
jbe 0x402210
lea edi, [esp + 0xb4]
mov ecx, 0xffffffff
sub eax, eax
push 3
repne scasb al, byte es:[edi]
not ecx
lea ebp, [esp + ecx + 0x7c]
push 0x404694
push ebp
call fcn.00402460
add esp, 0xc
mov esi, str.Runtime_Error__n_nProgram:
lea edi, [esp + 0x14]
mov ecx, 6
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov edi, ebp
mov ecx, 0xffffffff
sub eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov ecx, 0xffffffff
lea edi, [esp + 0x14]
sub eax, eax
repne scasb al, byte es:[edi]
dec edi
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x404674
mov ecx, 0xffffffff
sub eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov ecx, 0xffffffff
lea edi, [esp + 0x14]
sub eax, eax
repne scasb al, byte es:[edi]
dec edi
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [ebx + 0x4045c4]
mov ecx, 0xffffffff
sub eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edx, ecx
lea edi, [esp + 0x14]
mov ecx, 0xffffffff
sub eax, eax
repne scasb al, byte es:[edi]
dec edi
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push 0x12010
and ecx, 3
push str.Microsoft_Visual_C_Runtime_Library
rep movsb byte es:[edi], byte [esi]
lea eax, [esp + 0x1c]
push eax
call fcn.004023c0
add esp, 0xc
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x1a8
ret
mov eax, dword [0x405ee0]
mov esi, dword [eax + 0x10]
cmp esi, 0xffffffff
jne 0x4022ef
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov esi, eax
mov edx, dword [ebx + 0x4045c4]
push 0
lea eax, [esp + 0x14]
mov edi, edx
push eax
mov ecx, 0xffffffff
sub 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 ebp
pop edi
pop esi
pop ebx
add esp, 0x1a8
ret
Function at 0x4027a0
Capabilities:
Write file on windows

Disassembly:
mov edx, dword [esp + 4]
sub esp, 0x418
cmp dword [0x405ed4], edx
push ebx
push esi
push edi
push ebp
jbe 0x4029a7
mov eax, edx
and eax, 0xffffffe7
sar eax, 3
add eax, 0x405ee0
mov dword [esp + 0x18], eax
mov eax, edx
and eax, 0x1f
mov ecx, dword [esp + 0x18]
shl eax, 3
mov ebx, dword [ecx]
mov ebp, eax
mov dword [esp + 0x1c], eax
mov al, byte [ebx + ebp + 4]
test al, 1
je 0x4029a7
xor esi, esi
mov ebp, dword [esp + 0x434]
mov dword [esp + 0x20], esi
cmp ebp, esi
jne 0x402809
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x418
ret
test al, 0x20
je 0x40281a
push 2
push 0
push edx
call fcn.00402c40
add esp, 0xc
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
add ecx, dword [eax]
test byte [ecx + 4], 0x80
je 0x4028b6
mov dword [esp + 0x10], 0
mov edi, dword [esp + 0x430]
mov eax, edi
sub eax, dword [esp + 0x430]
cmp eax, ebp
jae 0x4028ef
lea ebx, [esp + 0x24]
mov eax, edi
sub eax, dword [esp + 0x430]
cmp eax, ebp
jae 0x40287d
mov al, byte [edi]
inc edi
cmp al, 0xa
jne 0x40286b
mov byte [ebx], 0xd
inc esi
inc ebx
mov byte [ebx], al
inc ebx
mov eax, ebx
lea ecx, [esp + 0x24]
sub eax, ecx
cmp eax, 0x400
jl 0x402852
lea eax, [esp + 0x24]
push 0
sub ebx, eax
lea ecx, [esp + 0x28]
lea eax, [esp + 0x18]
mov edx, dword [esp + 0x1c]
push eax
push ebx
push ecx
mov eax, dword [edx]
mov ecx, dword [esp + 0x2c]
mov edx, dword [eax + ecx]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4028e5
mov eax, dword [esp + 0x14]
add dword [esp + 0x20], eax
cmp eax, ebx
jge 0x40283d
jmp 0x4028ef
lea eax, [esp + 0x14]
push 0
mov edx, dword [esp + 0x434]
push eax
push ebp
mov ecx, dword [ecx]
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4028e5
mov dword [esp + 0x10], 0
mov eax, dword [esp + 0x14]
mov dword [esp + 0x20], eax
jmp 0x4028ef
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x10], eax
cmp dword [esp + 0x20], 0
jne 0x402996
cmp dword [esp + 0x10], 0
je 0x402948
cmp dword [esp + 0x10], 5
jne 0x40292b
mov dword [0x404044], 9
mov eax, dword [esp + 0x10]
pop ebp
pop edi
mov dword [0x404048], eax
mov eax, 0xffffffff
pop esi
pop ebx
add esp, 0x418
ret
mov eax, dword [esp + 0x10]
push eax
call fcn.00402bd0
add esp, 4
mov eax, 0xffffffff
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x418
ret
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
mov edx, dword [eax]
test byte [edx + ecx + 4], 0x40
je 0x402972
mov eax, dword [esp + 0x430]
cmp byte [eax], 0x1a
jne 0x402972
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x418
ret
mov eax, 0xffffffff
pop ebp
mov dword [0x404044], 0x1c
mov dword [0x404048], 0
pop edi
pop esi
pop ebx
add esp, 0x418
ret
mov eax, dword [esp + 0x20]
pop ebp
sub eax, esi
pop edi
pop esi
pop ebx
add esp, 0x418
ret
mov eax, 0xffffffff
pop ebp
mov dword [0x404044], 9
mov dword [0x404048], 0
pop edi
pop esi
pop ebx
add esp, 0x418
ret