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

Disassembly:
mov eax, 0x403c64
call sub.MSVCRT.dll__EH_prolog
sub esp, 0x34
push ebx
push esi
mov esi, ecx
push edi
lea ecx, [ebp - 0x1c]
mov dword [ebp - 0x10], 0x12345678
call sub.MFC42.DLL_CString::CString
and dword [ebp - 4], 0
lea eax, [esi + 0x170]
push eax
lea ecx, [esi + 0x168]
call sub.MFC42.DLL_CString::operator
lea eax, [ebp - 0x40]
lea edi, [esi + 0x64]
push eax
push edi
call dword [sym.imp.MSVCRT.dll__stat]
mov eax, dword [ebp - 0x2c]
pop ecx
test eax, eax
pop ecx
mov dword [0x406034], eax
je 0x402174
push eax
call dword [sym.imp.MSVCRT.dll_malloc]
test eax, eax
pop ecx
mov dword [esi + 0x16c], eax
je 0x402174
push 0x40603c
push edi
call dword [sym.imp.MSVCRT.dll_fopen]
mov edi, eax
pop ecx
test edi, edi
pop ecx
je 0x4020ca
push edi
mov ebx, dword [sym.imp.MSVCRT.dll_fread]
push dword [0x406034]
push 1
push dword [esi + 0x16c]
call ebx
push edi
mov dword [ebp - 0x14], eax
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [0x406034]
add esp, 0x14
cmp dword [ebp - 0x14], eax
jne 0x4020ca
lea ecx, [eax - 4]
xor edi, edi
test ecx, ecx
jbe 0x402077
mov ecx, dword [esi + 0x16c]
xor edx, edx
add ecx, edi
mov dword [ebp - 0x18], ecx
mov cl, byte [ecx]
cmp cl, byte [ebp + edx - 0x10]
jne 0x402049
mov ecx, dword [ebp - 0x18]
inc edx
inc ecx
cmp edx, 4
mov dword [ebp - 0x18], ecx
jb 0x402034
cmp edx, 4
je 0x40205a
add edi, 4
lea ecx, [eax - 4]
cmp edi, ecx
jb 0x402027
jmp 0x402077
mov eax, dword [esi + 0x16c]
push 8
add eax, edi
push 0x406030
push eax
call sub.MSVCRT.dll_memcpy
mov eax, dword [0x406034]
add esp, 0xc
add eax, 0xfffffffc
cmp edi, eax
jae 0x4020ca
mov eax, dword [esi + 0x170]
lea edi, [esi + 0x170]
lea ecx, [ebp - 0x40]
push ecx
push eax
call dword [sym.imp.MSVCRT.dll__stat]
pop ecx
test eax, eax
pop ecx
jne 0x4022ac
cmp dword [ebp - 0x2c], eax
je 0x4022ac
mov ecx, esi
call fcn.00402322
test al, al
je 0x4020ca
mov edi, dword [edi]
push 0x40603c
push edi
call dword [sym.imp.MSVCRT.dll_fopen]
pop ecx
mov dword [ebp - 0x10], eax
test eax, eax
pop ecx
jne 0x4020db
push dword [esi + 0x16c]
call dword [sym.imp.MSVCRT.dll_free]
jmp 0x402173
push dword [0x406034]
call dword [sym.imp.MSVCRT.dll_malloc]
mov edi, eax
pop ecx
test edi, edi
je 0x402174
push dword [ebp - 0x10]
push dword [0x406034]
push 1
push edi
call ebx
mov ecx, dword [0x406034]
add esp, 0x10
add ecx, 0xfffffffb
xor eax, eax
test ecx, ecx
jbe 0x402139
cmp byte [edi + eax], 0x6b
jne 0x402134
cmp byte [edi + eax + 1], 0x64
jne 0x402134
cmp byte [edi + eax + 2], 0x63
jne 0x402134
cmp byte [edi + eax + 3], 0x79
jne 0x402134
cmp byte [edi + eax + 4], 0x79
je 0x402189
inc eax
cmp eax, ecx
jb 0x402112
push edi
mov edi, dword [sym.imp.MSVCRT.dll_free]
call edi
push 0
push 0
push dword [ebp - 0x10]
call dword [sym.imp.MSVCRT.dll_fseek]
mov eax, dword [esi + 0x178]
push 0x406038
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 0x18
mov dword [ebp - 0x18], eax
test eax, eax
jne 0x4021aa
push dword [esi + 0x16c]
call edi
pop ecx
xor bl, bl
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x1c]
call fcn.00403464
mov al, bl
jmp 0x4022c7
push dword [esi + 0x16c]
mov esi, dword [sym.imp.MSVCRT.dll_free]
call esi
push edi
call esi
push dword [ebp - 0x10]
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0xc
mov bl, 1
jmp 0x402176
push eax
mov edi, dword [sym.imp.MSVCRT.dll_fwrite]
push dword [ebp - 0x14]
push 1
push dword [esi + 0x16c]
call edi
push dword [ebp - 0x18]
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x2c]
push 4
push 1
push eax
call edi
push dword [ebp - 0x18]
add dword [ebp - 0x14], eax
lea eax, [ebp - 0x1c]
push 4
push 1
push eax
call edi
push dword [ebp - 0x10]
add dword [ebp - 0x14], eax
push dword [0x406034]
push 1
push dword [esi + 0x16c]
call ebx
add esp, 0x40
test eax, eax
je 0x402224
push dword [ebp - 0x18]
push eax
push 1
push dword [esi + 0x16c]
call edi
push dword [ebp - 0x10]
add dword [ebp - 0x14], eax
push dword [0x406034]
push 1
push dword [esi + 0x16c]
call ebx
add esp, 0x20
jmp 0x4021f7
push dword [ebp - 0x10]
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esi + 0x174]
mov dword [esp], 0x40603c
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
pop ecx
mov dword [ebp - 0x10], eax
test eax, eax
pop ecx
je 0x4022ac
push eax
push dword [0x406034]
push 1
push dword [esi + 0x16c]
call ebx
add esp, 0x10
test eax, eax
je 0x40228b
push dword [ebp - 0x18]
push eax
push 1
push dword [esi + 0x16c]
call edi
push dword [ebp - 0x10]
add dword [ebp - 0x14], eax
push dword [0x406034]
push 1
push dword [esi + 0x16c]
call ebx
add esp, 0x20
jmp 0x40225e
push dword [ebp - 0x10]
mov edi, dword [sym.imp.MSVCRT.dll_fclose]
call edi
push dword [ebp - 0x18]
call edi
push dword [esi + 0x16c]
call dword [sym.imp.MSVCRT.dll_free]
add esp, 0xc
jmp 0x4022b9
push dword [esi + 0x16c]
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x1c]
call fcn.00403464
xor al, al
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret