joyce8/EMBER2024-capa huggingface dataset:
Function at 0x410204
Capabilities:
Encode data using xor
Encrypt data using blowfish

Disassembly:
push ebp
mov eax, dword [esp + 0x10]
mov ebp, esp
sub esp, 0xc
push ebx
push esi
push edi
mov dword [ecx + 8], eax
mov edi, ecx
xor eax, eax
mov ecx, dword [eax + 0x41e770]
mov edx, dword [edi]
mov dword [edx + eax], ecx
add eax, 4
cmp eax, 0x48
jl 0x410218
xor eax, eax
mov ecx, 4
mov edx, 0x100
mov esi, dword [eax + 0x41e7b8]
mov ebx, dword [edi + 4]
mov dword [ebx + eax], esi
add eax, 4
dec edx
jne 0x410237
dec ecx
jne 0x410232
xor esi, esi
xor ebx, ebx
mov ecx, dword [ebp + 8]
mov al, byte [esi + ecx]
mov byte [ebp - 1], al
lea eax, [esi + 1]
cdq
idiv dword [ebp + 0xc]
lea eax, [esi + 2]
mov dl, byte [ecx + edx]
mov byte [ebp - 2], dl
cdq
idiv dword [ebp + 0xc]
mov al, byte [ecx + edx]
mov byte [ebp - 3], al
lea eax, [esi + 3]
cdq
idiv dword [ebp + 0xc]
mov al, byte [ecx + edx]
mov byte [ebp - 4], al
mov eax, dword [edi]
mov edx, dword [ebp - 4]
xor dword [eax + ebx], edx
lea eax, [esi + 4]
cdq
idiv dword [ebp + 0xc]
mov esi, edx
add ebx, 4
cmp ebx, 0x48
jl 0x410253
xor esi, esi
mov dword [ebp - 8], esi
mov dword [ebp - 0xc], esi
lea eax, [ebp - 8]
lea ecx, [ebp - 0xc]
push eax
push ecx
mov ecx, edi
call fcn.0040fbd8
mov edx, dword [ebp - 0xc]
mov ecx, dword [edi]
mov dword [ecx + esi], edx
mov ecx, dword [edi]
mov eax, dword [ebp - 8]
add esi, 8
cmp esi, 0x48
mov dword [ecx + esi - 4], eax
jl 0x4102a1
xor ebx, ebx
mov esi, 4
mov dword [ebp - 4], pe_nt_image_headers32
lea eax, [ebp - 8]
lea ecx, [ebp - 0xc]
push eax
push ecx
mov ecx, edi
call fcn.0040fbd8
mov edx, dword [ebp - 0xc]
mov ecx, dword [edi + 4]
mov dword [ecx + ebx], edx
mov ecx, dword [edi + 4]
mov eax, dword [ebp - 8]
add ebx, 8
dec dword [ebp - 4]
mov dword [ecx + ebx - 4], eax
jne 0x4102d7
dec esi
jne 0x4102d0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
Function at 0x4127e7
Capabilities:
Get file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
push ebx
push esi
push edi
mov esi, dword [ebp + 0xc]
push esi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
cmp eax, 0xffffffff
je 0x412810
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
mov eax, 1
jmp 0x412882
push 0x140
push 0
push esi
call fcn.00417bb0
add esp, 0xc
push 0
push 0x2000000
push 3
push 0
push 1
push 0x40000000
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov edi, eax
je 0x412870
lea eax, [ebp - 0x34]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetFileInformationByHandle]
mov ebx, eax
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
je 0x412870
push 0x1c
lea eax, [ebp - 0x34]
push eax
push esi
call fcn.00417d00
add esp, 0xc
mov eax, 1
jmp 0x412882
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov dword [esi], eax
inc eax
cmp eax, 1
sbb eax, eax
inc eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
Function at 0x4144c0
Capabilities:
Get file size
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
mov dword [ebp - 0x10], ecx
push esi
push edi
mov esi, dword [ebp + 0xc]
xor edi, edi
push edi
push pe_nt_image_headers32
push 3
push edi
push 3
push bind
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [esi + 0x34], eax
cmp eax, 0xffffffff
je 0x4145cd
lea ecx, [ebp - 0xc]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
mov cl, 0x20
mov eax, dword [ebp - 0xc]
xor edx, edx
call fcn.00418850
or eax, ebx
or edx, edi
lea ecx, [esi + 0x20]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 8]
cmp edx, edi
mov dword [ecx], eax
mov dword [ecx + 4], edx
jne 0x414533
cmp eax, edi
jne 0x414533
mov eax, 1
jmp 0x4145d4
xor edi, edi
push edi
push ebx
push dword [ebp - 0xc]
push 2
push edi
push dword [esi + 0x34]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov dword [esi + 0x38], eax
cmp dword [esi + 0x24], edi
lea eax, [esi + 0x20]
mov edx, dword [eax]
mov dword [ebp - 8], edx
jl 0x414568
jg 0x414561
cmp dword [ebp - 8], 0x800000
jbe 0x414568
mov edi, 0x800000
jmp 0x41456b
mov edi, dword [ebp - 8]
mov edx, dword [esi + 0x2c]
lea eax, [esi + 0x28]
mov ecx, dword [eax]
mov dword [ebp - 8], ecx
mov cl, 0x20
mov dword [ebp - 4], edx
mov eax, dword [ebp - 8]
call fcn.00418870
push 0
mov dword [ebp - 0xc], eax
push 0x800000
push dword [ebp - 4]
push dword [ebp - 8]
call fcn.00418620
shl eax, 0x17
push edi
push eax
push dword [ebp - 0xc]
push 4
push dword [esi + 0x38]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [esi + 0x30], eax
test eax, eax
je 0x4145cd
push 1
push eax
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
cmp eax, 1
jne 0x4145cd
push esi
mov ecx, dword [ebp - 0x10]
call fcn.004145dd
xor eax, eax
jmp 0x4145d4
cmp dword [esi + 0x30], 1
sbb eax, eax
inc eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
Function at 0x414cce
Capabilities:
Check for time delay via gettickcount
Read and send data from client to server
Read file via mapping
Send data
Send data on socket

Disassembly:
push ebp
xor eax, eax
mov ebp, esp
sub esp, 0x10
push ebx
push esi
push edi
mov esi, dword [ebp + 8]
test esi, esi
je 0x414e25
cmp dword [esi + 0x34], 0xffffffff
je 0x414e25
mov edx, dword [esi + 0x2c]
lea edi, [esi + 0x20]
lea ebx, [esi + 0x28]
mov ecx, dword [ebx]
mov dword [ebp - 0x10], ecx
mov ecx, dword [edi]
mov dword [ebp - 0xc], edx
mov edx, dword [edi + 4]
sub ecx, dword [ebp - 0x10]
sbb edx, dword [ebp - 0xc]
mov dword [ebp - 8], ecx
mov dword [ebp - 4], edx
cmp edx, eax
jl 0x414d64
jg 0x414d1b
cmp dword [ebp - 8], eax
jbe 0x414d64
cmp dword [ebp - 4], 0
jl 0x414d33
jg 0x414d2c
cmp dword [ebp - 8], 0x10000
jbe 0x414d33
mov eax, 0x10000
jmp 0x414d36
mov eax, dword [ebp - 8]
push 0
push eax
push 0
push 0x800000
push dword [ebp - 0xc]
push dword [ebp - 0x10]
call fcn.00418790
mov ecx, dword [esi + 0x30]
add ecx, eax
mov eax, dword [esi + 8]
push ecx
push dword [eax + 8]
call sub.WSOCK32.dll_send
test eax, eax
jl 0x414e25
cdq
add eax, dword [ebx]
adc edx, dword [ebx + 4]
mov dword [ebp - 8], eax
mov dword [ebp - 4], edx
cmp dword [edi + 4], edx
mov eax, dword [ebp - 8]
mov dword [ebx], eax
mov dword [ebx + 4], edx
jne 0x414d94
cmp dword [edi], eax
jne 0x414d94
mov eax, dword [esi + 0x18]
sub eax, 0x62
cmp eax, 1
sbb eax, eax
add eax, 8
mov dword [esi + 0x48], eax
jmp 0x414e12
push 0
push 0x800000
push dword [ebp - 4]
push dword [ebp - 8]
call fcn.00418790
test edx, edx
jne 0x414e12
test eax, eax
jne 0x414e12
push dword [esi + 0x30]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov ecx, dword [ebx]
mov eax, dword [ebx + 4]
mov dword [ebp - 0x10], ecx
mov ecx, dword [edi]
mov dword [ebp - 0xc], eax
mov eax, dword [edi + 4]
sub ecx, dword [ebp - 0x10]
sbb eax, dword [ebp - 0xc]
mov dword [ebp - 8], ecx
mov dword [ebp - 4], eax
js 0x414de9
jg 0x414de0
cmp dword [ebp - 8], 0x800000
jbe 0x414de9
mov dword [ebp - 8], 0x800000
jmp 0x414def
mov eax, dword [ebp - 8]
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x10]
push dword [ebp - 8]
push ecx
mov cl, 0x20
mov edx, dword [ebp - 0xc]
call fcn.00418870
push eax
push 4
push dword [esi + 0x38]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [esi + 0x30], eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [esi + 8]
mov dword [ecx + 0x20], eax
mov eax, 1
jmp 0x414e27
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
Function at 0x41585a
Capabilities:
Set socket configuration

Disassembly:
push ebx
push esi
push edi
mov esi, ecx
mov edi, dword [esp + 0x10]
push ebp
test edi, edi
je 0x4158b0
lea ebx, [esi + 0x24]
mov ecx, ebx
mov eax, dword [ebx]
call dword [eax + 4]
lea ebp, [eax - 0x30]
test eax, eax
jne 0x41587b
xor ebp, ebp
test ebp, ebp
je 0x4158b0
cmp dword [ebp + 0x44], edi
jne 0x415890
mov ecx, ebp
call fcn.0040460b
cmp eax, 1
jne 0x4158ed
test ebp, ebp
je 0x415899
add ebp, 0x30
jmp 0x41589b
xor ebp, ebp
mov eax, dword [ebx]
push ebp
mov ecx, ebx
call dword [eax + 8]
lea ebp, [eax - 0x30]
test eax, eax
jne 0x4158ac
xor ebp, ebp
test ebp, ebp
jne 0x41587f
push 0x8304
call fcn.00417e70
add esp, 4
test eax, eax
je 0x4158f9
push dword [esp + 0x18]
push edi
lea ebx, [esi + 0x60]
mov ecx, eax
push dword [esi + 0x90]
push dword [esi + 0x98]
push ebx
push dword [esi + 0x94]
push dword [esi + 0x8c]
call fcn.004013b1
mov edi, eax
jmp 0x4158fb
push 1
mov ecx, esi
push ebp
call fcn.00416d60
jmp 0x415962
xor edi, edi
test edi, edi
jne 0x415903
xor eax, eax
jmp 0x415967
lea eax, [edi + 0x30]
lea ecx, [esi + 0x24]
push eax
mov ebx, dword [ecx]
call dword [ebx]
mov ebp, dword [edi]
xor ebx, ebx
push ebx
mov ecx, edi
call dword [ebp + 0xe4]
push 0xa
mov ecx, edi
call dword [ebp + 4]
push 1
mov ecx, esi
push edi
call fcn.00417852
cmp dword [esi + 0x6c], ebx
jne 0x415962
mov eax, dword [esi + 0x98]
cmp dword [eax + 0x35c], ebx
jne 0x415962
push 1
push dword [esi + 0xa0]
call sub.WSOCK32.dll_htons
movzx eax, ax
push eax
push str.127.0.0.1
call sub.WSOCK32.dll_inet_addr
push eax
mov ecx, esi
call fcn.004166f9
mov eax, 1
pop ebp
pop edi
pop esi
pop ebx
ret 8
Function at 0x41697c
Capabilities:
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x84
push ebx
lea eax, [ebp - 4]
push esi
push edi
mov esi, ecx
push eax
push 7
mov eax, dword [ebp + 8]
add eax, 0x84
push eax
call fcn.0040c8f7
add esp, 0xc
test eax, eax
je 0x416b89
push eax
call fcn.00418780
add esp, 4
mov dword [ebp - 0x14], eax
lea eax, [ebp - 4]
push eax
push 7
push 0
call fcn.0040c8f7
add esp, 0xc
test eax, eax
je 0x416b89
push eax
xor edi, edi
call fcn.00418780
add esp, 4
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], 0
lea eax, [ebp - 4]
mov ebx, 7
push eax
push ebx
push edi
call fcn.0040c8f7
add esp, 0xc
test eax, eax
je 0x416b11
push 0x32
lea ecx, [ebp - 0x84]
push eax
push ecx
call fcn.0040b5f2
add esp, 0xc
lea ecx, [ebp - 4]
push ecx
push ebx
push edi
call fcn.0040c8f7
add esp, 0xc
test eax, eax
je 0x416b11
push 0x32
lea ecx, [ebp - 0x52]
push eax
push ecx
call fcn.0040b5f2
add esp, 0xc
lea ecx, [ebp - 4]
push ecx
push ebx
push edi
call fcn.0040c8f7
add esp, 0xc
test eax, eax
je 0x416b11
push eax
call fcn.004186d0
add esp, 4
mov dword [ebp - 0x18], eax
lea eax, [ebp - 4]
push eax
push ebx
push edi
call fcn.0040c8f7
add esp, 0xc
test eax, eax
je 0x416b11
push eax
call sub.WSOCK32.dll_inet_addr
mov dword [ebp - 0x20], eax
lea eax, [ebp - 4]
push eax
push ebx
push edi
call fcn.0040c8f7
add esp, 0xc
test eax, eax
je 0x416b11
push eax
call fcn.00418780
add esp, 4
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 4]
push eax
push ebx
push edi
call fcn.0040c8f7
add esp, 0xc
mov ebx, eax
test ebx, ebx
je 0x416b11
push 0x41fba0
push ebx
call fcn.00417e80
add esp, 8
test eax, eax
jne 0x416ac2
mov ebx, 0x41d23c
lea eax, [ebp - 4]
push eax
push 7
push edi
call fcn.0040c8f7
add esp, 0xc
mov dword [ebp - 8], eax
cmp eax, edi
je 0x416b11
push 0x41fba0
push eax
call fcn.00417e80
add esp, 8
test eax, eax
jne 0x416af1
mov dword [ebp - 8], 0x41d23c
mov eax, dword [ebp - 0x18]
lea ecx, [ebp - 0x84]
push dword [ebp - 8]
push ebx
or al, 1
push eax
push ecx
mov ecx, esi
call fcn.00415e8c
inc dword [ebp - 0xc]
jmp 0x4169e2
xor ecx, ecx
cmp dword [ebp - 0x14], ecx
jne 0x416b3f
mov eax, dword [ebp - 0xc]
cmp dword [ebp - 0x10], eax
jg 0x416b3f
mov eax, dword [esi + 0x98]
mov dword [esi + 0xac], ecx
cmp dword [eax + 0x35c], ecx
je 0x416b89
push 1
mov ecx, esi
call fcn.004165bc
jmp 0x416b89
mov eax, dword [ebp - 0x14]
sub eax, dword [ebp - 0x10]
add eax, dword [ebp - 0xc]
push eax
call fcn.00418230
add esp, 4
mov ecx, dword [esi + 0x8c]
push eax
push 0x12
push dword [ebp + 8]
call fcn.0040859e
push 0
mov ecx, dword [esi + 0x98]
mov edi, 0x105
push dword [ecx + 0x360]
push edi
push dword [esi + 0x20]
call dword [sym.imp.USER32.dll_SetTimer]
test eax, eax
je 0x416b89
mov dword [esi + 0xb0], edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
Function at 0x416e08
Capabilities:
Link many functions at runtime

Disassembly:
push ebx
push esi
push edi
xor ebx, ebx
lea esi, [ecx + 0x98]
push ebp
mov eax, dword [esi]
mov edi, ecx
push str.advapi32.dll
mov dword [eax + 0x294], ebx
mov eax, dword [esi]
mov ecx, dword [eax + 0x294]
mov dword [eax + 0x290], ecx
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
cmp eax, ebx
mov ebp, eax
jne 0x416e52
push ebx
push str.advapi32
call fcn.0040c1f6
add esp, 8
xor eax, eax
jmp 0x417027
push str.CryptAcquireContextA
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push ebp
call ebx
push str.CryptDestroyKey
mov dword [0x420554], eax
push ebp
call ebx
push str.CryptGetKeyParam
mov dword [0x420548], eax
push ebp
call ebx
push str.CryptSetKeyParam
mov dword [0x420620], eax
push ebp
call ebx
push str.CryptExportKey
mov dword [0x420630], eax
push ebp
call ebx
push str.CryptGetUserKey
mov dword [0x420534], eax
push ebp
call ebx
push str.CryptEncrypt
mov dword [0x420538], eax
push ebp
call ebx
push str.CryptGenKey
mov dword [0x420624], eax
push ebp
call ebx
push str.CryptGenRandom
mov dword [0x420530], eax
push ebp
call ebx
push str.CryptImportKey
mov dword [0x420634], eax
push ebp
call ebx
push str.CryptDecrypt
mov dword [0x42053c], eax
push ebp
call ebx
push str.CryptCreateHash
mov dword [0x42062c], eax
push ebp
call ebx
push str.CryptHashData
mov dword [0x420628], eax
push ebp
call ebx
push str.CryptSignHashA
mov dword [0x420550], eax
push ebp
call ebx
push str.CryptVerifySignatureA
mov dword [0x420544], eax
push ebp
call ebx
mov dword [0x420540], eax
push str.CryptReleaseContext
push ebp
call ebx
push 0
mov dword [0x42054c], eax
cmp dword [0x420554], 0
jne 0x416f47
push str.GetProcAddress
call fcn.0040c1f6
add esp, 8
xor eax, eax
jmp 0x417027
mov ecx, edi
xor ebx, ebx
xor ebp, ebp
call fcn.0041702c
mov ecx, dword [esi]
mov eax, dword [ecx + 0x290]
test eax, eax
je 0x416f66
cmp dword [ecx + 0x298], ebp
je 0x416f76
cmp dword [ecx + 0x294], ebp
je 0x416fcc
cmp dword [ecx + 0x2a8], ebp
jne 0x416fcc
inc ebx
cmp ebx, 5
jg 0x416fe5
test eax, eax
je 0x416f90
push ebp
push eax
call dword [0x42054c]
mov eax, dword [esi]
mov dword [eax + 0x290], ebp
mov eax, dword [esi]
mov eax, dword [eax + 0x294]
test eax, eax
je 0x416fac
push ebp
push eax
call dword [0x42054c]
mov eax, dword [esi]
mov dword [eax + 0x294], ebp
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebx - 5]
mov ecx, edi
cmp eax, 1
sbb eax, eax
and eax, 2
push eax
call fcn.0041702c
jmp 0x416f52
cmp ebx, 5
jg 0x416fe5
mov eax, dword [esi]
cmp dword [eax + 0x298], 0
jne 0x417009
cmp dword [eax + 0x2a8], 0
jne 0x417009
push 1
mov eax, dword [edi]
push 0x41d268
mov ecx, edi
push str.RSA_failed._Create_New_RSA_key_
call dword [eax + 0x90]
cmp eax, 1
jne 0x417009
push 3
mov ecx, edi
call fcn.0041702c
mov eax, dword [esi]
cmp dword [eax + 0x298], 0
jne 0x417022
cmp dword [eax + 0x2a8], 0
mov eax, 0
je 0x417027
mov eax, 1
pop ebp
pop edi
pop esi
pop ebx
ret
Function at 0x418950
Capabilities:
Accept command line arguments

Disassembly:
mov eax, dword fs:[0]
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41c788
push 0x419c1c
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 [0x42012c], eax
xor eax, eax
mov al, byte [0x42012d]
mov dword [0x420138], eax
mov eax, dword [0x42012c]
shr dword [0x42012c], 0x10
and eax, 0xff
mov dword [0x420134], eax
shl eax, 8
add eax, dword [0x420138]
mov dword [0x420130], eax
call fcn.00418b10
mov dword [ebp - 4], 0
call fcn.00419a40
call fcn.00419a30
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov dword [0x420864], eax
call fcn.004195d0
mov dword [0x41fec0], eax
test eax, eax
je 0x4189e9
cmp dword [0x420864], 0
jne 0x4189f3
push 0xffffffffffffffff
call fcn.00418e80
add esp, 4
call fcn.00419350
call fcn.00419270
call fcn.00418e50
mov esi, dword [0x420864]
mov al, byte [esi]
cmp al, 0x22
je 0x418a1a
cmp al, 0x20
jbe 0x418a47
inc esi
cmp byte [esi], 0x20
ja 0x418a12
jmp 0x418a47
inc esi
cmp byte [esi], 0x22
je 0x418a46
mov bl, byte [ebp - 0x28]
mov bl, byte [esi]
test bl, bl
je 0x418a41
xor eax, eax
mov al, bl
push eax
call fcn.00419210
add esp, 4
test eax, eax
je 0x418a3b
inc esi
inc esi
cmp byte [esi], 0x22
jne 0x418a23
cmp byte [esi], 0x22
jne 0x418a47
inc esi
cmp byte [esi], 0
je 0x418a57
cmp byte [esi], 0x20
ja 0x418a57
inc esi
cmp byte [esi], 0
jne 0x418a4c
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 0x418a7b
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.00418e80
jmp 0x418abc
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 0x418ec0
Capabilities:
Terminate process

Disassembly:
cmp dword [0x420168], 1
push ebx
push esi
mov esi, dword [esp + 0xc]
push edi
jne 0x418ede
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
mov dword [0x420164], 1
cmp dword [esp + 0x14], 0
mov ebx, dword [esp + 0x18]
mov byte [0x420160], bl
jne 0x418f38
cmp dword [0x420858], 0
je 0x418f26
mov edi, dword [0x420854]
sub edi, 4
cmp dword [0x420858], edi
ja 0x418f26
mov eax, dword [edi]
test eax, eax
je 0x418f1b
call eax
sub edi, 4
cmp dword [0x420858], edi
jbe 0x418f13
push 0x41d014
push 0x41d010
call fcn.00418f70
add esp, 8
push 0x41d01c
push 0x41d018
call fcn.00418f70
add esp, 8
test ebx, ebx
jne 0x418f5f
mov dword [0x420168], 1
push esi
call dword [sym.imp.KERNEL32.dll_ExitProcess]
pop edi
pop esi
pop ebx
ret
Function at 0x4195d0
Capabilities:
Query environment variable

Disassembly:
sub esp, 4
cmp dword [0x420210], 0
push ebx
push esi
push edi
mov esi, dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
push ebp
jne 0x41961c
call esi
mov edi, eax
test edi, edi
je 0x4195fa
mov dword [0x420210], 1
jmp 0x419620
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStrings]
mov ebx, eax
test ebx, ebx
je 0x419612
mov dword [0x420210], 2
jmp 0x419624
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]
cmp dword [0x420210], 1
jne 0x4196d3
test edi, edi
jne 0x419647
call esi
mov edi, eax
test edi, edi
jne 0x419647
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
cmp word [edi], 0
mov esi, edi
je 0x419661
add esi, 2
cmp word [esi], 0
jne 0x41964f
add esi, 2
cmp word [esi], 0
jne 0x41964f
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 0x4196c2
push ebp
call fcn.004188a0
add esp, 4
mov ebx, eax
test ebx, ebx
je 0x4196c2
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 0x4196b1
push ebx
call fcn.00417e50
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 [0x420210], 2
jne 0x419757
test ebx, ebx
jne 0x4196f6
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStrings]
mov ebx, eax
test ebx, ebx
jne 0x4196f6
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
mov ebp, ebx
cmp byte [ebx], 0
je 0x41970b
inc ebp
cmp byte [ebp], 0
jne 0x4196fd
inc ebp
cmp byte [ebp], 0
jne 0x4196fd
sub ebp, ebx
inc ebp
push ebp
call fcn.004188a0
mov dword [esp + 0x14], eax
add esp, 4
test eax, eax
jne 0x419730
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 0x419d40
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x1a8
xor ecx, ecx
mov eax, 0x420438
push ebx
mov edx, dword [esp + 0x1b0]
push esi
push edi
push ebp
cmp dword [eax], edx
je 0x419d67
add eax, 8
inc ecx
cmp eax, 0x4204c0
jb 0x419d58
cmp dword [ecx*8 + 0x420438], edx
lea ebx, [ecx*8]
jne 0x419f22
cmp dword [0x41fecc], 1
je 0x419ee7
cmp dword [0x41fecc], 0
jne 0x419d9e
cmp dword [0x41fed0], 1
je 0x419ee7
cmp edx, 0xfc
je 0x419f22
lea eax, [esp + 0xb4]
push 0x104
push eax
mov ebp, dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0
call ebp
test eax, eax
jne 0x419ddb
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 0x419e1f
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 0x41ca44
push ebp
call fcn.00417f90
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, 0x41ca24
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 + 0x42043c]
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.0041a060
add esp, 0xc
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x1a8
ret
mov eax, dword [0x420750]
mov esi, dword [eax + 0x10]
cmp esi, 0xffffffff
jne 0x419efe
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov esi, eax
mov edx, dword [ebx + 0x42043c]
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