Function at 0x404702
Capabilities:
Get common file path
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x31468
call fcn.0040c020
push ebx
push esi
lea eax, [ebp - 0x128]
push edi
mov ebx, ecx
push eax
push 0x104
mov dword [ebp - 4], ebx
call dword [sym.imp.kernel32.dll_GetTempPathA]
test eax, eax
jne 0x404740
lea eax, [ebp - 0x128]
push 0x41b2dc
push eax
call fcn.0040bb60
pop ecx
pop ecx
mov eax, dword [ebp + 8]
add eax, 0x10
push eax
lea eax, [ebp - 0x128]
push eax
call fcn.0040bb70
pop ecx
xor esi, esi
pop ecx
mov edi, dword [sym.imp.kernel32.dll_CreateFileA]
push esi
push 0x80
push 2
push esi
push 1
lea eax, [ebp - 0x128]
push 0x40000000
push eax
call edi
cmp eax, 0xffffffff
mov dword [ebp - 0xc], eax
jne 0x4047af
lea eax, [ebp - 0x328]
push 0x200
push eax
call fcn.004087ec
pop ecx
lea eax, [ebp - 0x328]
pop ecx
push eax
lea eax, [ebp - 0x128]
push eax
movzx eax, word [ebx + 0x20]
push eax
push ebx
push 0x41b2b0
jmp 0x4049d2
mov eax, dword [ebp + 8]
test byte [eax + 0x38], 1
jne 0x4048cf
lea eax, [ebp - 0x528]
push 0x200
push eax
push esi
call dword [sym.imp.kernel32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.kernel32.dll_GetModuleFileNameA]
push esi
push esi
push 3
push esi
push 3
lea eax, [ebp - 0x528]
push 0x80000000
push eax
call edi
cmp eax, 0xffffffff
mov dword [ebp - 0x14], eax
jne 0x404824
lea eax, [ebp - 0x328]
push 0x200
push eax
call fcn.004087ec
pop ecx
lea eax, [ebp - 0x328]
pop ecx
push eax
lea eax, [ebp - 0x528]
push eax
movzx eax, word [ebx + 0x20]
push eax
push ebx
push 0x41b284
jmp 0x4049d2
mov edi, dword [sym.imp.kernel32.dll_SetFilePointer]
push 2
push esi
push 0xfffffffffffffff8
push eax
call edi
lea eax, [ebp - 0x20]
mov ebx, dword [sym.imp.kernel32.dll_ReadFile]
push esi
push eax
lea eax, [ebp - 0x1c]
push 8
push eax
push dword [ebp - 0x14]
call ebx
cmp dword [ebp - 0x1c], 0x12345678
je 0x404876
mov eax, dword [ebp - 4]
movzx ecx, word [eax + 0x20]
push ecx
push eax
push 0x41b254
push 0x2e
call fcn.00408cb1
pop ecx
pop ecx
push eax
call fcn.00407d76
add esp, 0xc
jmp 0x4049da
cmp dword [ebp - 0x18], 0x30d40
ja 0x4048fa
cmp dword [ebp - 0x18], 0x1388
jb 0x4048fa
push 2
push esi
push 0xfffffffffffffff8
pop eax
sub eax, dword [ebp - 0x18]
push eax
push dword [ebp - 0x14]
call edi
lea eax, [ebp - 0x20]
push esi
push eax
lea eax, [ebp - 0x31468]
push dword [ebp - 0x18]
push eax
push dword [ebp - 0x14]
call ebx
lea eax, [ebp - 0x24]
push esi
push eax
lea eax, [ebp - 0x31468]
push dword [ebp - 0x18]
push eax
push dword [ebp - 0xc]
call dword [sym.imp.kernel32.dll_WriteFile]
push dword [ebp - 0x14]
call dword [sym.imp.kernel32.dll_CloseHandle]
mov ebx, dword [ebp - 4]
mov eax, dword [ebp + 8]
xor edi, edi
mov dword [ebp - 0x10], esi
cmp dword [eax + 0x3c], esi
jbe 0x404941
lea eax, [ebp - 0x10]
mov ecx, ebx
push eax
push dword [ebp - 0xc]
push edi
call fcn.00403afd
test eax, eax
je 0x40490f
mov eax, dword [ebp + 8]
inc edi
cmp edi, dword [eax + 0x3c]
jb 0x4048dc
jmp 0x404941
mov eax, dword [ebp - 4]
movzx ecx, word [eax + 0x20]
push ecx
push eax
push 0x41b224
push 0x2d
jmp 0x404861
push dword [ebp - 0xc]
call dword [sym.imp.kernel32.dll_CloseHandle]
lea eax, [ebp - 0x128]
push eax
movzx eax, word [ebx + 0x20]
push eax
push ebx
push 0x41b1fc
push 0x26
call fcn.00408cb1
pop ecx
pop ecx
push eax
call fcn.00407d76
add esp, 0x10
jmp 0x4049da
push dword [ebp - 0xc]
call dword [sym.imp.kernel32.dll_CloseHandle]
push dword [ebp - 0x10]
push 0x41b1e0
push 0x1a
call fcn.00408cb1
pop ecx
pop ecx
push eax
call fcn.0040a709
mov eax, dword [ebx + 0x24]
pop ecx
cmp dword [ebp - 0x10], eax
pop ecx
je 0x40497e
push eax
movzx eax, word [ebx + 0x20]
push dword [ebp - 0x10]
push eax
push ebx
push 0x41b194
push 0x48
jmp 0x4049ca
lea eax, [ebp - 0x128]
push eax
push 0x41b184
push 0xd
call fcn.00408cb1
pop ecx
pop ecx
push eax
call fcn.0040a709
pop ecx
xor edx, edx
pop ecx
lea ecx, [ebp - 0x128]
call fcn.00408010
mov edi, eax
cmp edi, 0xffffffff
jne 0x4049e1
call dword [sym.imp.kernel32.dll_GetLastError]
push eax
lea eax, [ebp - 0x128]
push eax
movzx eax, word [ebx + 0x20]
push eax
push ebx
push 0x41b15c
push 0x27
call fcn.00408cb1
pop ecx
pop ecx
push eax
call fcn.00407d76
add esp, 0x14
xor eax, eax
jmp 0x404ad0
lea eax, [ebp - 0x128]
push eax
push 0x41b140
push 0x19
call fcn.00408cb1
pop ecx
pop ecx
push eax
call fcn.0040a709
pop ecx
pop ecx
push 0x927c0
push edi
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
lea eax, [ebp - 0x128]
push eax
push 0x41b12c
push 0x13
call fcn.00408cb1
pop ecx
pop ecx
push eax
call fcn.0040a709
pop ecx
lea eax, [ebp - 8]
pop ecx
mov dword [ebp - 4], 1
push eax
push edi
call dword [sym.imp.kernel32.dll_GetExitCodeProcess]
test eax, eax
je 0x404a96
push dword [ebp - 8]
push dword [ebp - 8]
push 0x41b108
push 0x23
call fcn.00408cb1
pop ecx
pop ecx
push eax
call fcn.0040a709
add esp, 0xc
cmp dword [ebp - 8], esi
je 0x404a96
lea eax, [ebp - 0x128]
push eax
call fcn.0040d1b4
pop ecx
call dword [sym.imp.kernel32.dll_GetLastError]
push eax
movzx eax, word [ebx + 0x20]
push dword [ebp - 8]
push eax
push ebx
push 0x41b0c8
push 0x3c
call fcn.00408cb1
pop ecx
pop ecx
push eax
call fcn.00407d76
add esp, 0x14
mov dword [ebp - 4], esi
mov edi, dword [ebp + 8]
cmp dword [edi + 0x3c], esi
jbe 0x404ac0
lea eax, [ebp - 0x728]
mov ecx, ebx
push eax
push esi
call fcn.00403acd
lea eax, [ebp - 0x728]
push eax
call fcn.0040d1b4
inc esi
pop ecx
cmp esi, dword [edi + 0x3c]
jb 0x404a9e
lea eax, [ebp - 0x128]
push eax
call fcn.0040d1b4
mov eax, dword [ebp - 4]
pop ecx
pop edi
pop esi
pop ebx
leave
ret 4