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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [ebp + 8]
mov ecx, eax
push ebx
mov ebx, dword [ebp + 0xc]
and eax, 0x3f
push esi
sar ecx, 6
push edi
imul edi, eax, 0x38
mov dword [ebp - 8], ecx
mov eax, dword [ecx*4 + 0x1003dcf8]
push 0xa
pop edx
mov dword [ebp - 0x18], edx
mov ecx, dword [eax + edi + 0x18]
mov dword [ebp - 0x1c], ecx
mov ecx, dword [ebp + 0x10]
test ecx, ecx
je 0x1001fe6e
cmp word [ebx], dx
jne 0x1001fe6e
or byte [eax + edi + 0x28], 4
jmp 0x1001fe73
and byte [eax + edi + 0x28], 0xfb
lea edx, [ebx + ecx*2]
mov eax, ebx
mov dword [ebp - 0xc], edx
mov esi, ebx
mov dword [ebp - 4], eax
cmp ebx, edx
jae 0x1001ffd6
mov dword [ebp - 0x10], 0xd
movzx ecx, word [eax]
mov edx, ecx
mov dword [ebp - 0x14], edx
mov edx, dword [ebp - 0xc]
cmp ecx, 0x1a
je 0x1001ffb6
add eax, 2
cmp cx, word [ebp - 0x10]
je 0x1001feb4
mov dword [ebp - 4], eax
mov word [esi], cx
jmp 0x1001feea
cmp eax, edx
jae 0x1001fef8
movzx eax, word [eax]
xor ecx, ecx
cmp ax, word [ebp - 0x18]
mov edx, eax
push 0xa
sete cl
xor eax, eax
lea ecx, [ecx*2 + 2]
add dword [ebp - 4], ecx
pop ecx
cmp dx, cx
mov edx, dword [ebp - 0xc]
sete al
dec eax
and eax, 3
add eax, ecx
mov word [esi], ax
mov eax, dword [ebp - 4]
push 2
pop ecx
add esi, ecx
cmp eax, edx
jb 0x1001fe8f
jmp 0x1001ffd6
push 0
lea eax, [ebp - 0x18]
push eax
push 2
lea eax, [ebp - 4]
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1001ffb1
cmp dword [ebp - 0x18], 0
je 0x1001ffb1
mov edx, dword [ebp - 8]
push 0xa
mov eax, dword [edx*4 + 0x1003dcf8]
test byte [eax + edi + 0x28], 0x48
je 0x1001ff87
lea eax, [esi + 2]
mov dword [ebp - 0x1c], eax
mov ax, word [ebp - 4]
pop ecx
mov word [ebp - 2], ax
cmp ax, cx
jne 0x1001ff4b
mov word [esi], cx
jmp 0x1001ff82
push 0xd
pop ecx
mov word [esi], cx
movzx ecx, ax
mov eax, dword [edx*4 + 0x1003dcf8]
mov dx, word [ebp - 2]
shr ecx, 8
push 0xa
mov byte [eax + edi + 0x2a], dl
mov edx, dword [ebp - 8]
mov eax, dword [edx*4 + 0x1003dcf8]
mov byte [eax + edi + 0x2b], cl
mov eax, dword [edx*4 + 0x1003dcf8]
pop ecx
mov byte [eax + edi + 0x2c], cl
mov esi, dword [ebp - 0x1c]
jmp 0x1001ffd6
pop eax
cmp word [ebp - 4], ax
jne 0x1001ff97
cmp esi, ebx
jne 0x1001ff97
mov word [esi], ax
jmp 0x1001ffd3
push 1
push 0xffffffffffffffff
push 0xfffffffffffffffe
push dword [ebp + 8]
call fcn.10020861
add esp, 0x10
push 0xa
pop eax
cmp word [ebp - 4], ax
je 0x1001ffd6
push 0xd
pop eax
jmp 0x1001ff92
mov edx, dword [ebp - 8]
mov edx, dword [edx*4 + 0x1003dcf8]
mov al, byte [edx + edi + 0x28]
test al, 0x40
jne 0x1001ffd0
or al, 2
mov byte [edx + edi + 0x28], al
jmp 0x1001ffd6
mov word [esi], cx
add esi, 2
sub esi, ebx
and esi, 0xfffffffe
pop edi
mov eax, esi
pop esi
pop ebx
leave
ret
Function at 0x10021c7e
Capabilities:
Query environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push ecx
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
mov esi, eax
test esi, esi
je 0x10021d1b
push ebx
push esi
call fcn.10021c47
xor ebx, ebx
sub eax, esi
push ebx
push ebx
push ebx
push ebx
sar eax, 1
push eax
push esi
push ebx
push ebx
mov dword [ebp - 8], eax
call fcn.1001abd2
add esp, 0x24
mov dword [ebp - 4], eax
test eax, eax
jne 0x10021cc8
push esi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
xor eax, eax
jmp 0x10021d1a
push edi
push eax
call fcn.1001971c
mov edi, eax
pop ecx
push ebx
test edi, edi
jne 0x10021ce8
call fcn.10017fc4
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
xor eax, eax
jmp 0x10021d19
push ebx
push dword [ebp - 4]
push edi
push dword [ebp - 8]
push esi
push ebx
push ebx
call fcn.1001abd2
add esp, 0x20
test eax, eax
jne 0x10021d07
push edi
call fcn.10017fc4
jmp 0x10021d0f
push ebx
call fcn.10017fc4
mov ebx, edi
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
mov eax, ebx
pop edi
pop ebx
pop esi
leave
ret

Function at 0x10021d1e
Capabilities:
Query environment variable

Disassembly:
mov edi, edi
push esi
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
mov esi, eax
test esi, esi
jne 0x10021d2f
pop esi
ret
push ebx
push edi
push esi
call fcn.10021c47
mov ebx, eax
sub ebx, esi
and ebx, 0xfffffffe
push ebx
call fcn.1001971c
mov edi, eax
pop ecx
pop ecx
test edi, edi
je 0x10021d57
push ebx
push esi
push edi
call fcn.1000b8d0
add esp, 0xc
push 0
call fcn.10017fc4
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
mov eax, edi
pop edi
pop ebx
pop esi
ret

Function at 0x10022127
Capabilities:
Set environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
pop ebp
jmp fcn.10021d6c
Function at 0x10026981
Capabilities:
Clear file content

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
mov ebx, dword [ebp + 8]
lea ecx, [ebp - 0x2c]
push esi
push edi
push dword [ebp + 0x10]
mov edi, dword [ebp + 0x14]
push dword [ebp + 0xc]
push ebx
call fcn.100268fd
mov eax, dword [ebp - 0x2c]
and eax, dword [ebp - 0x28]
cmp eax, 0xffffffff
je 0x10026af0
mov eax, dword [ebp - 0x24]
and eax, dword [ebp - 0x20]
cmp eax, 0xffffffff
je 0x10026af0
mov ecx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 8], ecx
mov dword [ebp - 4], eax
test ecx, ecx
jl 0x10026aa5
jg 0x100269dd
test eax, eax
je 0x10026a9b
push 1
push 0x1000
call fcn.1001b40d
mov esi, eax
pop ecx
pop ecx
test esi, esi
jne 0x10026a00
push 0xc
pop ebx
mov byte [edi + 0x1c], 1
mov dword [edi + 0x18], ebx
jmp 0x10026a92
push 0x8000
push ebx
call fcn.1002682e
pop ecx
pop ecx
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x18]
test eax, eax
jl 0x10026a29
jg 0x10026a24
cmp ecx, 0x1000
jb 0x10026a29
mov ecx, 0x1000
push edi
push ecx
push esi
push ebx
call fcn.10019181
add esp, 0x10
cmp eax, 0xffffffff
je 0x10026a6e
mov ecx, dword [ebp - 4]
cdq
sub ecx, eax
mov eax, dword [ebp - 8]
mov dword [ebp - 4], ecx
sbb eax, edx
mov dword [ebp - 8], eax
test eax, eax
jg 0x10026a24
jl 0x10026a55
test ecx, ecx
jne 0x10026a16
push dword [ebp - 0xc]
push ebx
call fcn.1002682e
push esi
call fcn.10017fc4
add esp, 0xc
xor ebx, ebx
jmp 0x10026afe
cmp byte [edi + 0x24], 0
je 0x10026a85
cmp dword [edi + 0x20], 5
jne 0x10026a85
mov byte [edi + 0x1c], 1
mov dword [edi + 0x18], 0xd
cmp byte [edi + 0x1c], 0
je 0x10026a90
mov ebx, dword [edi + 0x18]
jmp 0x10026a92
xor ebx, ebx
push esi
call fcn.10017fc4
pop ecx
jmp 0x10026afe
test ecx, ecx
jg 0x10026a67
jl 0x10026aa5
test eax, eax
jae 0x10026a67
push 0
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push ebx
call fcn.10020861
and eax, edx
add esp, 0x10
cmp eax, 0xffffffff
jne 0x10026ac5
cmp byte [edi + 0x1c], 0
je 0x10026a67
jmp 0x10026af6
push ebx
call fcn.100232c7
pop ecx
push eax
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x10026a67
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0xd
mov byte [edi + 0x24], 1
mov dword [edi + 0x20], eax
pop ebx
mov byte [edi + 0x1c], 1
mov dword [edi + 0x18], ebx
jmp 0x10026afe
cmp byte [edi + 0x1c], 0
je 0x10026afb
mov ebx, dword [edi + 0x18]
jmp 0x10026afe
push 0x16
pop ebx
push 0
push dword [ebp - 0x28]
push dword [ebp - 0x2c]
push dword [ebp - 0x14]
call fcn.10020861
add esp, 0x10
mov eax, ebx
pop edi
pop esi
pop ebx
leave
ret

Function at 0x10028100
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 8]
mov ecx, 0x5a4d
cmp word [eax], cx
jne 0x1002812d
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x1002812d
mov edx, 0x10b
xor eax, eax
cmp word [ecx + 0x18], dx
sete al
pop ebp
ret
xor eax, eax
pop ebp
ret
Function at 0x50003838
Capabilities:
Get file size
Read file on windows

Disassembly:
call dword [sym.imp.kernel32.dll_GetFileSize]
mov ebx, eax
push 4
push 0x1000
mov eax, dword [ebp + 0x3c]
push eax
push 0
call dword [sym.imp.kernel32.dll_VirtualAlloc]
mov esi, eax
xor eax, eax
lea edx, [esp + 0x18]
mov dword [edx], eax
push eax
push edx
push ebx
push esi
push edi
call dword [sym.imp.kernel32.dll_ReadFile]
test eax, eax
je 0x5000398d
mov edx, dword [ebp + 0x28]
mov ebx, dword [esp + 0x18]
add ebx, esi
lea eax, [esi + edx]
mov ecx, dword [eax]
lea edx, [eax + 8]
mov edi, dword [eax + 4]
test ecx, ecx
jbe 0x50003894
xor esi, esi
inc esi
add dword [edx], edi
add edx, 4
cmp esi, ecx
jb 0x5000388a
mov ecx, dword [ebp + 0x44]
push eax
push eax
lea edx, [ecx + eax + 1]
lea esi, [eax + ecx]
mov eax, dword [esp + 8]
call fcn.5000399d
mov edi, eax
test edi, edi
je 0x5000398d
movsx eax, byte [esi]
lea ecx, [esi + eax]
mov dword [esp + 4], ecx
push eax
push eax
lea edx, [ecx + 1]
mov eax, dword [esp + 8]
call fcn.5000399d
mov dword [esp + 8], eax
test eax, eax
je 0x5000398d
mov edx, dword [esp + 4]
movsx ecx, byte [edx]
lea esi, [edx + ecx + 1]
lea eax, [edx + ecx]
mov dword [esp + 0xc], eax
push esi
call edi
mov esi, eax
test esi, esi
je 0x5000398d
mov edx, dword [esp + 0xc]
mov eax, dword [esi + 0x3c]
movsx edi, byte [edx]
add edx, edi
mov edi, dword [ebp + 0x14]
add edi, edx
mov dword [esp + 0x1c], edi
mov edi, dword [edx + 4]
mov edx, dword [edx + 8]
add esi, dword [eax + esi + 0x2c]
lea eax, [esp]
mov dword [eax + 4], edx
mov dword [eax], 0
push eax
mov ecx, dword [ebp + 4]
push ecx
push edx
push esi
call dword [esp + 0x18]
add esp, 0xfffffff4
mov eax, esi
mov edx, dword [esp + 0x28]
mov ecx, dword [esp + 0x10]
call fcn.50003cd5
lea edx, [esp]
push edx
push dword [esp + 4]
push dword [esp + 0xc]
push esi
call dword [esp + 0x18]
mov ecx, dword [ebp + 0x4c]
xor edx, edx
cmp byte [ecx], 0
je 0x5000396e
mov ecx, dword [ebp + 0x4c]
movsx ecx, byte [ecx + edx]
mov word [ebx + edx*2], cx
inc edx
mov ecx, dword [ebp + 0x4c]
cmp byte [ecx + edx], 0
jne 0x50003959
xor ecx, ecx
lea eax, [esp + 8]
mov word [ebx + edx*2], cx
add edi, esi
mov edx, dword [eax + 0x14]
add edx, dword [eax - 4]

Function at 0x500042f0
Capabilities:
Get common file path
Set current directory

Disassembly:
push ebx
push esi
add esp, 0xfffffdf0
mov esi, edx
mov ebx, eax
test bl, bl
je 0x5000432c
movzx eax, bl
add eax, 0x41
dec eax
mov byte [esp], al
mov byte [esp + 1], 0x3a
mov byte [esp + 2], 0
lea eax, [esp + 0x109]
push eax
push 0x105
call sub.kernel32.dll_GetCurrentDirectoryA
push esp
call sub.kernel32.dll_SetCurrentDirectoryA
lea eax, [esp + 4]
push eax
push 0x105
call sub.kernel32.dll_GetCurrentDirectoryA
test bl, bl
je 0x5000434c
lea eax, [esp + 0x109]
push eax
call sub.kernel32.dll_SetCurrentDirectoryA
mov eax, esi
lea edx, [esp + 4]
mov ecx, 0x105
push 0
call sym.rtl120.bpl__System__LStrFromArray_qqrr27System__AnsiStringT_us_i0__pcius
add esp, 0x210
pop esi
pop ebx
ret
Function at 0x50004368
Capabilities:
Get common file path
Set current directory

Disassembly:
push ebx
push esi
add esp, 0xfffffbe4
mov esi, edx
mov ebx, eax
test bl, bl
je 0x500043a9
movzx eax, bl
add eax, 0x41
dec eax
mov word [esp], ax
mov word [esp + 2], 0x3a
mov word [esp + 4], 0
lea eax, [esp + 0x212]
push eax
push 0x105
call sub.kernel32.dll_GetCurrentDirectoryW
push esp
call sub.kernel32.dll_SetCurrentDirectoryW
lea eax, [esp + 8]
push eax
push 0x105
call sub.kernel32.dll_GetCurrentDirectoryW
test bl, bl
je 0x500043c9
lea eax, [esp + 0x212]
push eax
call sub.kernel32.dll_SetCurrentDirectoryW
mov eax, esi
lea edx, [esp + 8]
mov ecx, 0x105
call sym.rtl120.bpl__System__WStrFromWArray_qqrr17System_WideStringpbi
add esp, 0x41c
pop esi
pop ebx
ret

Function at 0x5000472c
Capabilities:
Accept command line arguments

Disassembly:
push ebx
push esi
push edi
add esp, 0xfffffdf4
mov ebx, edx
mov esi, eax
mov eax, ebx
xor edx, edx
call sym.rtl120.bpl__System__UStrAsg_qqrr20System_UnicodeStringx20System_UnicodeString
test esi, esi
jne 0x50004764
push 0x105
lea eax, [esp + 4]
push eax
push 0
call sub.kernel32.dll_GetModuleFileNameW
mov ecx, eax
mov edx, esp
mov eax, ebx
call sym.rtl120.bpl__System__UStrFromPWCharLen_qqrr20System_UnicodeStringpbi
jmp 0x50004782
call sub.kernel32.dll_GetCommandLineW
mov edi, eax
mov edx, ebx
mov eax, edi
call fcn.50004610
mov edi, eax
test esi, esi
je 0x50004782
cmp dword [ebx], 0
je 0x50004782
dec esi
jmp 0x5000476b
add esp, 0x20c
pop edi
pop esi
pop ebx
ret

Function at 0x5000480c
Capabilities:
Generate random numbers using the delphi lcg

Disassembly:
push ebx
xor ebx, ebx
imul edx, dword [ebx + sym.rtl120.bpl__System_RandSeed], 0x8088405
inc edx
mov dword [ebx + sym.rtl120.bpl__System_RandSeed], edx
mul edx
mov eax, edx
pop ebx
ret

Function at 0x50004828
Capabilities:
Generate random numbers using the delphi lcg

Disassembly:
push ebx
xor ebx, ebx
imul edx, dword [ebx + sym.rtl120.bpl__System_RandSeed], 0x8088405
inc edx
mov dword [ebx + sym.rtl120.bpl__System_RandSeed], edx
fld qword [ebx + 0x5009c7d8]
push 0
push edx
fild qword [esp]
add esp, 8
fmulp st(1)
pop ebx
ret

Function at 0x50005c08
Capabilities:
Clear file content

Disassembly:
movzx edx, word [eax + 4]
sub edx, 0xd7b1
cmp edx, 2
ja 0x50005c26
push dword [eax]
call sub.kernel32.dll_SetEndOfFile
dec eax
je 0x50005c30
jmp fcn.50004244
mov eax, 0x67
jmp sym.rtl120.bpl__System_SetInOutRes_qqri
ret

Function at 0x50005d18
Capabilities:
Write file on windows

Disassembly:
push ebx
mov ebx, eax
movzx eax, word [eax + 4]
sub eax, 0xd7b2
cmp eax, 1
ja 0x50005d4b
push 0
mov eax, esp
push 0
push eax
push dword [ebx + 8]
push edx
push dword [ebx]
call sub.kernel32.dll_WriteFile
pop edx
dec eax
jne 0x50005d52
cmp edx, dword [ebx + 8]
je 0x50005d5c
mov eax, 0x65
jmp 0x50005d57
mov eax, 5
jmp 0x50005d57
call sub.kernel32.dll_GetLastError
call sym.rtl120.bpl__System_SetInOutRes_qqri
mov eax, ebx
pop ebx
ret
Function at 0xda4058
Capabilities:
Decompress data using aplib

Disassembly:
call 0xda41a8
push ebx
mov ebx, esp
push ebx
mov esi, dword [ebx + 8]
mov edi, dword [ebx + 0x10]
cld
mov dl, 0x80
mov al, byte [esi]
inc esi
mov byte [edi], al
inc edi
mov ebx, 2
add dl, dl
jne 0xda407e
mov dl, byte [esi]
inc esi
adc dl, dl
jae 0xda406a
add dl, dl
jne 0xda4089
mov dl, byte [esi]
inc esi
adc dl, dl
jae 0xda40dc
xor eax, eax
add dl, dl
jne 0xda4096
mov dl, byte [esi]
inc esi
adc dl, dl
jae 0xda417d
add dl, dl
jne 0xda40a5
mov dl, byte [esi]
inc esi
adc dl, dl
adc eax, eax
add dl, dl
jne 0xda40b0
mov dl, byte [esi]
inc esi
adc dl, dl
adc eax, eax
add dl, dl
jne 0xda40bb
mov dl, byte [esi]
inc esi
adc dl, dl
adc eax, eax
add dl, dl
jne 0xda40c6
mov dl, byte [esi]
inc esi
adc dl, dl
adc eax, eax
je 0xda40d2
push edi
mov eax, eax
sub edi, eax
mov al, byte [edi]
pop edi
mov byte [edi], al
inc edi
mov ebx, 2
jmp 0xda4075
mov eax, 1
add dl, dl
jne 0xda40ea
mov dl, byte [esi]
inc esi
adc dl, dl
adc eax, eax
add dl, dl
jne 0xda40f5
mov dl, byte [esi]
inc esi
adc dl, dl
jb 0xda40e1
sub eax, ebx
mov ebx, 1
jne 0xda4128
mov ecx, 1
add dl, dl
jne 0xda410e
mov dl, byte [esi]
inc esi
adc dl, dl
adc ecx, ecx
add dl, dl
jne 0xda4119
mov dl, byte [esi]
inc esi
adc dl, dl
jb 0xda4105
push esi
mov esi, edi
sub esi, ebp
rep movsb byte es:[edi], byte [esi]
pop esi
jmp 0xda4075
dec eax
shl eax, 8
mov al, byte [esi]
inc esi
mov ebp, eax
mov ecx, 1
add dl, dl
jne 0xda413f
mov dl, byte [esi]
inc esi
adc dl, dl
adc ecx, ecx
add dl, dl
jne 0xda414a
mov dl, byte [esi]
inc esi
adc dl, dl
jb 0xda4136
cmp eax, 0x7d00
jae 0xda416d
cmp eax, 0x500
jb 0xda4168
inc ecx
push esi
mov esi, edi
sub esi, eax
rep movsb byte es:[edi], byte [esi]
pop esi
jmp 0xda4075
cmp eax, 0x7f
ja 0xda4170
add ecx, 2
push esi
mov esi, edi
sub esi, eax
rep movsb byte es:[edi], byte [esi]
pop esi
jmp 0xda4075
mov al, byte [esi]
inc esi
xor ecx, ecx
shr al, 1
je 0xda419e
adc ecx, 2
mov ebp, eax
push esi
mov esi, edi
sub esi, eax
rep movsb byte es:[edi], byte [esi]
pop esi
mov ebx, 1
jmp 0xda4075
pop ebx
sub edi, dword [ebx + 0x10]
mov eax, edi
pop ebx
ret 0x10
Function at 0x401980
Capabilities:
Terminate process

Disassembly:
push 0xc
push 0x401ed0
call fcn.00401cd8
xor ebx, ebx
mov dword [ebp - 4], ebx
mov eax, dword fs:[0x18]
mov esi, dword [eax + 4]
mov edi, ebx
mov edx, 0x402364
mov ecx, esi
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x4017a8
cmp eax, esi
jne 0x40179b
xor esi, esi
inc esi
mov edi, esi
jmp 0x4017ab
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40177f
xor esi, esi
inc esi
cmp dword [0x402368], esi
jne 0x4017bd
push 0x1f
call fcn.00492000
pop ecx
jmp 0x4017f7
cmp dword [0x402368], ebx
jne 0x4017f1
mov dword [0x402368], esi
push 0x401018
push 0x40100c
call fcn.004018dc
pop ecx
pop ecx
test eax, eax
je 0x4017f7
mov dword [ebp - 4], 0xfffffffe
mov eax, 0xff
jmp 0x4018cc
mov dword [0x402014], esi
cmp dword [0x402368], esi
jne 0x40181a
push 0x401008
push section..text
call sub.msvcrt.dll__initterm
pop ecx
pop ecx
mov dword [0x402368], 2
test edi, edi
jne 0x401827
xor eax, eax
mov ecx, 0x402364
xchg dword [ecx], eax
cmp dword [0x40236c], 0
je 0x401853
push 0x40236c
call fcn.00401b30
pop ecx
test eax, eax
je 0x401853
push ebx
push 2
push ebx
mov esi, dword [0x40236c]
mov ecx, esi
call dword [0x40308c]
call esi
push dword [0x402020]
push dword [0x40201c]
push dword [0x402018]
call fcn.00401599
add esp, 0xc
mov dword [0x402010], eax
cmp dword [0x402028], 0
jne 0x4018b1
push eax
call dword [sym.imp.msvcrt.dll_exit]
mov ecx, dword [ebp - 0x14]
mov eax, dword [ecx]
mov eax, dword [eax]
mov dword [ebp - 0x1c], eax
push ecx
push eax
call sub.msvcrt.dll__XcptFilter
pop ecx
pop ecx
ret
cmp dword [0x402014], 0
jne 0x4018c5
call dword [sym.imp.msvcrt.dll__cexit]
mov eax, dword [0x402010]
mov dword [ebp - 4], 0xfffffffe
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
leave
ret
call fcn.00401c25
jmp 0x401763

Function at 0x401a14
Capabilities:
Parse pe header

Disassembly:
push 0xc
push 0x401ef0
call fcn.00401cd8
xor ecx, ecx
mov eax, dword [ebp + 8]
test eax, eax
je 0x401a74
cmp eax, 0xffffffff
je 0x401a74
mov dword [ebp - 4], ecx
mov edx, 0x5a4d
cmp word [eax], dx
jne 0x401a6d
mov edx, dword [eax + 0x3c]
test edx, edx
js 0x401a6d
cmp edx, 0x10000000
jae 0x401a6d
add eax, edx
mov dword [ebp - 0x1c], eax
mov ecx, dword [eax]
sub ecx, 0x4550
neg ecx
sbb ecx, ecx
not ecx
and ecx, eax
jmp 0x401a6a
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 4], 0xfffffffe
mov eax, ecx
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
leave
ret 4

Function at 0x401ae0
Capabilities:
Enumerate pe sections

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, dword [ebp + 8]
xor edx, edx
push ebx
push esi
push edi
mov ecx, dword [eax + 0x3c]
add ecx, eax
movzx eax, word [ecx + 0x14]
movzx ebx, word [ecx + 6]
add eax, 0x18
add eax, ecx
test ebx, ebx
je 0x401b1e
mov edi, dword [ebp + 0xc]
mov esi, dword [eax + 0xc]
cmp edi, esi
jb 0x401b16
mov ecx, dword [eax + 8]
add ecx, esi
cmp edi, ecx
jb 0x401b20
inc edx
add eax, 0x28
cmp edx, ebx
jb 0x401b06
xor eax, eax
pop edi
pop esi
pop ebx
pop ebp
ret
Function at 0x401860
Capabilities:
Write file on windows

Disassembly:
push ebx
sub esp, 0x18
mov dword [esp], 2
lea ebx, [esp + 0x24]
call fcn.004025b0
mov dword [esp + 8], 0x1b
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], str.Mingw_w64_runtime_failure:_n
call sub.msvcrt.dll_fwrite
mov dword [esp], 2
call fcn.004025b0
mov edx, dword [esp + 0x20]
mov dword [esp + 8], ebx
mov dword [esp], eax
mov dword [esp + 4], edx
call sub.msvcrt.dll_vfprintf
call sub.msvcrt.dll_abort
lea esi, [esi]

Function at 0x4018c0
Capabilities:
Allocate or change rwx memory

Disassembly:
push edi
push esi
push ebx
mov ebx, eax
sub esp, 0x30
mov esi, dword [0x406068]
test esi, esi
jle 0x4019e0
mov eax, dword [0x40606c]
xor ecx, ecx
add eax, 0xc
mov edx, dword [eax]
cmp edx, ebx
ja 0x4018f4
mov edi, dword [eax + 4]
add edx, dword [edi + 8]
cmp ebx, edx
jb 0x401977
add ecx, 1
add eax, 0x14
cmp ecx, esi
jne 0x4018e0
mov dword [esp], ebx
call fcn.00402250
mov edi, eax
test eax, eax
je 0x401a07
mov eax, dword [0x40606c]
lea ebx, [esi + esi*4]
shl ebx, 2
add eax, ebx
mov dword [eax + 0x10], edi
mov dword [eax], 0
call fcn.00402360
mov edx, dword [0x40606c]
add eax, dword [edi + 0xc]
mov dword [edx + ebx + 0xc], eax
lea edx, [esp + 0x14]
mov dword [esp + 8], 0x1c
mov dword [esp + 4], edx
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
sub esp, 0xc
test eax, eax
je 0x4019e7
mov eax, dword [esp + 0x28]
lea edx, [eax - 0x40]
and edx, 0xffffffbf
je 0x401970
lea edx, [eax - 4]
and edx, 0xfffffffb
jne 0x401980
add dword [0x406068], 1
add esp, 0x30
pop ebx
pop esi
pop edi
ret
cmp eax, 2
mov edx, 0x40
mov eax, 4
mov ecx, dword [esp + 0x20]
cmovne eax, edx
mov edx, dword [esp + 0x14]
add ebx, dword [0x40606c]
mov dword [ebx + 8], ecx
mov dword [ebx + 4], edx
mov dword [esp + 0xc], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], ecx
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
sub esp, 0x10
test eax, eax
jne 0x401970
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], str.__VirtualProtect_failed_with_code_0x_x
mov dword [esp + 4], eax
call fcn.00401860
lea esi, [esi]
lea esi, [esi]
xor esi, esi
jmp 0x4018fe
mov eax, dword [0x40606c]
mov eax, dword [eax + ebx + 0xc]
mov dword [esp + 8], eax
mov eax, dword [edi + 8]
mov dword [esp], str.__VirtualQuery_failed_for__d_bytes_at_address__p
mov dword [esp + 4], eax
call fcn.00401860
mov dword [esp + 4], ebx
mov dword [esp], str.Address__p_has_no_image_section
call fcn.00401860
lea esi, [esi]
nop
Function at 0x401ec0
Capabilities:
Get thread local storage value

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x1c
mov dword [esp], 0x406084
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ebx, dword [0x40607c]
sub esp, 4
test ebx, ebx
je 0x401f15
mov ebp, dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
lea esi, [esi]
mov eax, dword [ebx]
mov dword [esp], eax
call ebp
sub esp, 4
mov esi, eax
call edi
test eax, eax
jne 0x401f0e
test esi, esi
je 0x401f0e
mov eax, dword [ebx + 4]
mov dword [esp], esi
call eax
mov ebx, dword [ebx + 8]
test ebx, ebx
jne 0x401ef0
mov dword [esp], 0x406084
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
add esp, 0x1c
pop ebx
pop esi
pop edi
pop ebp
ret
Function at 0x401755
Capabilities:
Parse pe header

Disassembly:
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test eax, eax
je 0x401794
mov ecx, 0x5a4d
cmp word [eax], cx
jne 0x401794
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x401794
mov eax, 0x10b
cmp word [ecx + 0x18], ax
jne 0x401794
cmp dword [ecx + 0x74], 0xe
jbe 0x401794
cmp dword [ecx + 0xe8], 0
setne al
ret
xor al, al
ret

Function at 0x407786
Capabilities:
Allocate thread local storage

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push esi
push 0x4155e8
push 0x4155e0
push str.FlsAlloc
push 0x1f
call fcn.00407645
mov esi, eax
add esp, 0x10
test esi, esi
je 0x4077ba
push dword [ebp + 8]
mov ecx, esi
call dword [0x414110]
call esi
jmp 0x4077c0
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
pop esi
pop ebp
ret 4

Function at 0x407804
Capabilities:
Get thread local storage value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push esi
push 0x4155f8
push 0x4155f0
push str.FlsGetValue
push 0x21
call fcn.00407645
mov esi, eax
add esp, 0x10
test esi, esi
je 0x40783b
push dword [ebp + 8]
mov ecx, esi
call dword [0x414110]
call esi
pop esi
pop ebp
ret 4
pop esi
pop ebp
jmp dword [sym.imp.KERNEL32.dll_TlsGetValue]

Function at 0x407843
Capabilities:
Set thread local storage value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push esi
push 0x415600
push 0x4155f8
push str.FlsSetValue
push 0x22
call fcn.00407645
mov esi, eax
add esp, 0x10
test esi, esi
je 0x40787d
push dword [ebp + 0xc]
mov ecx, esi
push dword [ebp + 8]
call dword [0x414110]
call esi
pop esi
pop ebp
ret 8
pop esi
pop ebp
jmp dword [sym.imp.KERNEL32.dll_TlsSetValue]