Function at 0x40ae10
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x69c
mov eax, dword [0x499014]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
push dword [0x49b5cc]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [ebp - 0x628], ebx
cmp ebx, 0xffffffff
jne 0x40ae65
lea eax, [ebx + 0x65]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0045b910
mov esp, ebp
pop ebp
ret
mov ecx, ebx
call fcn.0040ac10
mov esi, eax
cmp esi, 0xffffffff
jne 0x40ae7d
mov ebx, 0x65
jmp 0x40b57b
push 0
push 0
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [ebp - 0x640]
push 0
push eax
push 0x20
push 0x49b548
push ebx
call edi
test eax, eax
je 0x40b568
mov eax, dword [ebp - 0x640]
cmp eax, 0xffffffff
jne 0x40aebf
mov ebx, 0x40000001
jmp 0x40b57b
cmp eax, 0x20
je 0x40aece
mov ebx, 0x40000002
jmp 0x40b57b
mov eax, dword [0x49b554]
xor ebx, ebx
test eax, eax
je 0x40aee3
add eax, 0xffffffe0
add eax, esi
mov dword [0x49b554], eax
imul eax, dword [0x49b564], 0x104
push 2
add eax, 2
push eax
call fcn.0045f3d4
add esp, 8
mov dword [ebp - 0x644], eax
mov dword [0x49be74], eax
test eax, eax
jne 0x40af12
lea ebx, [eax + 0x66]
jmp 0x40b57b
xor ecx, ecx
mov dword [eax], ecx
mov dword [ebp - 0x640], ecx
cmp dword [0x49b564], ecx
jle 0x40b57b
nop dword [eax + eax]
mov ebx, dword [ebp - 0x628]
lea eax, [ebp - 0x64c]
push 0
push eax
push 2
lea eax, [ebp - 0x634]
push eax
push ebx
call edi
test eax, eax
je 0x40b568
mov eax, dword [ebp - 0x64c]
cmp eax, 0xffffffff
je 0x40aeb5
cmp eax, 2
jne 0x40aec4
mov ax, word [ebp - 0x634]
test ax, ax
je 0x40ae73
mov ecx, 0x104
cmp ax, cx
jae 0x40ae73
movzx esi, ax
lea eax, [ebp - 0x650]
push 0
push eax
add esi, esi
lea eax, [ebp - 0x210]
push esi
push eax
push ebx
call edi
test eax, eax
je 0x40b568
mov eax, dword [ebp - 0x650]
cmp eax, 0xffffffff
je 0x40aeb5
cmp eax, esi
jne 0x40aec4
movzx eax, word [ebp - 0x634]
add eax, eax
cmp eax, 0x208
jae 0x40b59a
xor ecx, ecx
mov word [ebp + eax - 0x210], cx
xor eax, eax
xor cl, cl
mov word [ebp - 0x620], ax
call fcn.0040b5a0
mov ecx, eax
test ecx, ecx
je 0x40b010
lea edx, [ebp - 0x620]
sub edx, ecx
nop dword [eax]
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x40b000
lea edx, [ebp - 0x210]
mov esi, edx
nop dword [eax + eax]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x40b020
lea edi, [ebp - 0x620]
sub edx, esi
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x40b036
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 esi, dword [ebp - 0x644]
lea ecx, [ebp - 0x620]
mov edx, esi
mov eax, ecx
sub edx, eax
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x40b062
mov ecx, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40b077
sub ecx, edx
xor eax, eax
sar ecx, 1
lea edx, [ebp - 0x65c]
push 4
lea esi, [esi + ecx*2]
mov ecx, ebx
add esi, 2
mov dword [ebp - 0x644], esi
mov word [esi], ax
call fcn.0040aa70
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x40b57b
lea ecx, [ebp - 0x620]
call fcn.0040a860
test eax, eax
jne 0x40b561
lea ecx, [ebp - 0x620]
call fcn.0040aa50
mov edi, eax
mov dword [ebp - 0x624], edi
cmp edi, 0xffffffff
je 0x40b55a
lea eax, [ebp - 0x210]
push str.mmfs2.dll
push eax
call fcn.00460528
mov esi, dword [ebp - 0x628]
add esp, 8
mov ecx, esi
push 4
test eax, eax
jne 0x40b21e
lea edx, [ebp - 0x638]
call fcn.0040aa70
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x40b551
push 1
push eax
push eax
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push esi
call eax
push 0x1e8480
mov dword [ebp - 0x63c], eax
call fcn.004606f8
mov edi, eax
add esp, 4
test edi, edi
je 0x40b1f4
push dword [ebp - 0x638]
call fcn.004606f8
mov esi, eax
add esp, 4
test esi, esi
je 0x40b1e5
push dword [ebp - 0x638]
mov ecx, dword [ebp - 0x628]
mov edx, esi
call fcn.0040aa70
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x40b1dc
push dword [ebp - 0x638]
lea edx, [ebp - 0x630]
mov dword [ebp - 0x630], 0x1e8480
push esi
mov ecx, edi
call fcn.00457dc0
add esp, 8
test eax, eax
je 0x40b1a9
mov ebx, 0x65
jmp 0x40b1dc
mov ebx, dword [ebp - 0x630]
lea eax, [ebp - 0x654]
push 0
push eax
push ebx
push edi
push dword [ebp - 0x624]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40b538
cmp dword [ebp - 0x654], ebx
jne 0x40b524
xor ebx, ebx
push esi
call fcn.0045f3ea
add esp, 4
push edi
call fcn.0045f3ea
mov esi, dword [ebp - 0x628]
add esp, 4
mov eax, dword [ebp - 0x638]
add eax, dword [ebp - 0x63c]
push 0
push 0
push eax
push esi
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
call esi
mov edi, dword [ebp - 0x624]
test ebx, ebx
jne 0x40b551
jmp 0x40b27a
lea edx, [ebp - 0x648]
call fcn.0040aa70
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x40b551
push 1
push eax
push eax
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push esi
call eax
push dword [ebp - 0x648]
mov esi, eax
push dword [ebp - 0x628]
push edi
call dword [sym.imp.MMFS2.dll_Ordinal_766]
mov ebx, eax
test ebx, ebx
jne 0x40b551
push eax
push eax
mov eax, dword [ebp - 0x648]
add eax, esi
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push eax
push dword [ebp - 0x628]
call esi
lea ecx, [ebp - 0x210]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40b283
sub ecx, edx
sar ecx, 1
cmp ecx, 4
jl 0x40b3dc
lea eax, [ebp + ecx*2 - 0x218]
push str..mfx
push eax
call fcn.00460528
add esp, 8
test eax, eax
jne 0x40b3dc
push eax
push eax
push eax
push edi
call esi
mov ecx, edi
call fcn.0040ab50
push 1
push 0x8000
mov dword [ebp - 0x630], eax
xor esi, esi
call fcn.0045f3d4
mov ecx, eax
add esp, 8
mov eax, dword [ebp - 0x630]
mov dword [ebp - 0x62c], ecx
test eax, eax
je 0x40b3a6
mov edi, 0x8000
cmp eax, edi
push 0
cmovb edi, eax
lea eax, [ebp - 0x658]
push eax
push edi
push ecx
push dword [ebp - 0x624]
mov dword [ebp - 0x63c], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40b394
mov eax, dword [ebp - 0x658]
cmp eax, 0xffffffff
je 0x40b39a
cmp eax, edi
jne 0x40b39a
mov eax, dword [ebp - 0x62c]
shr edi, 2
test edi, edi
je 0x40b354
nop dword [eax]
mov edx, dword [eax]
mov ecx, esi
shr ecx, 0x1f
add eax, 4
add ecx, edx
lea esi, [ecx + esi*2]
sub edi, 1
jne 0x40b340
mov edi, dword [ebp - 0x63c]
and edi, 3
jbe 0x40b375
nop
movzx edx, byte [eax]
lea eax, [eax + 1]
mov ecx, esi
shr ecx, 0x1f
add ecx, edx
lea esi, [ecx + esi*2]
sub edi, 1
jne 0x40b360
mov eax, dword [ebp - 0x630]
sub eax, dword [ebp - 0x63c]
mov ecx, dword [ebp - 0x62c]
mov dword [ebp - 0x630], eax
je 0x40b3a0
jmp 0x40b2f2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x62c]
mov edi, dword [ebp - 0x624]
push 0x8000
push 0
push ecx
call fcn.0045d270
push dword [ebp - 0x62c]
call fcn.0045f3ea
add esp, 0x10
mov eax, 0x65
cmp dword [ebp - 0x65c], esi
cmovne ebx, eax
push 2
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
jne 0x40b57b
lea eax, [ebp - 0x210]
push str.FormattedText.dll
push eax
call fcn.00460528
add esp, 8
test eax, eax
jne 0x40b504
push 0x8001
call dword [sym.imp.KERNEL32.dll_SetErrorMode]
push ebx
mov edi, eax
lea eax, [ebp - 0x620]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryExW]
mov dword [0x49b530], eax
test eax, eax
je 0x40b4fd
push str.getRunInfo
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
test esi, esi
je 0x40b4fd
push 0x3c
lea eax, [ebp - 0x698]
push ebx
push eax
call fcn.0045d270
add esp, 0xc
lea eax, [ebp - 0x698]
push eax
push 0x49b580
call esi
test eax, eax
jne 0x40b4fd
mov eax, dword [ebp - 0x688]
mov dword [0x49be60], eax
mov eax, dword [ebp - 0x690]
mov dword [0x49be64], eax
mov eax, dword [ebp - 0x68c]
mov dword [0x49be68], eax
mov eax, dword [ebp - 0x684]
mov dword [0x49be6c], eax
mov eax, dword [ebp - 0x680]
mov dword [fcn.0041f8a0], eax
mov eax, dword [ebp - 0x67c]
mov dword [fcn.0041f8a0], eax
mov eax, dword [ebp - 0x678]
mov dword [fcn.0041f6f0], eax
mov eax, dword [ebp - 0x670]
mov dword [0x49a0bc], eax
mov eax, dword [ebp - 0x674]
mov dword [fcn.0041f8a0], eax
mov eax, dword [ebp - 0x66c]
mov dword [0x49a02c], eax
mov eax, dword [ebp - 0x668]
mov dword [0x499dec], eax
mov eax, dword [ebp - 0x664]
mov dword [0x499bcc], eax
mov eax, dword [ebp - 0x660]
mov dword [0x4999ac], eax
push edi
call dword [sym.imp.KERNEL32.dll_SetErrorMode]
mov esi, dword [ebp - 0x640]
inc esi
mov dword [ebp - 0x640], esi
cmp esi, dword [0x49b564]
jge 0x40b57b
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
jmp 0x40af30
mov edi, dword [ebp - 0x624]
mov ebx, 0x40000004
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40b57b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, dword [ebp - 0x624]
lea ebx, [eax - 0x70]
neg ebx
sbb ebx, ebx
add ebx, 0x40000004
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40b57b
mov ebx, 0x68
jmp 0x40b57b
mov ebx, 0x67
jmp 0x40b57b
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ebx, [eax - 0x26]
neg ebx
sbb ebx, ebx
add ebx, 0x40000002
push dword [ebp - 0x628]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0045b910
mov esp, ebp
pop ebp
ret
call fcn.0045ba80
int3